3 ms·
Is there something wrong with creating opaque types using this method? type ObjectId = string & { readonly __tag: unique symbol } This way, we don't n
by gmdrd 2y ago
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.