Skip to content

Commit

Permalink
Use string.startsWith() when possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Oct 28, 2019
1 parent a4aa5d3 commit 52ebf2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const getAbsolutePath = (path, cwd) => {
if (sysPath.isAbsolute(path)) {
return path;
}
if (path[0] === BANG) {
if (path.startsWith(BANG)) {
return BANG + sysPath.join(cwd, path.substring(1));
}
return sysPath.join(cwd, path);
Expand Down Expand Up @@ -406,7 +406,7 @@ add(paths_, _origAdd, _internal) {

// set aside negated glob strings
paths = paths.filter((path) => {
if (path[0] === BANG) {
if (path.startsWith(BANG)) {
this._ignoredPaths.add(path.substring(1));
return false;
}
Expand Down

0 comments on commit 52ebf2e

Please sign in to comment.