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 3.7.2 to 3.7.3

2

package.json
{
"name": "@jsenv/util",
"version": "3.7.2",
"version": "3.7.3",
"description": "Set of functions often needed when using Node.js.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -1,2 +0,2 @@

import { lstat, stat, existsSync } from "fs"
import { lstat, stat } from "fs"
import { assertAndNormalizeFileUrl } from "./assertAndNormalizeFileUrl.js"

@@ -30,6 +30,8 @@ import { urlToFileSystemPath } from "./urlToFileSystemPath.js"

handlePermissionDeniedError: async (error) => {
// unfortunately it means we mutate the permissions
// without being able to restore them to the previous value
// (because reading current permission would also throw)
console.error(`trying to fix windows EPERM after stats on ${sourcePath}`)
try {
// unfortunately it means we mutate the permissions
// without being able to restore them to the previous value
// (because reading current permission would also throw)
await writeFileSystemNodePermissions(sourceUrl, 0o666)

@@ -41,2 +43,3 @@ const stats = await readStat(sourcePath, {

handlePermissionDeniedError: () => {
console.error(`still got EPERM after stats on ${sourcePath}`)
throw error

@@ -47,3 +50,5 @@ },

} catch (e) {
// failed to write permission or readState, throw original error as well
console.error(
`error while trying to fix windows EPERM after stats on ${sourcePath}: ${e.stack}`,
)
throw error

@@ -66,6 +71,3 @@ }

if (error) {
if (
handleNotFoundError &&
(error.code === "ENOENT" || (error.code === "EPERM" && !existsSync(sourcePath)))
) {
if (handleNotFoundError && error.code === "ENOENT") {
resolve(handleNotFoundError(error))

@@ -72,0 +74,0 @@ } else if (

@@ -142,2 +142,4 @@ import { unlink, rmdir, openSync, closeSync } from "fs"

handlePermissionError: async (error) => {
console.error(`trying to fix windows EPERM after readir on ${directoryPath}`)
let openOrCloseError

@@ -155,3 +157,5 @@ try {

}
console.error(`error while trying to fix windows EPERM: ${openOrCloseError.stack}`)
console.error(
`error while trying to fix windows EPERM after readir on ${directoryPath}: ${openOrCloseError.stack}`,
)
throw error

@@ -158,0 +162,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