@file-services/overlay
Advanced tools
Comparing version 7.0.1 to 7.2.0
@@ -22,2 +22,36 @@ "use strict"; | ||
} | ||
function realpathSync(path) { | ||
const { resolvedLowerPath, resolvedUpperPath } = resolvePaths(path); | ||
if (resolvedUpperPath !== undefined && upperFs.existsSync(resolvedUpperPath)) { | ||
const { stackTraceLimit } = Error; | ||
try { | ||
Error.stackTraceLimit = 0; | ||
return lowerFs.join(baseDirectoryPath, upperFs.realpathSync(resolvedUpperPath)); | ||
} | ||
catch { | ||
/**/ | ||
} | ||
finally { | ||
Error.stackTraceLimit = stackTraceLimit; | ||
} | ||
} | ||
return lowerFs.realpathSync(resolvedLowerPath); | ||
} | ||
realpathSync.native = function realpathSyncNative(path) { | ||
const { resolvedLowerPath, resolvedUpperPath } = resolvePaths(path); | ||
if (resolvedUpperPath !== undefined && upperFs.existsSync(resolvedUpperPath)) { | ||
const { stackTraceLimit } = Error; | ||
try { | ||
Error.stackTraceLimit = 0; | ||
return lowerFs.join(baseDirectoryPath, upperFs.realpathSync.native(resolvedUpperPath)); | ||
} | ||
catch { | ||
/**/ | ||
} | ||
finally { | ||
Error.stackTraceLimit = stackTraceLimit; | ||
} | ||
} | ||
return lowerFs.realpathSync.native(resolvedLowerPath); | ||
}; | ||
const baseSyncActions = { | ||
@@ -80,19 +114,3 @@ existsSync(path) { | ||
}, | ||
realpathSync(path) { | ||
const { resolvedLowerPath, resolvedUpperPath } = resolvePaths(path); | ||
if (resolvedUpperPath !== undefined && upperFs.existsSync(resolvedUpperPath)) { | ||
const { stackTraceLimit } = Error; | ||
try { | ||
Error.stackTraceLimit = 0; | ||
return lowerFs.join(baseDirectoryPath, upperFs.realpathSync(resolvedUpperPath)); | ||
} | ||
catch { | ||
/**/ | ||
} | ||
finally { | ||
Error.stackTraceLimit = stackTraceLimit; | ||
} | ||
} | ||
return lowerFs.realpathSync(resolvedLowerPath); | ||
}, | ||
realpathSync, | ||
readlinkSync(path) { | ||
@@ -99,0 +117,0 @@ const { resolvedLowerPath, resolvedUpperPath } = resolvePaths(path); |
{ | ||
"name": "@file-services/overlay", | ||
"description": "Overlay files and directories from one file system on top of another.", | ||
"version": "7.0.1", | ||
"version": "7.2.0", | ||
"main": "dist/index.js", | ||
@@ -12,4 +12,4 @@ "scripts": { | ||
"dependencies": { | ||
"@file-services/types": "^7.0.1", | ||
"@file-services/utils": "^7.0.1" | ||
"@file-services/types": "^7.2.0", | ||
"@file-services/utils": "^7.2.0" | ||
}, | ||
@@ -16,0 +16,0 @@ "files": [ |
@@ -38,2 +38,34 @@ import type { | ||
function realpathSync(path: string) { | ||
const { resolvedLowerPath, resolvedUpperPath } = resolvePaths(path); | ||
if (resolvedUpperPath !== undefined && upperFs.existsSync(resolvedUpperPath)) { | ||
const { stackTraceLimit } = Error; | ||
try { | ||
Error.stackTraceLimit = 0; | ||
return lowerFs.join(baseDirectoryPath, upperFs.realpathSync(resolvedUpperPath)); | ||
} catch { | ||
/**/ | ||
} finally { | ||
Error.stackTraceLimit = stackTraceLimit; | ||
} | ||
} | ||
return lowerFs.realpathSync(resolvedLowerPath); | ||
} | ||
realpathSync.native = function realpathSyncNative(path: string) { | ||
const { resolvedLowerPath, resolvedUpperPath } = resolvePaths(path); | ||
if (resolvedUpperPath !== undefined && upperFs.existsSync(resolvedUpperPath)) { | ||
const { stackTraceLimit } = Error; | ||
try { | ||
Error.stackTraceLimit = 0; | ||
return lowerFs.join(baseDirectoryPath, upperFs.realpathSync.native(resolvedUpperPath)); | ||
} catch { | ||
/**/ | ||
} finally { | ||
Error.stackTraceLimit = stackTraceLimit; | ||
} | ||
} | ||
return lowerFs.realpathSync.native(resolvedLowerPath); | ||
}; | ||
const baseSyncActions: Partial<IBaseFileSystemSyncActions> = { | ||
@@ -91,17 +123,3 @@ existsSync(path) { | ||
} as IBaseFileSystemSyncActions['lstatSync'], | ||
realpathSync(path) { | ||
const { resolvedLowerPath, resolvedUpperPath } = resolvePaths(path); | ||
if (resolvedUpperPath !== undefined && upperFs.existsSync(resolvedUpperPath)) { | ||
const { stackTraceLimit } = Error; | ||
try { | ||
Error.stackTraceLimit = 0; | ||
return lowerFs.join(baseDirectoryPath, upperFs.realpathSync(resolvedUpperPath)); | ||
} catch { | ||
/**/ | ||
} finally { | ||
Error.stackTraceLimit = stackTraceLimit; | ||
} | ||
} | ||
return lowerFs.realpathSync(resolvedLowerPath); | ||
}, | ||
realpathSync, | ||
readlinkSync(path) { | ||
@@ -108,0 +126,0 @@ const { resolvedLowerPath, resolvedUpperPath } = resolvePaths(path); |
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
49700
821
Updated@file-services/types@^7.2.0
Updated@file-services/utils@^7.2.0