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

Method preprocess

deps/minimatch/index.js:1317–1337  ·  view source on GitHub ↗
(globParts)

Source from the content-addressed store, hash-verified

1315 // to the right as possible, even if it increases the number
1316 // of patterns that we have to process.
1317 preprocess(globParts) {
1318 if (this.options.noglobstar) {
1319 for (const partset of globParts) {
1320 for (let j = 0; j < partset.length; j++) {
1321 if (partset[j] === "**") {
1322 partset[j] = "*";
1323 }
1324 }
1325 }
1326 }
1327 const { optimizationLevel = 1 } = this.options;
1328 if (optimizationLevel >= 2) {
1329 globParts = this.firstPhasePreProcess(globParts);
1330 globParts = this.secondPhasePreProcess(globParts);
1331 } else if (optimizationLevel >= 1) {
1332 globParts = this.levelOneOptimize(globParts);
1333 } else {
1334 globParts = this.adjascentGlobstarOptimize(globParts);
1335 }
1336 return globParts;
1337 }
1338 // just get rid of adjascent ** portions
1339 adjascentGlobstarOptimize(globParts) {
1340 return globParts.map((parts) => {

Callers 1

makeMethod · 0.45

Calls 4

firstPhasePreProcessMethod · 0.80
secondPhasePreProcessMethod · 0.80
levelOneOptimizeMethod · 0.80

Tested by

no test coverage detected