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

Function hashJsonOf

ark/schema/node.ts:325–328  ·  view source on GitHub ↗
(json: object)

Source from the content-addressed store, hash-verified

323const maxInlinedLength = 256
324
325const hashJsonOf = (json: object): string =>
326 jsonLengthOf(json) <= maxPlainHashLength ?
327 JSON.stringify(json)
328 : `${jsonPrefixOf(json, hashedPrefixLength)}#${digestOf(json)}`
329
330const jsonLengths = new WeakMap<object, number>()
331

Callers 2

innerHashFunction · 0.85
hashFunction · 0.85

Calls 3

jsonLengthOfFunction · 0.85
jsonPrefixOfFunction · 0.85
digestOfFunction · 0.70

Tested by

no test coverage detected