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

Function keptForJob

ark/schema/node.ts:309–317  ·  view source on GitHub ↗
(cache: NodeCache, hash: string)

Source from the content-addressed store, hash-verified

307let hashedInJob: NodeCache[] = []
308
309const keptForJob = (cache: NodeCache, hash: string): string => {
310 if (hash.length > 256 && hashedInJob.push(cache) === 1) {
311 void Promise.resolve().then(() => {
312 for (const cache of hashedInJob) cache.innerHash = cache.hash = undefined
313 hashedInJob = []
314 })
315 }
316 return hash
317}
318
319// past this length, a hash is a prefix of the JSON, by which siblings still sort, and a digest
320const maxPlainHashLength = 65_536

Callers 2

innerHashFunction · 0.85
hashFunction · 0.85

Calls 2

resolveMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected