Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jsenv/util

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsenv/util - npm Package Compare versions

Comparing version 4.0.6 to 4.1.0

src/moveDirectoryContent.js

1

index.js

@@ -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"

5

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc