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

Method refToId

ark/schema/units.ts:679–688  ·  view source on GitHub ↗
(id: NodeId, opts?: ReferenceOptions)

Source from the content-addressed store, hash-verified

677
678 // a node can be named without being invoked, e.g. an Allows passed
679 override refToId(id: NodeId, opts?: ReferenceOptions): string {
680 const reference = this.link.byId[id]
681 if (reference && this.link.unreached.delete(reference))
682 this.link.reached.push(reference)
683 if (reference && this.link.reused.has(reference)) {
684 const kind = opts?.kind ?? this.trav
685 this.link.dependencies[`${this.nameOf(id)}${kind}`] = [reference, kind]
686 }
687 return super.refToId(id, opts)
688 }
689
690 override nameOf(id: NodeId): string {
691 return this.link.nameOf?.(id) ?? super.nameOf(id)

Callers

nothing calls this directly

Calls 5

nameOfMethod · 0.95
refToIdMethod · 0.65
deleteMethod · 0.45
pushMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected