News for hackers. Stuff that matters.
Re:Why doesn't TypeScript properly type Object.keys? by andrewaylett on Saturday June 24, 2023 @11:56AM (#36459758)
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/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.

There are no comments on this comment yet.