Skip to content

Commit

Permalink
Use path.sep instead of slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
josephfrazier committed Apr 24, 2017
1 parent 20646f5 commit c2df043
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/util/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ export function matchesFilter(filter: IgnoreFilter, basename: string, loc: strin
loc = path.relative(filter.base, loc);
}
return filter.regex.test(loc) ||
filter.regex.test(`/${loc}`) ||
filter.regex.test(`\\${loc}`) ||
filter.regex.test(`${path.sep}${loc}`) ||
filter.regex.test(basename);
}

Expand All @@ -123,8 +122,7 @@ export function ignoreLinesToRegex(lines: Array<string>, base: string = '.'): Ar
}

// remove trailing slash
pattern = removeSuffix(pattern, '/');
pattern = removeSuffix(pattern, '\\');
pattern = removeSuffix(pattern, path.sep);

const regex: ?RegExp = minimatch.makeRe(pattern, {nocase: true});

Expand Down

0 comments on commit c2df043

Please sign in to comment.