Core utility for creating nominal typing in TypeScript by adding a type tag to any object.
This allows for creating distinct types that are structurally identical but considered different by TypeScript's type system.
Type Parameters
Tagextendsstring
The string literal type used as the discriminator
T = object
The base type to extend with the tag
Param: params
The parameters containing the tag and implementation
Core utility for creating nominal typing in TypeScript by adding a type tag to any object. This allows for creating distinct types that are structurally identical but considered different by TypeScript's type system.