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

Function allows

ark/schema/shared/compile.ts:346–351  ·  view source on GitHub ↗
(node: BaseNode, arg: string = this.data)

Source from the content-addressed store, hash-verified

344
345 // Allows adds no errors to ctx, so a predicate reading it runs in a branch
346 allows(node: BaseNode, arg: string = this.data): string {
347 if (!node.allowsCtx) return this.inv(node, { arg, kind: "Allows" })
348 return node.checksCtx ?
349 `${this.ref(allowsInBranchBy)}(${this.ctx}, ${this.refToId(node.id, { kind: "Allows" })}, ${arg})`
350 : `${this.ref(node)}.allows(${arg})`
351 }
352
353 applyMember(node: BaseNode, member: BaseNode = node): string {
354 return member.hasAlias ? this.resolution(node, member.id) : this.inv(node)

Callers 3

rejectsFunction · 0.70
wrapperFunction · 0.50
allowsUnusedFunction · 0.50

Calls 3

refToIdMethod · 0.65
invMethod · 0.45
refMethod · 0.45

Tested by

no test coverage detected