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

Function keyOfName

ark/schema/units.ts:517–520  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

515 const keysByName: Record<string, string> = {}
516 let nameCount = 0
517 const keyOfName = (name: string) => {
518 const kind = kindsByName[name] ?? name.replace(/\$[1-9]\d*$/, "")
519 return `${kind}#${nameCount++}`
520 }
521 // a quote after a backslash is text in a string the hash holds, not a
522 // reference. Matched by the character before and not a lookbehind, since a
523 // lookbehind in a literal fails the whole module to parse before Safari 16.4

Callers 1

keyRegisteredNamesFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected