1"use strict"; 2var __importDefault = (this && this.__importDefault) || function (mod) { 3 return (mod && mod.__esModule) ? mod : { "default": mod }; 4}; 5Object.defineProperty(exports, "__esModule", { value: true }); 6exports.isIgnoredPath = void 0; 7const minimatch_1 = __importDefault(require("minimatch")); 8/** 9 * Indicate the given `filePath` should be excluded by `ignorePaths` 10 */ 11function isIgnoredPath(filePath, ignorePaths, minimatchOptions = { dot: true }) { 12 const minimatchObjs = ignorePaths.map((ignorePath) => new minimatch_1.default.Minimatch(ignorePath, minimatchOptions)); 13 let result = false; 14 for (const minimatchObj of minimatchObjs) { 15 const currMatch = minimatchObj.match(filePath); 16 if (minimatchObj.negate && result && !currMatch) { 17 // Special handler for negate (!pattern). 18 // As long as previous match result is true and not matched from the current negate pattern, we should early return. 19 return false; 20 } 21 result ||= currMatch; 22 } 23 return result; 24} 25exports.isIgnoredPath = isIgnoredPath; 26//# sourceMappingURL=Path.js.map