@jsenv/filesystem
Advanced tools
Comparing version 2.6.1 to 2.7.0
@@ -27,2 +27,3 @@ /* eslint-disable import/max-dependencies */ | ||
export { fileSystemPathToUrl } from "./src/fileSystemPathToUrl.js" | ||
export { getRealFileSystemUrlSync } from "./src/getRealFileSystemUrlSync.js" | ||
export { grantPermissionsOnFileSystemNode } from "./src/grantPermissionsOnFileSystemNode.js" | ||
@@ -29,0 +30,0 @@ export { isFileSystemPath } from "./src/isFileSystemPath.js" |
{ | ||
"name": "@jsenv/filesystem", | ||
"version": "2.6.1", | ||
"version": "2.7.0", | ||
"description": "Collection of functions to interact with filesystem in Node.js", | ||
@@ -47,3 +47,3 @@ "license": "MIT", | ||
"@jsenv/assert": "2.4.1", | ||
"@jsenv/core": "25.1.0", | ||
"@jsenv/core": "25.2.1", | ||
"@jsenv/eslint-config": "16.0.9", | ||
@@ -55,3 +55,3 @@ "@jsenv/github-release-package": "1.2.3", | ||
"@jsenv/performance-impact": "2.2.1", | ||
"eslint": "8.6.0", | ||
"eslint": "8.7.0", | ||
"eslint-plugin-import": "2.25.4", | ||
@@ -58,0 +58,0 @@ "prettier": "2.5.1" |
@@ -1,3 +0,5 @@ | ||
import { statSync } from "fs" | ||
import { statSync } from "node:fs" | ||
import { urlToFileSystemPath } from "../urlToFileSystemPath.js" | ||
import { statsToType } from "./statsToType.js" | ||
@@ -4,0 +6,0 @@ |
@@ -34,6 +34,9 @@ import { promises } from "node:fs" | ||
const toInfo = getToInfo(to, fromUrl) | ||
// Node.js doc at https://nodejs.org/api/fs.html#fssymlinktarget-path-type-callback | ||
// states the following: | ||
// "If the type argument is not set, Node.js will autodetect | ||
// target type and use 'file' or 'dir'" | ||
// In practice, if code don't specify "type" on windows, you later get EPERM errors | ||
// when doing operation on the symlink such as "fs.stat" | ||
if (isWindows && typeof type === "undefined") { | ||
// without this if you write a symbolic link without specifying the type on windows | ||
// you later get EPERM when doing stat on the symlink | ||
const toStats = await readFileSystemNodeStat(toInfo.url, { | ||
@@ -44,3 +47,2 @@ nullIfNotFound: true, | ||
} | ||
const symbolicLinkPath = urlToFileSystemPath(fromUrl) | ||
@@ -47,0 +49,0 @@ try { |
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
99376
65
2744
9