Typescript doesn't have functionality for non-equivalent types with identical primitives or interfaces (e.g. you can't have string-equivalent type A ≠ string-equivalent type B), though there's ongoing discussion around adding it (https://github.com/Microsoft/TypeScript/issues/202).
Re:GUIDs Are Not the Only Answer
by 0xdeafcafe on Tuesday January 05, 2021 @05:59PM
(#25652419)
Arctic take.
Re:GUIDs Are Not the Only Answer
by hermanradtke on Tuesday January 05, 2021 @09:35PM
(#25654111)
That is why we use things like io-ts. t.Int is a branded type that ensures number is whole and greater than 0.
Tell that to almost every Typescript developer who uses `number` for identifiers.