plainfp - v0.1.0
    Preparing search index...

    Function make

    • Cast a value to its branded type. Pure type-level sugar — no runtime validation. For validated construction, wrap it in a parser that returns Result<Brand<T, K>, E>.

      Type Parameters

      • T
      • K extends string

      Parameters

      • value: T

      Returns Brand<T, K>

      type UserId = Brand<string, "UserId">
      const toUserId = (s: string): UserId => make<string, "UserId">(s)
      const id = toUserId("u_42")