(globParts)
| 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) => { |
no test coverage detected