You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@baywet I have made some local changes and from initial observation it looks like the serializer/de-serializer has to be modified as well e.g.
// Sample enumconstBodyTypeConst={Text: "text",Html: "html",}asconst;typeBodyType=keyoftypeofBodyTypeConst;// End of sample enum// utility function to convert to proper casingfunctiontoFirstCharacterUpper(str: string){if(!str)returnstr;returnstr.charAt(0).toUpperCase()+str.slice(1);}// JsonParseNode function getEnumValue functiongetEnumValueByKey<TextendsRecord<string,unknown>>(enumObject: T): T[keyofT]|undefined{const_key="foo";// get the actual keyif(_keyinenumObject){returnenumObject[_key]asT[keyofT];}returnundefined;}
We're currently generating enums like that
Which transpiles down to
We should probably instead consider generating this
Not only this allows consumers to use the string literal and the symbol interchangeably, it results in this
The text was updated successfully, but these errors were encountered: