(r: StructureNode)
| 544 | |
| 545 | // as a spread would, keys keep this structure's order and r's new keys follow |
| 546 | merge(r: StructureNode): StructureNode { |
| 547 | const inner = |
| 548 | this.index || r.index || r.sequence ? |
| 549 | this.filterKeys("omit", [r.keyof()]) |
| 550 | // a named key is omitted exactly if r names it |
| 551 | : this.withoutKeysOf(r) |
| 552 | |
| 553 | if (r.required) inner.required = append(inner.required, r.required) |
| 554 | if (r.optional) inner.optional = append(inner.optional, r.optional) |
| 555 | if (r.index) inner.index = append(inner.index, r.index) |
| 556 | if (r.sequence) inner.sequence = r.sequence |
| 557 | if (r.undeclared) inner.undeclared = r.undeclared |
| 558 | else delete inner.undeclared |
| 559 | inner.order = [...this.keyOrder, ...r.keyOrder] |
| 560 | return this.$.node("structure", inner) |
| 561 | } |
| 562 | |
| 563 | private withoutKeysOf(r: StructureNode): Structure.Inner.mutable { |
| 564 | const result = makeRootAndArrayPropertiesMutable(this.inner) |
nothing calls this directly
no test coverage detected