News for hackers. Stuff that matters.
Re:TypeScript Features to Avoid by jbbe on Thursday January 20, 2022 @01:04PM (#30012360)
I often use that approach but (especially when you're importing from a seperate package) the compiler will sometimes view MyType as just an alias for string and won't catch typos.

Am I missing something in how to use this?

Re:TypeScript Features to Avoid by Recursing on Thursday January 20, 2022 @01:17PM (#30012519)
`as const` is the important bit there, see this playground link https://www.typescriptlang.org/play?#code/MYewdgzgLgBKlQIICd...