3 ms·
It's also possible -- for specific cases, probably not generally -- define your schema object as const and use type manipulation to generate "real" types automa
by andrewaylett 3y ago
It's also possible -- for specific cases, probably not generally -- define your schema object as const and use type manipulation to generate "real" types automagically. Toy example here: https://github.com/andrewaylett/aylett.co.uk/blob/3fffae1bab2c31c1b7b7b68f38b94d25405c442f/src/types.ts https://github.com/andrewaylett/aylett.co.uk/blob/3fffae1bab...
This lets me run my inputs through a schema validator, and ensure that the type I'm using statically will match the schema used at runtime.