Hyperlinkv0.8.0-beta.28

Schema

Schema.isULIDfunctioneffect/Schema.ts:6751
(annotations?: Annotations.Filter): SchemaAST.Filter<string>

Validates that a string is a valid ULID (Universally Unique Lexicographically Sortable Identifier).

Details

JSON Schema:

This check corresponds to a pattern constraint in JSON Schema that matches the ULID format.

Arbitrary:

When generating test data with fast-check, this applies a patterns constraint to ensure generated strings match the ULID pattern.

String checks
Source effect/Schema.ts:675113 lines
export function isULID(annotations?: Annotations.Filter) {
  const regExp = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/
  return isPattern(
    regExp,
    {
      meta: {
        _tag: "isULID",
        regExp
      },
      ...annotations
    }
  )
}
Referenced by 1 symbols