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 {