diff --git a/CHANGELOG.md b/CHANGELOG.md index 920275ca..cdb8818f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.39.0 (21 Nov 2023) + +* feat: add isStrBlank + ## v1.38.2 (4 Jul 2023) * fix(remove): loop through undefined values diff --git a/index.json b/index.json index 40746303..e4f44032 100644 --- a/index.json +++ b/index.json @@ -4043,6 +4043,7 @@ "browser", "miniprogram" ], + "since": "1.39.0", "test": [ "node", "browser" @@ -4264,6 +4265,7 @@ "stackTrace", "splitPath", "startWith", + "endWith", "defineProp", "isStr", "has", diff --git a/package.json b/package.json index a9458d84..496ed93c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "licia", - "version": "1.38.2", + "version": "1.39.0", "description": "Useful utility collection with zero dependencies", "bin": { "licia": "./bin/licia.js" diff --git a/src/isStrBlank.js b/src/isStrBlank.js index 77447ebf..d69016e3 100644 --- a/src/isStrBlank.js +++ b/src/isStrBlank.js @@ -15,6 +15,7 @@ /* module * env: all + * since: 1.39.0 */ /* typescript diff --git a/src/lazyImport.js b/src/lazyImport.js index 344200ba..acd63a7e 100644 --- a/src/lazyImport.js +++ b/src/lazyImport.js @@ -28,7 +28,7 @@ */ _( - 'stackTrace splitPath startWith defineProp isStr has objToStr unique concat keys isArr toBool' + 'stackTrace splitPath startWith endWith defineProp isStr has objToStr unique concat keys isArr toBool' ); const path = require('path'); @@ -41,6 +41,17 @@ exports = function(importFn, dirname) { } moduleId = path.join(dirname, moduleId); } + + const { cache } = importFn; + if (cache) { + if (cache[moduleId]) { + return cache[moduleId]; + } + if (!endWith(moduleId, '.js') && cache[`${moduleId}.js`]) { + return cache[`${moduleId}.js`]; + } + } + return proxyExports(importFn, moduleId); }; };