| 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) |