| 64523 | // - SKIP: always skip |
| 64524 | // - TEST: always test |
| 64525 | // - TESTIF: only test if checkUnignored |
| 64526 | // - X: that never happen |
| 64527 | // @param {boolean} whether should check if the path is unignored, |
| 64528 | // setting `checkUnignored` to `false` could reduce additional |
| 64529 | // path matching. |
| 64530 | // @returns {TestResult} true if a file is ignored |
| 64531 | _testOne(path5, checkUnignored) { |
| 64532 | let ignored = false; |
| 64533 | let unignored = false; |
| 64534 | this._rules.forEach((rule) => { |
| 64535 | const { negative } = rule; |
| 64536 | if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { |
| 64537 | return; |
| 64538 | } |
| 64539 | const matched = rule.regex.test(path5); |
| 64540 | if (matched) { |
| 64541 | ignored = !negative; |
| 64542 | unignored = negative; |
| 64543 | } |
| 64544 | }); |
| 64545 | return { |
| 64546 | ignored, |