Skip to content

Commit

Permalink
Simplify reduce for checking match (#1016)
Browse files Browse the repository at this point in the history
  • Loading branch information
Connormiha authored Sep 20, 2023
1 parent cc7b3b2 commit 47bc43d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 47bc43d

Please sign in to comment.