MCPcopy Create free account
hub / github.com/Effect-TS/effect / isULID

Function isULID

packages/effect/src/Schema.ts:7073–7087  ·  view source on GitHub ↗
(annotations?: Annotations.Filter)

Source from the content-addressed store, hash-verified

7071 * @since 4.0.0
7072 */
7073export function isULID(annotations?: Annotations.Filter) {
7074 const regExp = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/
7075 return isPattern(
7076 regExp,
7077 {
7078 representation: {
7079 id: "effect/schema/isULID",
7080 payload: null
7081 },
7082 toJsonSchema: () => ({ pattern: regExp.source }),
7083 toCode: () => ({ runtime: "Schema.isULID()" }),
7084 ...annotations
7085 }
7086 )
7087}
7088
7089/**
7090 * Reviver for persisted `isULID` checks.

Callers 1

Schema.tsFile · 0.85

Calls 1

isPatternFunction · 0.70

Tested by

no test coverage detected