(child, map = adoptionMap)
| 714 | return this.#canAdopt(child, adoptionWithSpaceMap); |
| 715 | } |
| 716 | #canAdopt(child, map = adoptionMap) { |
| 717 | if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) { |
| 718 | return false; |
| 719 | } |
| 720 | const gc = child.#parts[0]; |
| 721 | if (!gc || typeof gc !== "object" || gc.type === null) { |
| 722 | return false; |
| 723 | } |
| 724 | return this.#canAdoptType(gc.type, map); |
| 725 | } |
| 726 | #canAdoptType(c, map = adoptionAnyMap) { |
| 727 | return !!map.get(this.type)?.includes(c); |
| 728 | } |
no test coverage detected