fix isDirectory() to return false instead of failing
This commit is contained in:
parent
51f9d76a64
commit
bd50c122eb
9
dist/smartfile.fs.js
vendored
9
dist/smartfile.fs.js
vendored
File diff suppressed because one or more lines are too long
@ -43,7 +43,11 @@ export let fileExists = function (filePath) {
|
||||
* Checks if given path points to an existing directory
|
||||
*/
|
||||
export let isDirectory = function (pathArg): boolean {
|
||||
return plugins.fsExtra.statSync(pathArg).isDirectory()
|
||||
try {
|
||||
return plugins.fsExtra.statSync(pathArg).isDirectory()
|
||||
} catch (err) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user