@file-services/utils
Advanced tools
Comparing version 5.7.0 to 5.7.1
@@ -28,3 +28,8 @@ "use strict"; | ||
var _a; | ||
return !!((_a = statFn(filePath, statsNoThrowOptions)) === null || _a === void 0 ? void 0 : _a.isFile()); | ||
try { | ||
return !!((_a = statFn(filePath, statsNoThrowOptions)) === null || _a === void 0 ? void 0 : _a.isFile()); | ||
} | ||
catch { | ||
return false; | ||
} | ||
} | ||
@@ -36,3 +41,8 @@ function readJsonFileSync(filePath, options) { | ||
var _a; | ||
return !!((_a = statFn(directoryPath, statsNoThrowOptions)) === null || _a === void 0 ? void 0 : _a.isDirectory()); | ||
try { | ||
return !!((_a = statFn(directoryPath, statsNoThrowOptions)) === null || _a === void 0 ? void 0 : _a.isDirectory()); | ||
} | ||
catch { | ||
return false; | ||
} | ||
} | ||
@@ -39,0 +49,0 @@ function ensureDirectorySync(directoryPath) { |
{ | ||
"name": "@file-services/utils", | ||
"description": "Common file system utility functions.", | ||
"version": "5.7.0", | ||
"version": "5.7.1", | ||
"main": "dist/index.js", | ||
"dependencies": { | ||
"@file-services/types": "^5.7.0" | ||
"@file-services/types": "^5.7.1" | ||
}, | ||
@@ -9,0 +9,0 @@ "files": [ |
@@ -54,3 +54,7 @@ import type { | ||
function fileExistsSync(filePath: string, statFn = statSync): boolean { | ||
return !!statFn(filePath, statsNoThrowOptions)?.isFile(); | ||
try { | ||
return !!statFn(filePath, statsNoThrowOptions)?.isFile(); | ||
} catch { | ||
return false; | ||
} | ||
} | ||
@@ -63,3 +67,7 @@ | ||
function directoryExistsSync(directoryPath: string, statFn = statSync): boolean { | ||
return !!statFn(directoryPath, statsNoThrowOptions)?.isDirectory(); | ||
try { | ||
return !!statFn(directoryPath, statsNoThrowOptions)?.isDirectory(); | ||
} catch { | ||
return false; | ||
} | ||
} | ||
@@ -66,0 +74,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
59414
1095
Updated@file-services/types@^5.7.1