UNPKG

721 BJavaScriptView Raw
1import path from 'path';
2import minimatch from 'minimatch';
3import { normalizeFileName } from '@stryker-mutator/util';
4/**
5 * A helper class for matching files using the `disableTypeChecks` setting.
6 */
7export class FileMatcher {
8 constructor(pattern) {
9 if (typeof pattern === 'string') {
10 this.pattern = normalizeFileName(path.resolve(pattern));
11 }
12 else {
13 this.pattern = pattern;
14 }
15 }
16 matches(fileName) {
17 if (typeof this.pattern === 'string') {
18 return minimatch(normalizeFileName(path.resolve(fileName)), this.pattern);
19 }
20 else {
21 return this.pattern;
22 }
23 }
24}
25//# sourceMappingURL=file-matcher.js.map
\No newline at end of file