From 4e41be35fec57fc75eb2467ffd3742f731f3ed6f Mon Sep 17 00:00:00 2001 From: Mikhail Bodrov Date: Wed, 20 Sep 2023 18:06:58 +0300 Subject: [PATCH] Simplify reduce for checking match --- lib/util/stat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/stat.js b/lib/util/stat.js index 0ed5aecf..2efd1c33 100644 --- a/lib/util/stat.js +++ b/lib/util/stat.js @@ -137,7 +137,7 @@ function areIdentical (srcStat, destStat) { function isSrcSubdir (src, dest) { const srcArr = path.resolve(src).split(path.sep).filter(i => i) const destArr = path.resolve(dest).split(path.sep).filter(i => i) - return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true) + return srcArr.every((cur, i) => destArr[i] === cur) } function errMsg (src, dest, funcName) {