tree-processor 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  一个轻量级的树结构数据处理工具库,使用 TypeScript 编写,支持 tree-shaking,每个格式打包体积约 **3-4 KB**(ESM: 3.25 KB,CJS: 3.42 KB,UMD: 3.56 KB)。
4
4
 
5
- 目前已支持 mapTree、forEachTree、filterTree、findTree、pushTree、unshiftTree、popTree、shiftTree、someTree、everyTree、includesTree、atTree、indexOfTree、atIndexOfTree、dedupTree、removeTree、getParentTree、getChildrenTree、getSiblingsTree、getNodeDepthMap、getNodeDepth、isEmptyTreeData、isEmptySingleTreeData、isSingleTreeData 和 isTreeData。每个方法的最后一个参数可以自定义 children 和 id 的属性名。
5
+ 目前已支持 mapTree、forEachTree、filterTree、findTree、pushTree、unshiftTree、popTree、shiftTree、someTree、everyTree、includesTree、atTree、indexOfTree、atIndexOfTree、dedupTree、removeTree、getParentTree、getChildrenTree、getSiblingsTree、getNodeDepthMap、getNodeDepth、isLeafNode、isRootNode、isEmptyTreeData、isEmptySingleTreeData、isTreeData、isSingleTreeData、isValidTreeNode、isTreeNodeWithCircularCheck、和isSafeTreeDepth。每个方法的最后一个参数可以自定义 children 和 id 的属性名。
6
6
 
7
7
  ## ✨ 特性
8
8
 
@@ -12,7 +12,7 @@
12
12
  - 🎯 **类似数组 API** - 提供 map、filter、find 等熟悉的数组方法
13
13
  - ⚙️ **自定义字段名** - 支持自定义 children 和 id 字段名
14
14
  - ✅ **零依赖** - 无外部依赖,开箱即用
15
- - 🧪 **完善的测试覆盖** - 包含 200 个测试用例,覆盖基础功能、边界情况、异常处理、复杂场景、npm 包导入等
15
+ - 🧪 **完善的测试覆盖** - 包含 272 个测试用例,覆盖基础功能、边界情况、异常处理、复杂场景、npm 包导入等
16
16
 
17
17
  ## 📦 安装
18
18
 
@@ -490,6 +490,106 @@ console.log(depth) // 2
490
490
  - `getNodeDepthMap` - 批量获取所有节点的深度(一次性计算所有节点)
491
491
  - `getNodeDepth` - 只获取单个节点的深度(只计算目标节点,效率更高)
492
492
 
493
+ ### isLeafNode(检查节点是否是叶子节点)
494
+
495
+ 检查节点是否是叶子节点(没有子节点)。轻量级方法,只检查节点本身,不遍历树。
496
+
497
+ ```javascript
498
+ // 没有 children 字段的节点是叶子节点
499
+ const leafNode1 = { id: 1, name: 'node1' };
500
+ console.log(t.isLeafNode(leafNode1)) // true
501
+
502
+ // children 为空数组的节点是叶子节点
503
+ const leafNode2 = { id: 2, name: 'node2', children: [] };
504
+ console.log(t.isLeafNode(leafNode2)) // true
505
+
506
+ // 有子节点的节点不是叶子节点
507
+ const parentNode = {
508
+ id: 3,
509
+ name: 'node3',
510
+ children: [{ id: 4, name: 'node4' }],
511
+ };
512
+ console.log(t.isLeafNode(parentNode)) // false
513
+
514
+ // 在 filterTree 中使用(过滤出所有叶子节点)
515
+ const leafNodes = t.filterTree(treeData, (node) => t.isLeafNode(node))
516
+ console.log(leafNodes) // 返回所有叶子节点
517
+
518
+ // 在 forEachTree 中使用
519
+ t.forEachTree(treeData, (node) => {
520
+ if (t.isLeafNode(node)) {
521
+ console.log('叶子节点:', node.name)
522
+ }
523
+ })
524
+
525
+ // 支持自定义字段名
526
+ const customNode = {
527
+ nodeId: 1,
528
+ name: 'node1',
529
+ subNodes: [],
530
+ };
531
+ const fieldNames = { children: 'subNodes', id: 'nodeId' };
532
+ console.log(t.isLeafNode(customNode, fieldNames)) // true
533
+ ```
534
+
535
+ **与现有方法的区别:**
536
+ - `isLeafNode` - 只检查单个节点,轻量级(O(1)),适合在遍历时使用
537
+ - `getChildrenTree` - 获取子节点数组,需要传入 tree 和 nodeId,需要查找节点(O(n))
538
+
539
+ ### isRootNode(检查节点是否是根节点)
540
+
541
+ 检查节点是否是根节点(没有父节点)。根节点是树结构数据数组中的顶层节点。
542
+
543
+ ```javascript
544
+ // 检查根节点
545
+ const treeData = [
546
+ {
547
+ id: 1,
548
+ name: 'root1',
549
+ children: [{ id: 2, name: 'child1' }],
550
+ },
551
+ ];
552
+ console.log(t.isRootNode(treeData, 1)) // true
553
+ console.log(t.isRootNode(treeData, 2)) // false
554
+
555
+ // 多个根节点的情况
556
+ const multiRoot = [
557
+ { id: 1, name: 'root1' },
558
+ { id: 2, name: 'root2' },
559
+ { id: 3, name: 'root3' },
560
+ ];
561
+ console.log(t.isRootNode(multiRoot, 1)) // true
562
+ console.log(t.isRootNode(multiRoot, 2)) // true
563
+ console.log(t.isRootNode(multiRoot, 3)) // true
564
+
565
+ // 在遍历时使用
566
+ t.forEachTree(treeData, (node) => {
567
+ if (t.isRootNode(treeData, node.id)) {
568
+ console.log('根节点:', node.name)
569
+ }
570
+ })
571
+
572
+ // 支持自定义字段名
573
+ const customTree = [
574
+ {
575
+ nodeId: 1,
576
+ name: 'root1',
577
+ subNodes: [{ nodeId: 2, name: 'child1' }],
578
+ },
579
+ ];
580
+ const fieldNames = { children: 'subNodes', id: 'nodeId' };
581
+ console.log(t.isRootNode(customTree, 1, fieldNames)) // true
582
+ console.log(t.isRootNode(customTree, 2, fieldNames)) // false
583
+
584
+ // 节点不存在时返回 false
585
+ console.log(t.isRootNode(treeData, 999)) // false
586
+ ```
587
+
588
+ **与现有方法的区别:**
589
+ - `isRootNode` - 语义化方法,直接返回布尔值
590
+ - `getParentTree` - 返回父节点对象,需要判断是否为 null
591
+ - `getNodeDepth` - 返回深度,需要判断是否等于 1
592
+
493
593
  ### isEmptyTreeData(检查树结构数据是否为空)
494
594
 
495
595
  检查树结构数据(数组)是否为空。空数组、null、undefined 都视为空。此函数支持 fieldNames 参数以保持 API 一致性,但该参数不生效(因为只检查数组是否为空,不访问 children 或 id 字段)。
@@ -566,6 +666,55 @@ const isEmptyCustom = t.isEmptySingleTreeData(customTree, fieldNames)
566
666
  console.log(isEmptyCustom) // true
567
667
  ```
568
668
 
669
+ ### isTreeData(判断数据是否是树结构数据)
670
+
671
+ 判断数据是否是树结构数据(数组)。树结构数据必须是一个数组,数组中的每个元素都必须是有效的单个树结构数据。
672
+
673
+ ```javascript
674
+ // 有效的树结构数据(森林)
675
+ const forest = [
676
+ {
677
+ id: 1,
678
+ name: 'node1',
679
+ children: [{ id: 2, name: 'node2' }],
680
+ },
681
+ {
682
+ id: 3,
683
+ name: 'node3',
684
+ children: [{ id: 4, name: 'node4' }],
685
+ },
686
+ ];
687
+ console.log(t.isTreeData(forest)) // true
688
+
689
+ // 空数组也是有效的树结构数据(空森林)
690
+ console.log(t.isTreeData([])) // true
691
+
692
+ // 单个对象不是树结构数据(应该用 isSingleTreeData)
693
+ console.log(t.isTreeData({ id: 1 })) // false
694
+
695
+ // 数组包含非树结构元素,返回 false
696
+ const invalidForest = [
697
+ { id: 1, children: [{ id: 2 }] },
698
+ 'not a tree', // 无效元素
699
+ ];
700
+ console.log(t.isTreeData(invalidForest)) // false
701
+
702
+ // null 或 undefined 不是有效的树结构数据
703
+ console.log(t.isTreeData(null)) // false
704
+ console.log(t.isTreeData(undefined)) // false
705
+
706
+ // 支持自定义字段名
707
+ const customForest = [
708
+ {
709
+ nodeId: 1,
710
+ name: 'node1',
711
+ subNodes: [{ nodeId: 2, name: 'node2' }],
712
+ },
713
+ ];
714
+ const fieldNames = { children: 'subNodes', id: 'nodeId' };
715
+ console.log(t.isTreeData(customForest, fieldNames)) // true
716
+ ```
717
+
569
718
  ### isSingleTreeData(判断数据是否是单个树结构数据)
570
719
 
571
720
  判断数据是否是单个树结构数据(单个对象)。树结构数据必须是一个对象(不能是数组、null、undefined 或基本类型),如果存在 children 字段,必须是数组类型,并且会递归检查所有子节点。
@@ -608,55 +757,136 @@ const fieldNames = { children: 'subNodes', id: 'nodeId' };
608
757
  console.log(t.isSingleTreeData(customTree, fieldNames)) // true
609
758
  ```
610
759
 
611
- ### isTreeData(判断数据是否是树结构数据)
760
+ ### isValidTreeNode(检查单个节点是否是有效的树节点结构)
612
761
 
613
- 判断数据是否是树结构数据(数组)。树结构数据必须是一个数组,数组中的每个元素都必须是有效的单个树结构数据。
762
+ 检查单个节点是否是有效的树节点结构(轻量级,不递归检查子节点)。只检查节点本身的结构,不检查子节点。
614
763
 
615
764
  ```javascript
616
- // 有效的树结构数据(森林)
617
- const forest = [
765
+ // 有效的树节点(有 children 数组)
766
+ const node1 = {
767
+ id: 1,
768
+ name: 'node1',
769
+ children: [{ id: 2 }],
770
+ };
771
+ console.log(t.isValidTreeNode(node1)) // true
772
+
773
+ // 有效的树节点(没有 children 字段)
774
+ const node2 = { id: 1, name: 'node1' };
775
+ console.log(t.isValidTreeNode(node2)) // true
776
+
777
+ // 无效的树节点(children 不是数组)
778
+ const invalidNode = {
779
+ id: 1,
780
+ children: 'not an array',
781
+ };
782
+ console.log(t.isValidTreeNode(invalidNode)) // false
783
+
784
+ // 支持自定义字段名
785
+ const customNode = {
786
+ nodeId: 1,
787
+ subNodes: [{ nodeId: 2 }],
788
+ };
789
+ const fieldNames = { children: 'subNodes', id: 'nodeId' };
790
+ console.log(t.isValidTreeNode(customNode, fieldNames)) // true
791
+ ```
792
+
793
+ **与 isSingleTreeData 的区别:**
794
+ - `isValidTreeNode` - 只检查单个节点的基本结构,不递归检查子节点(轻量级)
795
+ - `isSingleTreeData` - 递归检查整个树结构,确保所有子节点都是有效的树结构
796
+
797
+ ### isTreeNodeWithCircularCheck(检查节点结构并检测循环引用)
798
+
799
+ 检查节点是否是有效的树节点结构,并检测循环引用。使用 WeakSet 跟踪已访问的节点,如果发现循环引用则返回 false。
800
+
801
+ ```javascript
802
+ // 有效的树节点(无循环引用)
803
+ const validNode = {
804
+ id: 1,
805
+ children: [
806
+ { id: 2, children: [{ id: 3 }] },
807
+ ],
808
+ };
809
+ console.log(t.isTreeNodeWithCircularCheck(validNode)) // true
810
+
811
+ // 检测循环引用
812
+ const node1 = { id: 1, children: [] };
813
+ const node2 = { id: 2, children: [] };
814
+ node1.children.push(node2);
815
+ node2.children.push(node1); // 循环引用
816
+ console.log(t.isTreeNodeWithCircularCheck(node1)) // false
817
+
818
+ // 检测自引用
819
+ const selfRefNode = { id: 1, children: [] };
820
+ selfRefNode.children.push(selfRefNode); // 自引用
821
+ console.log(t.isTreeNodeWithCircularCheck(selfRefNode)) // false
822
+
823
+ // 支持自定义字段名
824
+ const customNode = {
825
+ nodeId: 1,
826
+ subNodes: [{ nodeId: 2 }],
827
+ };
828
+ const fieldNames = { children: 'subNodes', id: 'nodeId' };
829
+ console.log(t.isTreeNodeWithCircularCheck(customNode, fieldNames)) // true
830
+ ```
831
+
832
+ **使用场景:**
833
+ - 在接收用户输入或外部数据时,检查是否有循环引用
834
+ - 数据验证,防止无限递归
835
+ - 调试时检查数据结构是否正确
836
+
837
+ ### isSafeTreeDepth(检查树深度是否安全)
838
+
839
+ 检查树结构数据的深度是否安全(防止递归爆栈)。如果树的深度超过 `maxDepth`,返回 false。
840
+
841
+ ```javascript
842
+ // 深度安全的树
843
+ const safeTree = [
618
844
  {
619
845
  id: 1,
620
- name: 'node1',
621
- children: [{ id: 2, name: 'node2' }],
846
+ children: [
847
+ { id: 2, children: [{ id: 3 }] },
848
+ ],
622
849
  },
850
+ ];
851
+ console.log(t.isSafeTreeDepth(safeTree, 10)) // true(深度为3,小于10)
852
+
853
+ // 深度超过最大深度
854
+ const deepTree = [
623
855
  {
624
- id: 3,
625
- name: 'node3',
626
- children: [{ id: 4, name: 'node4' }],
856
+ id: 1,
857
+ children: [
858
+ { id: 2, children: [{ id: 3 }] },
859
+ ],
627
860
  },
628
861
  ];
629
- console.log(t.isTreeData(forest)) // true
630
-
631
- // 空数组也是有效的树结构数据(空森林)
632
- console.log(t.isTreeData([])) // true
862
+ console.log(t.isSafeTreeDepth(deepTree, 2)) // false(深度为3,超过2)
633
863
 
634
- // 单个对象不是树结构数据(应该用 isSingleTreeData)
635
- console.log(t.isTreeData({ id: 1 })) // false
864
+ // 空树总是安全的
865
+ console.log(t.isSafeTreeDepth([], 10)) // true
636
866
 
637
- // 数组包含非树结构元素,返回 false
638
- const invalidForest = [
639
- { id: 1, children: [{ id: 2 }] },
640
- 'not a tree', // 无效元素
641
- ];
642
- console.log(t.isTreeData(invalidForest)) // false
643
-
644
- // null 或 undefined 不是有效的树结构数据
645
- console.log(t.isTreeData(null)) // false
646
- console.log(t.isTreeData(undefined)) // false
867
+ // 单层树
868
+ const singleLayer = [{ id: 1 }, { id: 2 }];
869
+ console.log(t.isSafeTreeDepth(singleLayer, 1)) // true
647
870
 
648
871
  // 支持自定义字段名
649
- const customForest = [
872
+ const customTree = [
650
873
  {
651
874
  nodeId: 1,
652
- name: 'node1',
653
- subNodes: [{ nodeId: 2, name: 'node2' }],
875
+ subNodes: [
876
+ { nodeId: 2, subNodes: [{ nodeId: 3 }] },
877
+ ],
654
878
  },
655
879
  ];
656
880
  const fieldNames = { children: 'subNodes', id: 'nodeId' };
657
- console.log(t.isTreeData(customForest, fieldNames)) // true
881
+ console.log(t.isSafeTreeDepth(customTree, 3, fieldNames)) // true
882
+ console.log(t.isSafeTreeDepth(customTree, 2, fieldNames)) // false
658
883
  ```
659
884
 
885
+ **使用场景:**
886
+ - 在处理大型树之前,先检查深度是否安全
887
+ - 防止递归调用栈溢出
888
+ - 性能优化,避免处理过深的树结构
889
+
660
890
  ## 自定义字段名
661
891
 
662
892
  所有方法都支持自定义 children 和 id 的属性名,通过最后一个参数传入配置对象:
@@ -670,7 +900,7 @@ const fieldNames = { children: 'subNodes', id: 'nodeId' };
670
900
  const foundNode2 = t.findTree(customTreeData, (node) => node.nodeId === 2, fieldNames);
671
901
  ```
672
902
 
673
- **注意:** 所有 25 个函数都支持 `fieldNames` 参数,保持 API 一致性。即使某些函数(如 `isEmptyTreeData`)中该参数不生效,也可以传入以保持代码风格一致。
903
+ **注意:** 所有 30 个函数都支持 `fieldNames` 参数,保持 API 一致性。即使某些函数(如 `isEmptyTreeData`)中该参数不生效,也可以传入以保持代码风格一致。
674
904
 
675
905
  ## 测试
676
906
 
package/dist/index.d.ts CHANGED
@@ -29,6 +29,11 @@ export declare function getParentTree(tree: TreeData, targetId: any, fieldNames?
29
29
  export declare function includesTree(tree: TreeData, targetId: any, fieldNames?: FieldNames): boolean;
30
30
  export declare function isSingleTreeData(data: any, fieldNames?: FieldNames): boolean;
31
31
  export declare function isTreeData(data: any, fieldNames?: FieldNames): boolean;
32
+ export declare function isValidTreeNode(value: unknown, fieldNames?: FieldNames): value is TreeNode;
33
+ export declare function isTreeNodeWithCircularCheck(value: unknown, fieldNames?: FieldNames, visited?: WeakSet<object>): boolean;
34
+ export declare function isSafeTreeDepth(tree: TreeData, maxDepth: number, fieldNames?: FieldNames): boolean;
35
+ export declare function isLeafNode(node: TreeNode, fieldNames?: FieldNames): boolean;
36
+ export declare function isRootNode(tree: TreeData, nodeId: any, fieldNames?: FieldNames): boolean;
32
37
  declare const treeProcessor: {
33
38
  mapTree: typeof mapTree;
34
39
  filterTree: typeof filterTree;
@@ -55,6 +60,11 @@ declare const treeProcessor: {
55
60
  includesTree: typeof includesTree;
56
61
  isSingleTreeData: typeof isSingleTreeData;
57
62
  isTreeData: typeof isTreeData;
63
+ isValidTreeNode: typeof isValidTreeNode;
64
+ isTreeNodeWithCircularCheck: typeof isTreeNodeWithCircularCheck;
65
+ isSafeTreeDepth: typeof isSafeTreeDepth;
66
+ isLeafNode: typeof isLeafNode;
67
+ isRootNode: typeof isRootNode;
58
68
  };
59
69
  export default treeProcessor;
60
70
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ;AAaD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAK3C,MAAM,MAAM,QAAQ,GAAG,QAAQ,EAAE,CAAC;AASlC,wBAAgB,OAAO,CACrB,IAAI,EAAE,QA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
4930
  <script>
4931
4931
  /*<!--*/
4932
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"tree-processor.esm.js","children":[{"name":"src/index.ts","uid":"f5d7d230-1"}]}],"isRoot":true},"nodeParts":{"f5d7d230-1":{"renderedLength":14963,"gzipLength":1892,"brotliLength":1670,"metaUid":"f5d7d230-0"}},"nodeMetas":{"f5d7d230-0":{"id":"\\src\\index.ts","moduleParts":{"tree-processor.esm.js":"f5d7d230-1"},"imported":[],"importedBy":[],"isEntry":true}},"env":{"rollup":"4.56.0"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
4932
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"tree-processor.cjs.js","children":[{"name":"src/index.ts","uid":"7eca4295-1"}]}],"isRoot":true},"nodeParts":{"7eca4295-1":{"renderedLength":17081,"gzipLength":2155,"brotliLength":1901,"metaUid":"7eca4295-0"}},"nodeMetas":{"7eca4295-0":{"id":"\\src\\index.ts","moduleParts":{"tree-processor.cjs.js":"7eca4295-1"},"imported":[],"importedBy":[],"isEntry":true}},"env":{"rollup":"4.56.0"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
4933
4933
 
4934
4934
  const run = () => {
4935
4935
  const width = window.innerWidth;
@@ -1,88 +1,100 @@
1
1
  "use strict"
2
2
  Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})
3
3
  const r={children:"children",id:"id"}
4
- function n(n,e,t=r){const i=[]
5
- return function r(n){for(const o of n){i.push(e(o))
6
- const n=o[t.children]
7
- Array.isArray(n)&&n.length>0&&r(n)}}(n),i}function e(n,e,t=r){const i=[]
8
- return function r(n){n.forEach((n,o)=>{e(n,o)&&i.push(n)
9
- const u=n[t.children]
10
- Array.isArray(u)&&u.length>0&&r(u,o)})}(n),i}function t(n,e,i=r){for(const r of n){if(e(r))return r
11
- const n=r[i.children]
12
- if(Array.isArray(n)&&n.length>0){const r=t(n,e,i)
13
- if(r)return r}}return null}function i(n,e,t,i=r){return function r(n){for(const o of n){if(o[i.id]===e)return o[i.children]||(o[i.children]=[]),o[i.children].push(t),!0
14
- const n=o[i.children]
15
- if(Array.isArray(n)&&n.length>0&&r(n))return!0}return!1}(n)}function o(n,e,t,i=r){return function r(n){for(const o of n){if(o[i.id]===e)return o[i.children]||(o[i.children]=[]),o[i.children].unshift(t),!0
16
- const n=o[i.children]
17
- if(Array.isArray(n)&&n.length>0&&r(n))return!0}return!1}(n)}function u(n,e,t=r){return function r(n){for(const i of n){if(i[t.id]===e){const r=i[t.children]
18
- return!!(Array.isArray(r)&&r.length>0)&&(r.pop(),!0)}const n=i[t.children]
19
- if(Array.isArray(n)&&n.length>0&&r(n))return!0}return!1}(n)}function s(n,e,t=r){return function r(n){for(const i of n){if(i[t.id]===e){const r=i[t.children]
20
- return!!(Array.isArray(r)&&r.length>0)&&(r.shift(),!0)}const n=i[t.children]
21
- if(Array.isArray(n)&&n.length>0&&r(n))return!0}return!1}(n)}function c(n,e,t=r){for(const r of n){if(e(r))return!0
22
- const n=r[t.children]
23
- if(Array.isArray(n)&&n.length>0&&c(n,e,t))return!0}return!1}function f(n,e,t=r){for(const r of n){if(!e(r))return!1
24
- const n=r[t.children]
25
- if(Array.isArray(n)&&n.length>0&&!f(n,e,t))return!1}return!0}function l(n,e,t,i=r){const o=function r(n){for(const t of n){if(t[i.id]===e)return t
26
- const n=t[i.children]
27
- if(Array.isArray(n)&&n.length>0){const e=r(n)
28
- if(e)return e}}return null}(n)
4
+ function e(e,n,t=r){const i=[]
5
+ return function r(e){for(const o of e){i.push(n(o))
6
+ const e=o[t.children]
7
+ Array.isArray(e)&&e.length>0&&r(e)}}(e),i}function n(e,n,t=r){const i=[]
8
+ return function r(e){e.forEach((e,o)=>{n(e,o)&&i.push(e)
9
+ const u=e[t.children]
10
+ Array.isArray(u)&&u.length>0&&r(u,o)})}(e),i}function t(e,n,i=r){for(const r of e){if(n(r))return r
11
+ const e=r[i.children]
12
+ if(Array.isArray(e)&&e.length>0){const r=t(e,n,i)
13
+ if(r)return r}}return null}function i(e,n,t,i=r){return function r(e){for(const o of e){if(o[i.id]===n)return o[i.children]||(o[i.children]=[]),o[i.children].push(t),!0
14
+ const e=o[i.children]
15
+ if(Array.isArray(e)&&e.length>0&&r(e))return!0}return!1}(e)}function o(e,n,t,i=r){return function r(e){for(const o of e){if(o[i.id]===n)return o[i.children]||(o[i.children]=[]),o[i.children].unshift(t),!0
16
+ const e=o[i.children]
17
+ if(Array.isArray(e)&&e.length>0&&r(e))return!0}return!1}(e)}function u(e,n,t=r){return function r(e){for(const i of e){if(i[t.id]===n){const r=i[t.children]
18
+ return!!(Array.isArray(r)&&r.length>0)&&(r.pop(),!0)}const e=i[t.children]
19
+ if(Array.isArray(e)&&e.length>0&&r(e))return!0}return!1}(e)}function s(e,n,t=r){return function r(e){for(const i of e){if(i[t.id]===n){const r=i[t.children]
20
+ return!!(Array.isArray(r)&&r.length>0)&&(r.shift(),!0)}const e=i[t.children]
21
+ if(Array.isArray(e)&&e.length>0&&r(e))return!0}return!1}(e)}function f(e,n,t=r){for(const r of e){if(n(r))return!0
22
+ const e=r[t.children]
23
+ if(Array.isArray(e)&&e.length>0&&f(e,n,t))return!0}return!1}function c(e,n,t=r){for(const r of e){if(!n(r))return!1
24
+ const e=r[t.children]
25
+ if(Array.isArray(e)&&e.length>0&&!c(e,n,t))return!1}return!0}function l(e,n,t,i=r){const o=function r(e){for(const t of e){if(t[i.id]===n)return t
26
+ const e=t[i.children]
27
+ if(Array.isArray(e)&&e.length>0){const n=r(e)
28
+ if(n)return n}}return null}(e)
29
29
  if(!o)return null
30
30
  const u=o[i.children]
31
31
  if(!Array.isArray(u)||0===u.length)return null
32
32
  const s=t>=0?t:u.length+t
33
- return s>=0&&s<u.length?u[s]:null}function a(n,e,t=r){return function r(n,i=[]){for(let o=0;o<n.length;o++){const u=n[o],s=[...i,o]
34
- if(u[t.id]===e)return s
35
- const c=u[t.children]
36
- if(Array.isArray(c)&&c.length>0){const n=r(c,s)
37
- if(n)return n}}return null}(n)}function h(n,e,t=r){if(!Array.isArray(e)||0===e.length)return null
38
- let i=n
39
- for(let r=0;r<e.length;r++){const n=e[r]
40
- if(!Array.isArray(i)||n<0||n>=i.length)return null
41
- const o=i[n]
42
- if(r===e.length-1)return o
33
+ return s>=0&&s<u.length?u[s]:null}function a(e,n,t=r){return function r(e,i=[]){for(let o=0;o<e.length;o++){const u=e[o],s=[...i,o]
34
+ if(u[t.id]===n)return s
35
+ const f=u[t.children]
36
+ if(Array.isArray(f)&&f.length>0){const e=r(f,s)
37
+ if(e)return e}}return null}(e)}function h(e,n,t=r){if(!Array.isArray(n)||0===n.length)return null
38
+ let i=e
39
+ for(let r=0;r<n.length;r++){const e=n[r]
40
+ if(!Array.isArray(i)||e<0||e>=i.length)return null
41
+ const o=i[e]
42
+ if(r===n.length-1)return o
43
43
  const u=o[t.children]
44
44
  if(!Array.isArray(u))return null
45
- i=u}return null}function d(n,e=r){const t={}
46
- return function r(n,i=1){for(const o of n){t[o[e.id]]=i
47
- const n=o[e.children]
48
- Array.isArray(n)&&n.length>0&&r(n,i+1)}}(n),t}function y(n,e,t=r){return function r(n,i=1){for(const o of n){if(o[t.id]===e)return i
49
- const n=o[t.children]
50
- if(Array.isArray(n)&&n.length>0){const e=r(n,i+1)
51
- if(null!==e)return e}}return null}(n)}function A(n,e,t=r){const i=new Set
52
- return function r(n){const o=[]
53
- for(const u of n){const n=u[e]
54
- if(null!=n){if(i.has(n))continue
55
- i.add(n)}const s={...u},c=u[t.children]
56
- Array.isArray(c)&&c.length>0&&(s[t.children]=r(c)),o.push(s)}return o}(n)}function p(n,e,t=r){return function r(n){for(let i=0;i<n.length;i++){const o=n[i]
57
- if(o[t.id]===e)return n.splice(i,1),!0
45
+ i=u}return null}function d(e,n=r){const t={}
46
+ return function r(e,i=1){for(const o of e){t[o[n.id]]=i
47
+ const e=o[n.children]
48
+ Array.isArray(e)&&e.length>0&&r(e,i+1)}}(e),t}function y(e,n,t=r){return function r(e,i=1){for(const o of e){if(o[t.id]===n)return i
49
+ const e=o[t.children]
50
+ if(Array.isArray(e)&&e.length>0){const n=r(e,i+1)
51
+ if(null!==n)return n}}return null}(e)}function A(e,n,t=r){const i=new Set
52
+ return function r(e){const o=[]
53
+ for(const u of e){const e=u[n]
54
+ if(null!=e){if(i.has(e))continue
55
+ i.add(e)}const s={...u},f=u[t.children]
56
+ Array.isArray(f)&&f.length>0&&(s[t.children]=r(f)),o.push(s)}return o}(e)}function p(e,n,t=r){return function r(e){for(let i=0;i<e.length;i++){const o=e[i]
57
+ if(o[t.id]===n)return e.splice(i,1),!0
58
58
  const u=o[t.children]
59
- if(Array.isArray(u)&&u.length>0&&r(u))return!0}return!1}(n)}function g(n,e,t=r){!function r(n){for(const i of n){e(i)
60
- const n=i[t.children]
61
- Array.isArray(n)&&n.length>0&&r(n)}}(n)}function T(r){return!Array.isArray(r)||0===r.length}function x(n,e=r){if(!E(n,e))return!0
62
- const t=n[e.children]
63
- return void 0===t||(!Array.isArray(t)||0===t.length)}function D(n,e,t=r){const i=function r(n){for(const i of n){if(i[t.id]===e)return i
64
- const n=i[t.children]
65
- if(Array.isArray(n)&&n.length>0){const e=r(n)
66
- if(null!==e)return e}}return null}(n)
59
+ if(Array.isArray(u)&&u.length>0&&r(u))return!0}return!1}(e)}function g(e,n,t=r){!function r(e){for(const i of e){n(i)
60
+ const e=i[t.children]
61
+ Array.isArray(e)&&e.length>0&&r(e)}}(e)}function T(r){return!Array.isArray(r)||0===r.length}function x(e,n=r){if(!v(e,n))return!0
62
+ const t=e[n.children]
63
+ return void 0===t||(!Array.isArray(t)||0===t.length)}function D(e,n,t=r){const i=function r(e){for(const i of e){if(i[t.id]===n)return i
64
+ const e=i[t.children]
65
+ if(Array.isArray(e)&&e.length>0){const n=r(e)
66
+ if(null!==n)return n}}return null}(e)
67
67
  if(!i)return[]
68
68
  const o=i[t.children]
69
- return Array.isArray(o)?o:[]}function m(n,e,t=r){const i=function r(n,i=null){for(const o of n){if(o[t.id]===e)return{node:o,parent:i}
70
- const n=o[t.children]
71
- if(Array.isArray(n)&&n.length>0){const e=r(n,o)
72
- if(null!==e)return e}}return null}(n)
69
+ return Array.isArray(o)?o:[]}function N(e,n,t=r){const i=function r(e,i=null){for(const o of e){if(o[t.id]===n)return{node:o,parent:i}
70
+ const e=o[t.children]
71
+ if(Array.isArray(e)&&e.length>0){const n=r(e,o)
72
+ if(null!==n)return n}}return null}(e)
73
73
  if(!i)return[]
74
- if(null===i.parent)return n
74
+ if(null===i.parent)return e
75
75
  const o=i.parent[t.children]
76
- return Array.isArray(o)?o:[]}function S(n,e,t=r){return function r(n,i=null){for(const o of n){if(o[t.id]===e)return i
77
- const n=o[t.children]
78
- if(Array.isArray(n)&&n.length>0){const e=r(n,o)
79
- if(null!==e)return e}}return null}(n)}function v(n,e,t=r){for(const r of n){if(r[t.id]===e)return!0
80
- const n=r[t.children]
81
- if(Array.isArray(n)&&n.length>0&&v(n,e,t))return!0}return!1}function E(n,e=r){if(!n||"object"!=typeof n||Array.isArray(n))return!1
82
- const t=n[e.children]
76
+ return Array.isArray(o)?o:[]}function S(e,n,t=r){return function r(e,i=null){for(const o of e){if(o[t.id]===n)return i
77
+ const e=o[t.children]
78
+ if(Array.isArray(e)&&e.length>0){const n=r(e,o)
79
+ if(null!==n)return n}}return null}(e)}function m(e,n,t=r){for(const r of e){if(r[t.id]===n)return!0
80
+ const e=r[t.children]
81
+ if(Array.isArray(e)&&e.length>0&&m(e,n,t))return!0}return!1}function v(e,n=r){if(!e||"object"!=typeof e||Array.isArray(e))return!1
82
+ const t=e[n.children]
83
83
  if(void 0!==t){if(null===t)return!1
84
84
  if(!Array.isArray(t))return!1
85
- for(const r of t)if(!E(r,e))return!1}return!0}function b(n,e=r){if(!Array.isArray(n))return!1
86
- for(const r of n)if(!E(r,e))return!1
87
- return!0}const O={mapTree:n,filterTree:e,findTree:t,pushTree:i,unshiftTree:o,popTree:u,shiftTree:s,someTree:c,everyTree:f,atTree:l,indexOfTree:a,atIndexOfTree:h,getNodeDepthMap:d,getNodeDepth:y,dedupTree:A,removeTree:p,forEachTree:g,isEmptyTreeData:T,isEmptySingleTreeData:x,getParentTree:S,getChildrenTree:D,getSiblingsTree:m,includesTree:v,isSingleTreeData:E,isTreeData:b}
88
- exports.atIndexOfTree=h,exports.atTree=l,exports.dedupTree=A,exports.default=O,exports.everyTree=f,exports.filterTree=e,exports.findTree=t,exports.forEachTree=g,exports.getChildrenTree=D,exports.getNodeDepth=y,exports.getNodeDepthMap=d,exports.getParentTree=S,exports.getSiblingsTree=m,exports.includesTree=v,exports.indexOfTree=a,exports.isEmptySingleTreeData=x,exports.isEmptyTreeData=T,exports.isSingleTreeData=E,exports.isTreeData=b,exports.mapTree=n,exports.popTree=u,exports.pushTree=i,exports.removeTree=p,exports.shiftTree=s,exports.someTree=c,exports.unshiftTree=o
85
+ for(const r of t)if(!v(r,n))return!1}return!0}function b(e,n=r){if(!Array.isArray(e))return!1
86
+ for(const r of e)if(!v(r,n))return!1
87
+ return!0}function E(e,n=r){if(!e||"object"!=typeof e||Array.isArray(e))return!1
88
+ const t=e[n.children]
89
+ return void 0===t||Array.isArray(t)}function C(e,n=r,t=new WeakSet){if(!e||"object"!=typeof e||Array.isArray(e))return!1
90
+ if(t.has(e))return!1
91
+ t.add(e)
92
+ const i=e[n.children]
93
+ if(void 0!==i){if(null===i)return!1
94
+ if(!Array.isArray(i))return!1
95
+ for(const r of i)if(!C(r,n,t))return!1}return!0}function O(e,n,t=r){if(n<=0)return!1
96
+ return function r(e,i){if(i>n)return!1
97
+ for(const n of e){const e=n[t.children]
98
+ if(Array.isArray(e)&&e.length>0&&!r(e,i+1))return!1}return!0}(e,1)}function j(e,n=r){const t=e[n.children]
99
+ return void 0===t||!Array.isArray(t)||0===t.length}function M(e,n,t=r){return!!m(e,n,t)&&null===S(e,n,t)}const k={mapTree:e,filterTree:n,findTree:t,pushTree:i,unshiftTree:o,popTree:u,shiftTree:s,someTree:f,everyTree:c,atTree:l,indexOfTree:a,atIndexOfTree:h,getNodeDepthMap:d,getNodeDepth:y,dedupTree:A,removeTree:p,forEachTree:g,isEmptyTreeData:T,isEmptySingleTreeData:x,getParentTree:S,getChildrenTree:D,getSiblingsTree:N,includesTree:m,isSingleTreeData:v,isTreeData:b,isValidTreeNode:E,isTreeNodeWithCircularCheck:C,isSafeTreeDepth:O,isLeafNode:j,isRootNode:M}
100
+ exports.atIndexOfTree=h,exports.atTree=l,exports.dedupTree=A,exports.default=k,exports.everyTree=c,exports.filterTree=n,exports.findTree=t,exports.forEachTree=g,exports.getChildrenTree=D,exports.getNodeDepth=y,exports.getNodeDepthMap=d,exports.getParentTree=S,exports.getSiblingsTree=N,exports.includesTree=m,exports.indexOfTree=a,exports.isEmptySingleTreeData=x,exports.isEmptyTreeData=T,exports.isLeafNode=j,exports.isRootNode=M,exports.isSafeTreeDepth=O,exports.isSingleTreeData=v,exports.isTreeData=b,exports.isTreeNodeWithCircularCheck=C,exports.isValidTreeNode=E,exports.mapTree=e,exports.popTree=u,exports.pushTree=i,exports.removeTree=p,exports.shiftTree=s,exports.someTree=f,exports.unshiftTree=o
@@ -56,31 +56,43 @@ if(o[e.id]===t)return n.splice(i,1),!0
56
56
  const u=o[e.children]
57
57
  if(Array.isArray(u)&&u.length>0&&r(u))return!0}return!1}(n)}function T(n,t,e=r){!function r(n){for(const i of n){t(i)
58
58
  const n=i[e.children]
59
- Array.isArray(n)&&n.length>0&&r(n)}}(n)}function p(r){return!Array.isArray(r)||0===r.length}function D(n,t=r){if(!x(n,t))return!0
59
+ Array.isArray(n)&&n.length>0&&r(n)}}(n)}function p(r){return!Array.isArray(r)||0===r.length}function v(n,t=r){if(!b(n,t))return!0
60
60
  const e=n[t.children]
61
- return void 0===e||(!Array.isArray(e)||0===e.length)}function m(n,t,e=r){const i=function r(n){for(const i of n){if(i[e.id]===t)return i
61
+ return void 0===e||(!Array.isArray(e)||0===e.length)}function D(n,t,e=r){const i=function r(n){for(const i of n){if(i[e.id]===t)return i
62
62
  const n=i[e.children]
63
63
  if(Array.isArray(n)&&n.length>0){const t=r(n)
64
64
  if(null!==t)return t}}return null}(n)
65
65
  if(!i)return[]
66
66
  const o=i[e.children]
67
- return Array.isArray(o)?o:[]}function v(n,t,e=r){const i=function r(n,i=null){for(const o of n){if(o[e.id]===t)return{node:o,parent:i}
67
+ return Array.isArray(o)?o:[]}function N(n,t,e=r){const i=function r(n,i=null){for(const o of n){if(o[e.id]===t)return{node:o,parent:i}
68
68
  const n=o[e.children]
69
69
  if(Array.isArray(n)&&n.length>0){const t=r(n,o)
70
70
  if(null!==t)return t}}return null}(n)
71
71
  if(!i)return[]
72
72
  if(null===i.parent)return n
73
73
  const o=i.parent[e.children]
74
- return Array.isArray(o)?o:[]}function E(n,t,e=r){return function r(n,i=null){for(const o of n){if(o[e.id]===t)return i
74
+ return Array.isArray(o)?o:[]}function S(n,t,e=r){return function r(n,i=null){for(const o of n){if(o[e.id]===t)return i
75
75
  const n=o[e.children]
76
76
  if(Array.isArray(n)&&n.length>0){const t=r(n,o)
77
- if(null!==t)return t}}return null}(n)}function S(n,t,e=r){for(const r of n){if(r[e.id]===t)return!0
77
+ if(null!==t)return t}}return null}(n)}function m(n,t,e=r){for(const r of n){if(r[e.id]===t)return!0
78
78
  const n=r[e.children]
79
- if(Array.isArray(n)&&n.length>0&&S(n,t,e))return!0}return!1}function x(n,t=r){if(!n||"object"!=typeof n||Array.isArray(n))return!1
79
+ if(Array.isArray(n)&&n.length>0&&m(n,t,e))return!0}return!1}function b(n,t=r){if(!n||"object"!=typeof n||Array.isArray(n))return!1
80
80
  const e=n[t.children]
81
81
  if(void 0!==e){if(null===e)return!1
82
82
  if(!Array.isArray(e))return!1
83
- for(const r of e)if(!x(r,t))return!1}return!0}function b(n,t=r){if(!Array.isArray(n))return!1
84
- for(const r of n)if(!x(r,t))return!1
85
- return!0}const N={mapTree:n,filterTree:t,findTree:e,pushTree:i,unshiftTree:o,popTree:u,shiftTree:c,someTree:f,everyTree:l,atTree:s,indexOfTree:a,atIndexOfTree:h,getNodeDepthMap:y,getNodeDepth:d,dedupTree:A,removeTree:g,forEachTree:T,isEmptyTreeData:p,isEmptySingleTreeData:D,getParentTree:E,getChildrenTree:m,getSiblingsTree:v,includesTree:S,isSingleTreeData:x,isTreeData:b}
86
- export{h as atIndexOfTree,s as atTree,A as dedupTree,N as default,l as everyTree,t as filterTree,e as findTree,T as forEachTree,m as getChildrenTree,d as getNodeDepth,y as getNodeDepthMap,E as getParentTree,v as getSiblingsTree,S as includesTree,a as indexOfTree,D as isEmptySingleTreeData,p as isEmptyTreeData,x as isSingleTreeData,b as isTreeData,n as mapTree,u as popTree,i as pushTree,g as removeTree,c as shiftTree,f as someTree,o as unshiftTree}
83
+ for(const r of e)if(!b(r,t))return!1}return!0}function E(n,t=r){if(!Array.isArray(n))return!1
84
+ for(const r of n)if(!b(r,t))return!1
85
+ return!0}function j(n,t=r){if(!n||"object"!=typeof n||Array.isArray(n))return!1
86
+ const e=n[t.children]
87
+ return void 0===e||Array.isArray(e)}function x(n,t=r,e=new WeakSet){if(!n||"object"!=typeof n||Array.isArray(n))return!1
88
+ if(e.has(n))return!1
89
+ e.add(n)
90
+ const i=n[t.children]
91
+ if(void 0!==i){if(null===i)return!1
92
+ if(!Array.isArray(i))return!1
93
+ for(const r of i)if(!x(r,t,e))return!1}return!0}function C(n,t,e=r){if(t<=0)return!1
94
+ return function r(n,i){if(i>t)return!1
95
+ for(const t of n){const n=t[e.children]
96
+ if(Array.isArray(n)&&n.length>0&&!r(n,i+1))return!1}return!0}(n,1)}function k(n,t=r){const e=n[t.children]
97
+ return void 0===e||!Array.isArray(e)||0===e.length}function w(n,t,e=r){return!!m(n,t,e)&&null===S(n,t,e)}const O={mapTree:n,filterTree:t,findTree:e,pushTree:i,unshiftTree:o,popTree:u,shiftTree:c,someTree:f,everyTree:l,atTree:s,indexOfTree:a,atIndexOfTree:h,getNodeDepthMap:y,getNodeDepth:d,dedupTree:A,removeTree:g,forEachTree:T,isEmptyTreeData:p,isEmptySingleTreeData:v,getParentTree:S,getChildrenTree:D,getSiblingsTree:N,includesTree:m,isSingleTreeData:b,isTreeData:E,isValidTreeNode:j,isTreeNodeWithCircularCheck:x,isSafeTreeDepth:C,isLeafNode:k,isRootNode:w}
98
+ export{h as atIndexOfTree,s as atTree,A as dedupTree,O as default,l as everyTree,t as filterTree,e as findTree,T as forEachTree,D as getChildrenTree,d as getNodeDepth,y as getNodeDepthMap,S as getParentTree,N as getSiblingsTree,m as includesTree,a as indexOfTree,v as isEmptySingleTreeData,p as isEmptyTreeData,k as isLeafNode,w as isRootNode,C as isSafeTreeDepth,b as isSingleTreeData,E as isTreeData,x as isTreeNodeWithCircularCheck,j as isValidTreeNode,n as mapTree,u as popTree,i as pushTree,g as removeTree,c as shiftTree,f as someTree,o as unshiftTree}
@@ -5,67 +5,67 @@ return function r(n){for(const o of n){i.push(e(o))
5
5
  const n=o[t.children]
6
6
  Array.isArray(n)&&n.length>0&&r(n)}}(r),i}function t(r,e,t=n){const i=[]
7
7
  return function r(n){n.forEach((n,o)=>{e(n,o)&&i.push(n)
8
- const u=n[t.children]
9
- Array.isArray(u)&&u.length>0&&r(u,o)})}(r),i}function i(r,e,t=n){for(const n of r){if(e(n))return n
8
+ const f=n[t.children]
9
+ Array.isArray(f)&&f.length>0&&r(f,o)})}(r),i}function i(r,e,t=n){for(const n of r){if(e(n))return n
10
10
  const r=n[t.children]
11
11
  if(Array.isArray(r)&&r.length>0){const n=i(r,e,t)
12
12
  if(n)return n}}return null}function o(r,e,t,i=n){return function r(n){for(const o of n){if(o[i.id]===e)return o[i.children]||(o[i.children]=[]),o[i.children].push(t),!0
13
13
  const n=o[i.children]
14
- if(Array.isArray(n)&&n.length>0&&r(n))return!0}return!1}(r)}function u(r,e,t,i=n){return function r(n){for(const o of n){if(o[i.id]===e)return o[i.children]||(o[i.children]=[]),o[i.children].unshift(t),!0
14
+ if(Array.isArray(n)&&n.length>0&&r(n))return!0}return!1}(r)}function f(r,e,t,i=n){return function r(n){for(const o of n){if(o[i.id]===e)return o[i.children]||(o[i.children]=[]),o[i.children].unshift(t),!0
15
15
  const n=o[i.children]
16
- if(Array.isArray(n)&&n.length>0&&r(n))return!0}return!1}(r)}function f(r,e,t=n){return function r(n){for(const i of n){if(i[t.id]===e){const r=i[t.children]
16
+ if(Array.isArray(n)&&n.length>0&&r(n))return!0}return!1}(r)}function u(r,e,t=n){return function r(n){for(const i of n){if(i[t.id]===e){const r=i[t.children]
17
17
  return!!(Array.isArray(r)&&r.length>0)&&(r.pop(),!0)}const n=i[t.children]
18
18
  if(Array.isArray(n)&&n.length>0&&r(n))return!0}return!1}(r)}function c(r,e,t=n){return function r(n){for(const i of n){if(i[t.id]===e){const r=i[t.children]
19
19
  return!!(Array.isArray(r)&&r.length>0)&&(r.shift(),!0)}const n=i[t.children]
20
- if(Array.isArray(n)&&n.length>0&&r(n))return!0}return!1}(r)}function l(r,e,t=n){for(const n of r){if(e(n))return!0
20
+ if(Array.isArray(n)&&n.length>0&&r(n))return!0}return!1}(r)}function s(r,e,t=n){for(const n of r){if(e(n))return!0
21
21
  const r=n[t.children]
22
- if(Array.isArray(r)&&r.length>0&&l(r,e,t))return!0}return!1}function s(r,e,t=n){for(const n of r){if(!e(n))return!1
22
+ if(Array.isArray(r)&&r.length>0&&s(r,e,t))return!0}return!1}function l(r,e,t=n){for(const n of r){if(!e(n))return!1
23
23
  const r=n[t.children]
24
- if(Array.isArray(r)&&r.length>0&&!s(r,e,t))return!1}return!0}function a(r,e,t,i=n){const o=function r(n){for(const t of n){if(t[i.id]===e)return t
24
+ if(Array.isArray(r)&&r.length>0&&!l(r,e,t))return!1}return!0}function a(r,e,t,i=n){const o=function r(n){for(const t of n){if(t[i.id]===e)return t
25
25
  const n=t[i.children]
26
26
  if(Array.isArray(n)&&n.length>0){const e=r(n)
27
27
  if(e)return e}}return null}(r)
28
28
  if(!o)return null
29
- const u=o[i.children]
30
- if(!Array.isArray(u)||0===u.length)return null
31
- const f=t>=0?t:u.length+t
32
- return f>=0&&f<u.length?u[f]:null}function h(r,e,t=n){return function r(n,i=[]){for(let o=0;o<n.length;o++){const u=n[o],f=[...i,o]
33
- if(u[t.id]===e)return f
34
- const c=u[t.children]
35
- if(Array.isArray(c)&&c.length>0){const n=r(c,f)
29
+ const f=o[i.children]
30
+ if(!Array.isArray(f)||0===f.length)return null
31
+ const u=t>=0?t:f.length+t
32
+ return u>=0&&u<f.length?f[u]:null}function h(r,e,t=n){return function r(n,i=[]){for(let o=0;o<n.length;o++){const f=n[o],u=[...i,o]
33
+ if(f[t.id]===e)return u
34
+ const c=f[t.children]
35
+ if(Array.isArray(c)&&c.length>0){const n=r(c,u)
36
36
  if(n)return n}}return null}(r)}function d(r,e,t=n){if(!Array.isArray(e)||0===e.length)return null
37
37
  let i=r
38
38
  for(let r=0;r<e.length;r++){const n=e[r]
39
39
  if(!Array.isArray(i)||n<0||n>=i.length)return null
40
40
  const o=i[n]
41
41
  if(r===e.length-1)return o
42
- const u=o[t.children]
43
- if(!Array.isArray(u))return null
44
- i=u}return null}function y(r,e=n){const t={}
42
+ const f=o[t.children]
43
+ if(!Array.isArray(f))return null
44
+ i=f}return null}function y(r,e=n){const t={}
45
45
  return function r(n,i=1){for(const o of n){t[o[e.id]]=i
46
46
  const n=o[e.children]
47
47
  Array.isArray(n)&&n.length>0&&r(n,i+1)}}(r),t}function A(r,e,t=n){return function r(n,i=1){for(const o of n){if(o[t.id]===e)return i
48
48
  const n=o[t.children]
49
49
  if(Array.isArray(n)&&n.length>0){const e=r(n,i+1)
50
- if(null!==e)return e}}return null}(r)}function g(r,e,t=n){const i=new Set
50
+ if(null!==e)return e}}return null}(r)}function T(r,e,t=n){const i=new Set
51
51
  return function r(n){const o=[]
52
- for(const u of n){const n=u[e]
52
+ for(const f of n){const n=f[e]
53
53
  if(null!=n){if(i.has(n))continue
54
- i.add(n)}const f={...u},c=u[t.children]
55
- Array.isArray(c)&&c.length>0&&(f[t.children]=r(c)),o.push(f)}return o}(r)}function T(r,e,t=n){return function r(n){for(let i=0;i<n.length;i++){const o=n[i]
54
+ i.add(n)}const u={...f},c=f[t.children]
55
+ Array.isArray(c)&&c.length>0&&(u[t.children]=r(c)),o.push(u)}return o}(r)}function g(r,e,t=n){return function r(n){for(let i=0;i<n.length;i++){const o=n[i]
56
56
  if(o[t.id]===e)return n.splice(i,1),!0
57
- const u=o[t.children]
58
- if(Array.isArray(u)&&u.length>0&&r(u))return!0}return!1}(r)}function p(r,e,t=n){!function r(n){for(const i of n){e(i)
57
+ const f=o[t.children]
58
+ if(Array.isArray(f)&&f.length>0&&r(f))return!0}return!1}(r)}function p(r,e,t=n){!function r(n){for(const i of n){e(i)
59
59
  const n=i[t.children]
60
- Array.isArray(n)&&n.length>0&&r(n)}}(r)}function m(r){return!Array.isArray(r)||0===r.length}function D(r,e=n){if(!E(r,e))return!0
60
+ Array.isArray(n)&&n.length>0&&r(n)}}(r)}function D(r){return!Array.isArray(r)||0===r.length}function m(r,e=n){if(!x(r,e))return!0
61
61
  const t=r[e.children]
62
- return void 0===t||(!Array.isArray(t)||0===t.length)}function S(r,e,t=n){const i=function r(n){for(const i of n){if(i[t.id]===e)return i
62
+ return void 0===t||(!Array.isArray(t)||0===t.length)}function N(r,e,t=n){const i=function r(n){for(const i of n){if(i[t.id]===e)return i
63
63
  const n=i[t.children]
64
64
  if(Array.isArray(n)&&n.length>0){const e=r(n)
65
65
  if(null!==e)return e}}return null}(r)
66
66
  if(!i)return[]
67
67
  const o=i[t.children]
68
- return Array.isArray(o)?o:[]}function b(r,e,t=n){const i=function r(n,i=null){for(const o of n){if(o[t.id]===e)return{node:o,parent:i}
68
+ return Array.isArray(o)?o:[]}function S(r,e,t=n){const i=function r(n,i=null){for(const o of n){if(o[t.id]===e)return{node:o,parent:i}
69
69
  const n=o[t.children]
70
70
  if(Array.isArray(n)&&n.length>0){const e=r(n,o)
71
71
  if(null!==e)return e}}return null}(r)
@@ -75,13 +75,25 @@ const o=i.parent[t.children]
75
75
  return Array.isArray(o)?o:[]}function v(r,e,t=n){return function r(n,i=null){for(const o of n){if(o[t.id]===e)return i
76
76
  const n=o[t.children]
77
77
  if(Array.isArray(n)&&n.length>0){const e=r(n,o)
78
- if(null!==e)return e}}return null}(r)}function x(r,e,t=n){for(const n of r){if(n[t.id]===e)return!0
78
+ if(null!==e)return e}}return null}(r)}function b(r,e,t=n){for(const n of r){if(n[t.id]===e)return!0
79
79
  const r=n[t.children]
80
- if(Array.isArray(r)&&r.length>0&&x(r,e,t))return!0}return!1}function E(r,e=n){if(!r||"object"!=typeof r||Array.isArray(r))return!1
80
+ if(Array.isArray(r)&&r.length>0&&b(r,e,t))return!0}return!1}function x(r,e=n){if(!r||"object"!=typeof r||Array.isArray(r))return!1
81
81
  const t=r[e.children]
82
82
  if(void 0!==t){if(null===t)return!1
83
83
  if(!Array.isArray(t))return!1
84
- for(const r of t)if(!E(r,e))return!1}return!0}function O(r,e=n){if(!Array.isArray(r))return!1
85
- for(const n of r)if(!E(n,e))return!1
86
- return!0}const M={mapTree:e,filterTree:t,findTree:i,pushTree:o,unshiftTree:u,popTree:f,shiftTree:c,someTree:l,everyTree:s,atTree:a,indexOfTree:h,atIndexOfTree:d,getNodeDepthMap:y,getNodeDepth:A,dedupTree:g,removeTree:T,forEachTree:p,isEmptyTreeData:m,isEmptySingleTreeData:D,getParentTree:v,getChildrenTree:S,getSiblingsTree:b,includesTree:x,isSingleTreeData:E,isTreeData:O}
87
- r.atIndexOfTree=d,r.atTree=a,r.dedupTree=g,r.default=M,r.everyTree=s,r.filterTree=t,r.findTree=i,r.forEachTree=p,r.getChildrenTree=S,r.getNodeDepth=A,r.getNodeDepthMap=y,r.getParentTree=v,r.getSiblingsTree=b,r.includesTree=x,r.indexOfTree=h,r.isEmptySingleTreeData=D,r.isEmptyTreeData=m,r.isSingleTreeData=E,r.isTreeData=O,r.mapTree=e,r.popTree=f,r.pushTree=o,r.removeTree=T,r.shiftTree=c,r.someTree=l,r.unshiftTree=u,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})
84
+ for(const r of t)if(!x(r,e))return!1}return!0}function E(r,e=n){if(!Array.isArray(r))return!1
85
+ for(const n of r)if(!x(n,e))return!1
86
+ return!0}function C(r,e=n){if(!r||"object"!=typeof r||Array.isArray(r))return!1
87
+ const t=r[e.children]
88
+ return void 0===t||Array.isArray(t)}function j(r,e=n,t=new WeakSet){if(!r||"object"!=typeof r||Array.isArray(r))return!1
89
+ if(t.has(r))return!1
90
+ t.add(r)
91
+ const i=r[e.children]
92
+ if(void 0!==i){if(null===i)return!1
93
+ if(!Array.isArray(i))return!1
94
+ for(const r of i)if(!j(r,e,t))return!1}return!0}function O(r,e,t=n){if(e<=0)return!1
95
+ return function r(n,i){if(i>e)return!1
96
+ for(const e of n){const n=e[t.children]
97
+ if(Array.isArray(n)&&n.length>0&&!r(n,i+1))return!1}return!0}(r,1)}function M(r,e=n){const t=r[e.children]
98
+ return void 0===t||!Array.isArray(t)||0===t.length}function P(r,e,t=n){return!!b(r,e,t)&&null===v(r,e,t)}const k={mapTree:e,filterTree:t,findTree:i,pushTree:o,unshiftTree:f,popTree:u,shiftTree:c,someTree:s,everyTree:l,atTree:a,indexOfTree:h,atIndexOfTree:d,getNodeDepthMap:y,getNodeDepth:A,dedupTree:T,removeTree:g,forEachTree:p,isEmptyTreeData:D,isEmptySingleTreeData:m,getParentTree:v,getChildrenTree:N,getSiblingsTree:S,includesTree:b,isSingleTreeData:x,isTreeData:E,isValidTreeNode:C,isTreeNodeWithCircularCheck:j,isSafeTreeDepth:O,isLeafNode:M,isRootNode:P}
99
+ r.atIndexOfTree=d,r.atTree=a,r.dedupTree=T,r.default=k,r.everyTree=l,r.filterTree=t,r.findTree=i,r.forEachTree=p,r.getChildrenTree=N,r.getNodeDepth=A,r.getNodeDepthMap=y,r.getParentTree=v,r.getSiblingsTree=S,r.includesTree=b,r.indexOfTree=h,r.isEmptySingleTreeData=m,r.isEmptyTreeData=D,r.isLeafNode=M,r.isRootNode=P,r.isSafeTreeDepth=O,r.isSingleTreeData=x,r.isTreeData=E,r.isTreeNodeWithCircularCheck=j,r.isValidTreeNode=C,r.mapTree=e,r.popTree=u,r.pushTree=o,r.removeTree=g,r.shiftTree=c,r.someTree=s,r.unshiftTree=f,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-processor",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "A lightweight TypeScript library for processing tree-structured data with comprehensive methods (map, filter, find, push, pop, remove, getParent, includes, etc.), supporting tree-shaking and custom field names",
5
5
  "main": "dist/tree-processor.cjs.js",
6
6
  "module": "dist/tree-processor.esm.js",
@@ -42,7 +42,16 @@
42
42
  "every",
43
43
  "at",
44
44
  "indexOf",
45
+ "depth",
45
46
  "deduplicate",
47
+ "menu",
48
+ "navigation",
49
+ "file-tree",
50
+ "directory",
51
+ "category",
52
+ "comment",
53
+ "permission",
54
+ "tree-select",
46
55
  "tree-processor"
47
56
  ],
48
57
  "author": "",