Skip to content

Commit

Permalink
releases 3.5.30
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Aug 8, 2024
1 parent f3548e4 commit 6b331e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions func/toArrayTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,16 @@ function toArrayTree (array, options) {

parentId = item[optParentKey]
treeMap[id] = treeMap[id] || []
treeMap[parentId] = treeMap[parentId] || []
treeMap[parentId].push(treeData)
treeData[optKey] = id
treeData[optParentKey] = parentId

if (id === parentId) {
parentId = null
console.log('Fix infinite Loop.', item)
}

treeMap[parentId] = treeMap[parentId] || []
treeMap[parentId].push(treeData)
treeData[optChildren] = treeMap[id]
if (optMapChildren) {
treeData[optMapChildren] = treeMap[id]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xe-utils",
"version": "3.5.29",
"version": "3.5.30",
"description": "JavaScript 函数库、工具类",
"main": "index.js",
"unpkg": "dist/xe-utils.umd.min.js",
Expand Down

0 comments on commit 6b331e6

Please sign in to comment.