vojtechhabarta/typescript-generator

Feature Request: Instantiate Date instances in constructor

softhouse-anthonkendel opened this issue · 0 comments

We're using this library to generate our TypeScript definitions and so far has worked perfectly. But with later changes in our codebase, we have experienced an issue with fields marked as Date (in TypeScript) is not instantiated as Date.

For example, our backend returns ISO date-time string and then passed to the constructor but the instance still uses string date-time values when we want it as Date and the TypeScript definition is typed as Date.

With this issue we're hoping to get this feature implemented, either by default or behind an option/feature flag.

If you could point us in the correct direction or have an implementation proposal, we could write the PR.

Thanks! 🙂