(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.
export function function isULID(
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.
isULID(annotations: Annotations.Filter | undefinedannotations?: Annotations.interface Annotations.FilterAnnotations for filter schema nodes (created via Schema.filter). Extends
Augment
with an optional error message, identifier, and metadata.
Filters are intentionally non-parametric to keep them covariant.
Filter) {
const const regExp: globalThis.RegExpregExp = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/
return const isPattern: (
regExp: globalThis.RegExp,
annotations?: Annotations.Filter
) => SchemaAST.Filter<string>
Validates that a string matches the specified regular expression pattern.
Details
JSON Schema:
This check corresponds to the pattern constraint in JSON Schema.
Arbitrary:
When generating test data with fast-check, this applies a patterns
constraint to ensure generated strings match the specified RegExp pattern.
isPattern(
const regExp: globalThis.RegExpregExp,
{
Annotations.Filter.meta?: Annotations.Meta | undefined(property) Annotations.Filter.meta?: {
_tag: 'isULID';
regExp: globalThis.RegExp;
}
Optional metadata used to identify or extend the filter with custom data.
meta: {
_tag: "isULID"_tag: "isULID",
regExp: globalThis.RegExpregExp
},
...annotations: Annotations.Filter | undefinedannotations
}
)
}