Brand<T, B>: T & {
    [___brand]: B;
}

Phantom brand utility. Produces a nominal type T & { [__brand]: B } — the brand tag is erased at runtime so there is zero allocation overhead.

Type Parameters

  • T

    The underlying JavaScript type (string, number, bigint).

  • B extends string

    A unique string literal that identifies the brand.

1.0.0