diff --git a/CHANGELOG.md b/CHANGELOG.md index cdb8818f..f3a5e7a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.39.1 (21 Nov 2023) + +* fix: lazyImport + ## v1.39.0 (21 Nov 2023) * feat: add isStrBlank diff --git a/package.json b/package.json index a12d9b19..fd43c086 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "licia", - "version": "1.39.0", + "version": "1.39.1", "description": "Useful utility collection with zero dependencies", "bin": { "licia": "./bin/licia.js" diff --git a/src/lazyImport.js b/src/lazyImport.js index acd63a7e..43d8a5ac 100644 --- a/src/lazyImport.js +++ b/src/lazyImport.js @@ -45,10 +45,10 @@ exports = function(importFn, dirname) { const { cache } = importFn; if (cache) { if (cache[moduleId]) { - return cache[moduleId]; + return importFn(moduleId); } if (!endWith(moduleId, '.js') && cache[`${moduleId}.js`]) { - return cache[`${moduleId}.js`]; + return importFn(`${moduleId}.js`); } }