MCPcopy Create free account
hub / github.com/arktypeio/arktype / patternSchemaOf

Function patternSchemaOf

ark/sets/fromJsonSchema.ts:1581–1591  ·  view source on GitHub ↗
(source: string, pointer: string)

Source from the content-addressed store, hash-verified

1579}
1580
1581const patternSchemaOf = (source: string, pointer: string) => {
1582 try {
1583 new RegExp(source, "u")
1584 } catch {
1585 return throwParseError(
1586 writeInvalidKeywordMessage(pointer, "a valid pattern", source)
1587 )
1588 }
1589 const flags = flagsOf(source)
1590 return flags ? { rule: source, flags } : { rule: source }
1591}
1592
1593type KeyBudget = {
1594 remaining: number

Callers 2

fromJsonSchema.tsFile · 0.85
readObjectFunction · 0.85

Calls 3

throwParseErrorFunction · 0.90
flagsOfFunction · 0.85

Tested by

no test coverage detected