From fc11e95124a62c010abf7bcdb5dad7d698efea22 Mon Sep 17 00:00:00 2001 From: Jean-Maxime Couillard Date: Mon, 1 Apr 2019 17:50:25 -0400 Subject: [PATCH] Use Array.isArray() instead of instanceof Array to handle arrays. --- src/command.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command.js b/src/command.js index b0d3107..8dc62e1 100644 --- a/src/command.js +++ b/src/command.js @@ -15,7 +15,7 @@ function toWindowsPath(path) { if (p.substr(-1) === '\\') p = p.substr(0, p.length - 1); return p; }; - if (path instanceof Array) return path.map(clean); + if (Array.isArray(path)) return path.map(clean); else return clean(path); } @@ -24,7 +24,7 @@ function toAbsolutePath(relativePath, base) { return _.startsWith(p, '\\\\') || _.include(p, ':') ? p : (base ? path.join(base, p) : path.resolve(p)); }; - if (relativePath instanceof Array) return relativePath.map(toAbsolute); + if (Array.isArray(relativePath)) return relativePath.map(toAbsolute); else return toAbsolute(relativePath); }