MCPcopy Create free account
hub / github.com/nodejs/node / glob

Method glob

lib/internal/fs/glob.js:688–699  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers 15

SearchFilesFunction · 0.80
wanted_zoslib_headersFunction · 0.80
mainFunction · 0.80
ParseArgumentsFunction · 0.80
FindFilesToSyncInFunction · 0.80
globFunction · 0.80
globFunction · 0.80
pytest_generate_testsFunction · 0.80
collect_bucketsFunction · 0.80

Calls 3

#iterateSubpatternsMethod · 0.95
forEachMethod · 0.65
clearMethod · 0.65

Tested by 3

pytest_generate_testsFunction · 0.64
get_android_resourcesMethod · 0.64