News for hackers. Stuff that matters.
Re:TypeScript: Branded Types by gmdrd on Friday April 26, 2024 @07:33AM (#40168087)
Is there something wrong with creating opaque types using this method?

  type ObjectId = string & { 
  readonly __tag: unique 
  symbol }
This way, we don't need to use `never`, but we still prevent the creation of a structurally equivalent type by mistake.

There are no comments on this comment yet.