Open robkuz opened 6 years ago
I am also not clear how to solve this special case 😕
type [<StringEnum>] [<RequireQualifiedAccess>] TriggerOperation =
| [<CompiledName "create">] CreateLowerCase
| [<CompiledName "update">] UpdateLowerCase
| [<CompiledName "delete">] DeleteLowerCase
| [<CompiledName "all">] ReplaceLowerCase
| All
| Create
| Update
| Delete
| Replace
Any other ones have better solutions?
My proposal would be
A) if this is a string enum on the TS side we could assume (heuristically) that the same value constructors with different casings are just there so the typical TS developer can push anything they want into the api (Pre, pre or PRE for example) and then it doesn't matter if we just offer ONE value
or if we would assume that those different cases have a different meaning then
B) you we prefix the values
type [<StringEnum>] [<RequireQualifiedAccess>] TriggerType =
| [<CompiledName "Pre">] Pre
| [<CompiledName "Post">] Post
| [<CompiledName "pre">] LC_Pre
| [<CompiledName "post">] LC_Post
Hey,
I found this in
@types/DocumentDB
this is converted into the following F#
Which is clearly wrong as there is now 2 value constructors with the exact name whereas the Typescript ones have differences in lower case vs upper case.