Skip to content

Commit 4f1b721

Browse files
authored
Merge pull request #940 from XhmikosR/startsWith
Use `string.startsWith()` when possible.
2 parents a4aa5d3 + 52ebf2e commit 4f1b721

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const getAbsolutePath = (path, cwd) => {
117117
if (sysPath.isAbsolute(path)) {
118118
return path;
119119
}
120-
if (path[0] === BANG) {
120+
if (path.startsWith(BANG)) {
121121
return BANG + sysPath.join(cwd, path.substring(1));
122122
}
123123
return sysPath.join(cwd, path);
@@ -406,7 +406,7 @@ add(paths_, _origAdd, _internal) {
406406

407407
// set aside negated glob strings
408408
paths = paths.filter((path) => {
409-
if (path[0] === BANG) {
409+
if (path.startsWith(BANG)) {
410410
this._ignoredPaths.add(path.substring(1));
411411
return false;
412412
}

0 commit comments

Comments
 (0)