@glideapps/ts-necessities
    Preparing search index...

    Function makeBrandString

    • Returns a function that brands a string with the specified brand. For example:

      type Apple = BrandedString<"apple">;
      // `makeApple` will be of type `(s: string) => Apple`
      const makeApple = makeBrandString<Apple>();
      // `apple` will be of type `Apple`
      const apple = makeApple("Pink Lady");

      Type Parameters

      • T

      Returns T extends BrandedString<string> ? (s: string) => T<T> : never