fix(shouldIgnore): filename normalization should be platform sensitive (#4631)
* fix(shouldIgnore): filename normalization should be platform sensitive shouldIgnore normalizes the path of the filename prior to running any "only" regexes or functions. The normalization uses "slash", which has some undesirable special cases for non-ASCII characters and longer paths. Changing the normalization behavior to always replace path separators. There is no real need to add additional tests, because the tests are not run in an environment where path.sep !== '/'. * Minor style fix to use double quotes. * Remove conditional for regex replace to keep consistent behavior. * whitespace [skip ci]
This commit is contained in:
parent
27ee74ea14
commit
c2387f0444
@ -116,7 +116,7 @@ export function shouldIgnore(
|
||||
ignore: Array<RegExp | Function> = [],
|
||||
only?: Array<RegExp | Function>,
|
||||
): boolean {
|
||||
filename = slash(filename);
|
||||
filename = filename.replace(/\\/g, "/");
|
||||
|
||||
if (only) {
|
||||
for (let pattern of only) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user