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

Function wrapper

ark/schema/node.ts:860–871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858 // keeps what compiled, as a detached reference can call this after
859 let compiled: BaseNode["allows"] | undefined
860 const wrapper: BaseNode["allows"] = data => {
861 if (compiled !== undefined) return compiled(data)
862 if (this.c.preJit) {
863 if (this.checksUncompiled) {
864 this.c.usedPreJit = true
865 return allows(data)
866 }
867 this.$.jit(this)
868 }
869 // if the node was frozen before jit ran, this.allows wasn't overwritten
870 return (compiled = this.allows === wrapper ? allows : this.allows)(data)
871 }
872 this.allows = wrapper
873 }
874

Callers

nothing calls this directly

Calls 1

allowsFunction · 0.50

Tested by

no test coverage detected