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
I've been thinking about enforcing stronger types in our codebase. We have a lot of ids that are just numbers that we pass around, and sometimes they get swapped around (which is bad).
I'm not sure how that would look in typescript-generator - perhaps a @flavor annotation on a field that would generate an appropriate type? Or perhaps an annotation that pointed to a custom serializer?
Is it possible to do something like this now in typescript-generator?
The text was updated successfully, but these errors were encountered:
I've been thinking about enforcing stronger types in our codebase. We have a lot of ids that are just numbers that we pass around, and sometimes they get swapped around (which is bad).
I read this article about "Flavor Types" as a solution to this problem in TypeScript: https://spin.atomicobject.com/2018/01/15/typescript-flexible-nominal-typing/
I'm not sure how that would look in typescript-generator - perhaps a @flavor annotation on a field that would generate an appropriate type? Or perhaps an annotation that pointed to a custom serializer?
Is it possible to do something like this now in typescript-generator?
The text was updated successfully, but these errors were encountered: