From b84c504f11b136ce6495084f389e04b4bc24bf72 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Wed, 23 Aug 2023 10:58:38 +0200 Subject: [PATCH] fix(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/smartfile.fs.ts | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) 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) {