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

Function valueKeyOf

ark/schema/parse.ts:410–413  ·  view source on GitHub ↗
(v: unknown, $: BaseScope)

Source from the content-addressed store, hash-verified

408 node.$ === $ ? `#${node.id}` : `#${node.id}@${node.$.index}`
409
410const valueKeyOf = (v: unknown, $: BaseScope): string =>
411 isNode(v) ? idOf(v, $)
412 : isArray(v) ? `[${v.map(item => valueKeyOf(item, $)).join()}]`
413 : literalKeyOf(v)
414
415// objects are compared by reference, except dates, which units compare by value
416const literalKeyOf = (v: unknown): string =>

Callers 1

nodeKeyOfFunction · 0.85

Calls 4

isNodeFunction · 0.90
literalKeyOfFunction · 0.85
idOfFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected