()
| 381 | } |
| 382 | |
| 383 | globSync() { |
| 384 | ArrayPrototypePush(this.#queue, { __proto__: null, path: '.', patterns: this.#patterns }); |
| 385 | while (this.#queue.length > 0) { |
| 386 | const item = ArrayPrototypePop(this.#queue); |
| 387 | for (let i = 0; i < item.patterns.length; i++) { |
| 388 | this.#addSubpatterns(item.path, item.patterns[i]); |
| 389 | } |
| 390 | this.#subpatterns |
| 391 | .forEach((patterns, path) => ArrayPrototypePush(this.#queue, { __proto__: null, path, patterns })); |
| 392 | this.#subpatterns.clear(); |
| 393 | } |
| 394 | return ArrayFrom( |
| 395 | this.#results, |
| 396 | this.#withFileTypes ? (path) => this.#cache.statSync( |
| 397 | isAbsolute(path) ? |
| 398 | path : |
| 399 | join(this.#root, path), |
| 400 | ) : undefined, |
| 401 | ); |
| 402 | } |
| 403 | #isDirectorySync(path, stat, pattern) { |
| 404 | if (stat?.isDirectory()) { |
| 405 | return true; |
no test coverage detected