(def: unknown, opts: BaseParseOptions = {})
| 690 | this.finalize(this.parseDefinition(def, opts)) |
| 691 | |
| 692 | parseDefinition(def: unknown, opts: BaseParseOptions = {}): BaseRoot { |
| 693 | if (hasArkKind(def, "root")) return this.bindReference(def) |
| 694 | |
| 695 | const ctxInputOrNode = this.preparseOwnDefinitionFormat(def, opts) |
| 696 | if (hasArkKind(ctxInputOrNode, "root")) |
| 697 | return this.bindReference(ctxInputOrNode) |
| 698 | |
| 699 | const ctx = this.createParseContext(ctxInputOrNode) |
| 700 | nodesByRegisteredId[ctx.id] = ctx |
| 701 | let node = this.bindReference(this.parseOwnDefinitionFormat(def, ctx)) |
| 702 | |
| 703 | // if the node is recursive e.g. { box: "this" }, we need to make sure it |
| 704 | // has the original id from context so that its references compile correctly |
| 705 | if (node.isCyclic) node = withId(node, ctx.id) |
| 706 | |
| 707 | nodesByRegisteredId[ctx.id] = node |
| 708 | |
| 709 | return node |
| 710 | } |
| 711 | |
| 712 | finalize<node extends BaseRoot>(node: node): node { |
| 713 | bootstrapAliasReferences(node) |
nothing calls this directly
no test coverage detected
searching dependent graphs…