| 686 | |
| 687 | |
| 688 | async* glob() { |
| 689 | ArrayPrototypePush(this.#queue, { __proto__: null, path: '.', patterns: this.#patterns }); |
| 690 | while (this.#queue.length > 0) { |
| 691 | const item = ArrayPrototypePop(this.#queue); |
| 692 | for (let i = 0; i < item.patterns.length; i++) { |
| 693 | yield* this.#iterateSubpatterns(item.path, item.patterns[i]); |
| 694 | } |
| 695 | this.#subpatterns |
| 696 | .forEach((patterns, path) => ArrayPrototypePush(this.#queue, { __proto__: null, path, patterns })); |
| 697 | this.#subpatterns.clear(); |
| 698 | } |
| 699 | } |
| 700 | async* #iterateSubpatterns(path, pattern) { |
| 701 | const seen = this.#cache.add(path, pattern); |
| 702 | if (seen) { |