es-stl - v3.0.3
    Preparing search index...

    Type Alias Brand<T, Name>

    Brand: T & { "[brand]": Name }

    Value distinguished from structurally identical values by a type-only brand.

    Type Parameters

    • T

      Underlying value type.

    • Name extends string

      Unique name that identifies the branded value.

    A brand adds no runtime property or validation. Create branded values only after validating or otherwise establishing their meaning.

    type UserId = Brand<string, 'UserId'>;
    const userId = 'user-1' as UserId;