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

Method set

ark/util/weak.ts:20–25  ·  view source on GitHub ↗
(key: string, value: v)

Source from the content-addressed store, hash-verified

18 }
19
20 set(key: string, value: v): v {
21 if (!this.cleanup) return this.pin(key, value)
22 this.refs.set(key, new WeakRef(value))
23 this.cleanup.register(value, key)
24 return value
25 }
26
27 pin(key: string, value: v): v {
28 this.refs.set(key, { deref: () => value })

Callers 15

createLayersFunction · 0.45
highlightLayerFunction · 0.45
runTargetFunction · 0.45
diagnosticOutputsFunction · 0.45
readExpectedFunction · 0.45
readActualDirFunction · 0.45
createTokenizerFunction · 0.45
addInjectionFunction · 0.45
grammarForFunction · 0.45
toCharMapFunction · 0.45
oracleOutputsFunction · 0.45
loadGrammarFunction · 0.45

Calls 1

pinMethod · 0.95

Tested by 7

addFunction · 0.36
typeOfFunction · 0.36
normalizeIdsFunction · 0.36
minimizeFunction · 0.36
runStaticFunction · 0.36
requestFunction · 0.36
constructorMethod · 0.36