Explorar o código

style(tree): children拼写错误

vian %!s(int64=5) %!d(string=hai) anos
pai
achega
10193884f4
Modificáronse 2 ficheiros con 3 adicións e 3 borrados
  1. 2 2
      tree/src/tree.ts
  2. 1 1
      tree/tests/nodeCtx.ts

+ 2 - 2
tree/src/tree.ts

@@ -194,7 +194,7 @@ export class Tree {
   }
 
   // 查询ID节点的子节点
-  findChilren(ID: string): TreeNode[] {
+  findChildren(ID: string): TreeNode[] {
     return this.parentMap[ID] || [];
   }
 
@@ -217,7 +217,7 @@ export class Tree {
         if (includeSelf || !treeNodes.includes(node)) {
           rst.push(node);
         }
-        const children = this.findChilren(node.ID);
+        const children = this.findChildren(node.ID);
         if (children.length) {
           pushNodes(children);
         }

+ 1 - 1
tree/tests/nodeCtx.ts

@@ -91,7 +91,7 @@ describe('NodeCtx', () => {
   it('children', () => {
     const node = tree.find('1');
     if (node) {
-      const children = node.getCtx().chilren();
+      const children = node.getCtx().children();
       const IDList = getIDList(children);
       expect(IDList).to.have.ordered.members(['7', '6']);
     }