News for hackers. Stuff that matters.
Re:TypeScript’s quirks: How inconsistencies make the languag... by _bAp_ on Saturday February 01, 2020 @07:36AM (#22210192)
I had the same problem and used a JSONSchema as a single source of truth. Then from that schema you can generate:

- the typescript interfaces: https://www.npmjs.com/package/json-schema-to-typescript

- the runtime checks with AJV

So you have no duplication and you're type safe.

There are no comments on this comment yet.