4 ms·
My only wish for TS (which I use on the daily and love) is for some way to export type annotations at runtime. Like I'd love to inspect a class property and see
by pfooti 9y ago
My only wish for TS (which I use on the daily and love) is for some way to export type annotations at runtime. Like I'd love to inspect a class property and see if it is annotated as "this is a date" (in particular for deserializing JSON, which is a constant bugaboo for me). Right now, I just generate two parallel schema definitions, one that typescript uses to provide compile-time type safety, and another that's just a pojo to access at runtime to get more data.
- styfle 9y agoMaybe something like this? https://github.com/YousefED/typescript-json-schema https://github.com/YousefED/typescript-json-schema