diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 8c22214..8385bc6 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartfile', - version: '10.0.29', + version: '10.0.30', description: 'offers smart ways to work with files in nodejs' } diff --git a/ts/smartfile.fs.ts b/ts/smartfile.fs.ts index 79fb773..38ab6fe 100644 --- a/ts/smartfile.fs.ts +++ b/ts/smartfile.fs.ts @@ -40,7 +40,18 @@ export const fileExists = async (filePath): Promise => { /** * Checks if given path points to an existing directory */ -export const isDirectory = (pathArg): boolean => { +export const isDirectory = (pathArg: string): boolean => { + try { + return plugins.fsExtra.statSync(pathArg).isDirectory(); + } catch (err) { + return false; + } +}; + +/** + * Checks if given path points to an existing directory + */ +export const isDirectorySync = (pathArg: string): boolean => { try { return plugins.fsExtra.statSync(pathArg).isDirectory(); } catch (err) {