From ddd233adcb8ad7e180dc2584197ab8b9ef521481 Mon Sep 17 00:00:00 2001 From: Treecat Date: Wed, 11 Jan 2023 17:13:25 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-14076=20fix:=E8=A7=A3=E5=86=B3=E6=AD=BB?= =?UTF-8?q?=E5=BE=AA=E7=8E=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es6.xtype.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/es6.xtype.js b/es6.xtype.js index 70b4d3db7..854728add 100644 --- a/es6.xtype.js +++ b/es6.xtype.js @@ -60,12 +60,15 @@ function search(src, clzName) { srcPath.shift(); srcPath.pop(); + + const findDstIndexPath = (dstArr, startIndex) => { let i = startIndex; - while (!isExist(path.resolve("src", dstArr.slice(0, i + 1).join("/"), "index.js"))) { + while (!isExist(path.resolve("src", dstArr.slice(0, i + 1).join("/"), "index.js")) && i < dstArr.length) { i++; } + if (i < dstArr.length) { return dstArr.slice(startIndex, i + 1).join("/"); } else {