MCPcopy Index your code
hub / github.com/nodejs/node / test

Method test

lib/internal/fs/glob.js:282–297  ·  view source on GitHub ↗
(index, path)

Source from the content-addressed store, hash-verified

280 return new Pattern(this.#pattern, this.#globStrings, indexes, symlinks, realpaths);
281 }
282 test(index, path) {
283 if (index > this.#pattern.length) {
284 return false;
285 }
286 const pattern = this.#pattern[index];
287 if (pattern === lazyMinimatch().GLOBSTAR) {
288 return true;
289 }
290 if (typeof pattern === 'string') {
291 return pattern === path;
292 }
293 if (typeof pattern?.test === 'function') {
294 return pattern.test(path);
295 }
296 return false;
297 }
298
299 cacheKey(index) {
300 let key = '';

Callers 15

ClientRequestFunction · 0.45
setFunction · 0.45
matchHeaderFunction · 0.45
toUnicodeFunction · 0.45
toASCIIFunction · 0.45
url.jsFile · 0.45
isBadFunction · 0.45
checkIsHttpTokenFunction · 0.45
checkInvalidHeaderCharFunction · 0.45
ServerResponseFunction · 0.45
parserOnIncomingFunction · 0.45

Calls 1

lazyMinimatchFunction · 0.85

Tested by

no test coverage detected