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

Function scanAnd

ark/type/deferred.ts:549–557  ·  view source on GitHub ↗
(def: string)

Source from the content-addressed store, hash-verified

547}
548
549const scanAnd = (def: string): Facts | undefined => {
550 const at = def.indexOf(" & ")
551 if (at === -1) return scanUnion(def)
552 const l = scanTerm(def.slice(0, at))
553 const right = def.slice(at + 3)
554 const r =
555 regexLiteral.test(right) ? regexLiteralFacts(right) : scanTerm(right)
556 return refinesString(l) && refinesString(r) ? andFacts(l, r) : undefined
557}
558
559// what its node holds, sized since a source is whatever's written
560const patternFacts = (rule: string, flags: string): Facts => ({

Callers 1

scanUncachedFunction · 0.85

Calls 6

scanUnionFunction · 0.85
scanTermFunction · 0.85
regexLiteralFactsFunction · 0.85
refinesStringFunction · 0.85
andFactsFunction · 0.85
testMethod · 0.80

Tested by

no test coverage detected