+1
-1
@@ -6,3 +6,3 @@ { | ||
| "private": false, | ||
| "version": "0.1.25", | ||
| "version": "0.1.26", | ||
| "description": "domain-language for js", | ||
@@ -9,0 +9,0 @@ "main": "dist/dlsjs.esm.js", |
@@ -26,3 +26,3 @@ /** | ||
| // 校验数据结构 | ||
| if(list[0] && !list[0].hasOwnProperty('id')) { | ||
| if(list[0] && !list[0].hasOwnProperty(props.id)) { | ||
| console.warn('数据非标准,未找到唯一标识字段,直接返回') | ||
@@ -34,2 +34,9 @@ return list | ||
| // -1.先清空children。防止重复叠加调用。 | ||
| if(useConcat === false) { | ||
| for (const node of list) { | ||
| delete node[childrenKey]; | ||
| } | ||
| } | ||
| // 2. 构建ID到节点的哈希映射(O(n)),同时初始化children数组 | ||
@@ -36,0 +43,0 @@ const nodeMap = new Map(); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2805810
0.04%8155
0.11%