Adding type safety to object IDs in Typescript

Jan 31, 2024

https://www.kravchyk.com/adding-type-safety-to-object-ids-typescript/

The article introduces template literal types in typescript:

type NodeId = `node_${string}`

Which is, as you might guess, a type representing of strings beginning with node_

↑ up