string enum with period
See original GitHub issueThere are a few problems with code generated from .\node_modules@types\react-native-fbsdk\index.d.ts. A string enum with a period isn’t handled correctly. It doesn’t compile:
This is from this snippet:
export type Permissions = 'public_profile'
| 'user_friends'
| 'email'
| 'user_about_me'
| 'user_actions.books'
| 'user_actions.fitness'
| 'user_actions.music'
| 'user_actions.news'
| 'user_actions.video'
| 'user_birthday'
| 'user_education_history'
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Java - create enums with dot notation
I need to have enums with dot notation like this WEATHER.SUNNY since they represent topics using wildcards. I know that this is not...
Read more >How can I write an enum for date periods where not all ...
But I have two other standard date periods that do not have a static number of months. One is YEAR_TO_DATE and another is...
Read more >TypeScript string enums, and when and how to use them
No matter how much you know about TypeScript enums, this guide covers all the best practices for using string-based enums in production.
Read more >EnumToString((ENUM_TIMEFRAMES)Period()) problem
There may be a size limit on the string. My guess is 32 characters. StringSubstr(EnumToString((ENUM_TIMEFRAMES)Period()),7)+" ...
Read more >Enum Period
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I sended a PR for this issue #231 I think the generated code should as follows
As // by default Fable lowercases the first letter of the name for the value
| Public_profile
will compiled topulbic_profile
automaticallySorry for the delay release. Currently the npm authentication is invalidated #236 @ctaggart will fix it You can also try ts2fable@next for now. I think the last version of it fixed the issue