diff --git a/src/lib/decorateObject.ts b/src/lib/decorateObject.ts index 00f019d..546e38b 100644 --- a/src/lib/decorateObject.ts +++ b/src/lib/decorateObject.ts @@ -14,7 +14,9 @@ export const decorateObject = (target: T, implementation: LogF if (config.saveToFile !== null) { const dirPath = path.parse(config.saveToFile).dir; - fs.mkdirSync(dirPath, { recursive: true }); + if (dirPath !== '') { + fs.mkdirSync(dirPath, { recursive: true }); + } } const funcFactory = (type: LogType): LogFunction => (msg: string, ...args: unknown[]) => {