@jsenv/util
Advanced tools
Comparing version 4.0.6 to 4.1.0
@@ -27,2 +27,3 @@ // we won't internalize @jsenv/url-meta | ||
export { memoize } from "./src/memoize.js" | ||
export { moveDirectoryContent } from "./src/moveDirectoryContent.js" | ||
export { moveFileSystemNode } from "./src/moveFileSystemNode.js" | ||
@@ -29,0 +30,0 @@ export { readDirectory } from "./src/readDirectory.js" |
{ | ||
"name": "@jsenv/util", | ||
"version": "4.0.6", | ||
"version": "4.1.0", | ||
"description": "Set of functions often needed when using Node.js.", | ||
@@ -14,4 +14,3 @@ "license": "MIT", | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org" | ||
"access": "public" | ||
}, | ||
@@ -18,0 +17,0 @@ "type": "module", |
@@ -13,5 +13,10 @@ export const comparePathnames = (leftPathame, rightPathname) => { | ||
const rightPartExists = i in rightPartArray | ||
// longer comes first | ||
if (!leftPartExists) return +1 | ||
if (!rightPartExists) return -1 | ||
if (!leftPartExists) { | ||
return +1 | ||
} | ||
if (!rightPartExists) { | ||
return -1 | ||
} | ||
@@ -21,4 +26,8 @@ const leftPartIsLast = i === leftPartArray.length - 1 | ||
// folder comes first | ||
if (leftPartIsLast && !rightPartIsLast) return +1 | ||
if (!leftPartIsLast && rightPartIsLast) return -1 | ||
if (leftPartIsLast && !rightPartIsLast) { | ||
return +1 | ||
} | ||
if (!leftPartIsLast && rightPartIsLast) { | ||
return -1 | ||
} | ||
@@ -30,8 +39,14 @@ const leftPart = leftPartArray[i] | ||
const comparison = leftPart.localeCompare(rightPart) | ||
if (comparison !== 0) return comparison | ||
if (comparison !== 0) { | ||
return comparison | ||
} | ||
} | ||
if (leftLength < rightLength) return +1 | ||
if (leftLength > rightLength) return -1 | ||
if (leftLength < rightLength) { | ||
return +1 | ||
} | ||
if (leftLength > rightLength) { | ||
return -1 | ||
} | ||
return 0 | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
343535
64
4345