* @param {object} rules
(rules)
| 268 | * @param {object} rules |
| 269 | */ |
| 270 | addRules(rules) { |
| 271 | for (const key of Object.keys(rules)) { |
| 272 | if (key.includes('*')) { |
| 273 | this.patternMatch.push(new StatusRule(key, rules[key], key)); |
| 274 | } else { |
| 275 | const normalizedPath = path.normalize(key); |
| 276 | this.exactMatch[normalizedPath] = new StatusRule(key, rules[key]); |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | match(file) { |
| 282 | const result = []; |