@stryker-mutator/core
Version:
The extendable JavaScript mutation testing framework
25 lines • 725 B
JavaScript
import path from 'path';
import { minimatch } from 'minimatch';
import { normalizeFileName } from '@stryker-mutator/util';
/**
* A helper class for matching files using the `disableTypeChecks` setting.
*/
export class FileMatcher {
constructor(pattern) {
if (typeof pattern === 'string') {
this.pattern = normalizeFileName(path.resolve(pattern));
}
else {
this.pattern = pattern;
}
}
matches(fileName) {
if (typeof this.pattern === 'string') {
return minimatch(normalizeFileName(path.resolve(fileName)), this.pattern);
}
else {
return this.pattern;
}
}
}
//# sourceMappingURL=file-matcher.js.map