From 52ebf2ebcd096357c6455c01507eecfdb449d1b2 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 28 Oct 2019 16:26:48 +0200 Subject: [PATCH] Use `string.startsWith()` when possible. --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index b1192325..a2a12f61 100644 --- a/index.js +++ b/index.js @@ -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); @@ -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; }