()
| 514 | return this.#toString !== void 0 ? this.#toString : !this.type ? this.#toString = this.#parts.map((p) => String(p)).join("") : this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")"; |
| 515 | } |
| 516 | #fillNegs() { |
| 517 | if (this !== this.#root) |
| 518 | throw new Error("should only call on root"); |
| 519 | if (this.#filledNegs) |
| 520 | return this; |
| 521 | this.toString(); |
| 522 | this.#filledNegs = true; |
| 523 | let n; |
| 524 | while (n = this.#negs.pop()) { |
| 525 | if (n.type !== "!") |
| 526 | continue; |
| 527 | let p = n; |
| 528 | let pp = p.#parent; |
| 529 | while (pp) { |
| 530 | for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { |
| 531 | for (const part of n.#parts) { |
| 532 | if (typeof part === "string") { |
| 533 | throw new Error("string part in extglob AST??"); |
| 534 | } |
| 535 | part.copyIn(pp.#parts[i]); |
| 536 | } |
| 537 | } |
| 538 | p = pp; |
| 539 | pp = p.#parent; |
| 540 | } |
| 541 | } |
| 542 | return this; |
| 543 | } |
| 544 | push(...parts) { |
| 545 | for (const p of parts) { |
| 546 | if (p === "") |
no test coverage detected