FuncType - v0.8.85
    Preparing search index...

    Function BoundedString

    • Create a string brand with length constraints

      Parameters

      • brand: string
      • minLength: number
      • maxLength: number

      Returns ValidatedBrand<string, string>

      const Username = BoundedString("Username", 3, 20)
      const valid = Username.of("johndoe") // Some(Brand<"Username", string>)
      const tooShort = Username.of("jo") // None
      const tooLong = Username.of("verylongusernamethatexceedslimit") // None