Skip to content

Commit 8193251

Browse files
committed
fix: treeSub() return null with options defined
1 parent 29b44a6 commit 8193251

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@axolo/tree-array",
3-
"version": "0.5.1",
3+
"version": "0.5.2",
44
"description": "An array have children key and parentId key like tree.",
55
"author": "Yueming Fang",
66
"license": "MIT",

src/lib/tree-sub.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const treeSub = (tree, id, options) => {
66
if (tree[i][idKey] === id) {
77
return tree[i]
88
} else if (tree[i][childrenKey] && tree[i][childrenKey].length > 0) {
9-
const result = treeSub(tree[i][childrenKey], id)
9+
const result = treeSub(tree[i][childrenKey], id, options)
1010
if (result) {
1111
return result
1212
}

0 commit comments

Comments
 (0)