Closed snortblt closed 5 years ago
Hey @snortblt
Can you add a test case for it ? As in just to demonstrate your use case.
Please add the brackets, the are necessary for the ts compiler.
(attribute: string) => string | caseOption => ((attribute: string) => string) | caseOption
Done 👍
Thanks @snortblt and @christianengledercadt
Released v2.1.2
on npmjs.
The
Serializer.keyForAttribute
property type is declared as(attribute: string) => string | caseOptions
. Providing a function that returns one of these caseOptions prevents correct serialization of any attributes. If the property is assigned to acaseOptions
literal string instead serialization works. Should the type be declared as((attribute: string) => string) | caseOptions
instead (note the parens)?