Skip to content

Commit a1575d1

Browse files
author
Paul Vallis
committed
Add missing jsdoc
1 parent ffbb119 commit a1575d1

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/utils/tree-data-utils.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function getNodeDataAtTreeIndexOrNextIndex({
6060
export function getDescendantCount({ node, ignoreCollapsed = true }) {
6161
return (
6262
getNodeDataAtTreeIndexOrNextIndex({
63-
getNodeKey: () => {},
63+
getNodeKey: () => { },
6464
ignoreCollapsed,
6565
node,
6666
currentIndex: 0,
@@ -106,12 +106,12 @@ function walkDescendants({
106106
const selfInfo = isPseudoRoot
107107
? null
108108
: {
109-
node,
110-
parentNode,
111-
path: selfPath,
112-
lowerSiblingCounts,
113-
treeIndex: currentIndex,
114-
};
109+
node,
110+
parentNode,
111+
path: selfPath,
112+
lowerSiblingCounts,
113+
treeIndex: currentIndex,
114+
};
115115

116116
if (!isPseudoRoot) {
117117
const callbackResult = callback(selfInfo);
@@ -604,6 +604,7 @@ export function getNodeAtPath({
604604
* @param {!function} getNodeKey - Function to get the key from the nodeData and tree index
605605
* @param {boolean=} ignoreCollapsed - Ignore children of nodes without `expanded` set to `true`
606606
* @param {boolean=} expandParent - If true, expands the parentNode specified by parentPath
607+
* @param {boolean=} addAsFirstChild - If true, adds new node as first child of tree
607608
*
608609
* @return {Object} result
609610
* @return {Object[]} result.treeData - The updated tree data
@@ -670,7 +671,7 @@ export function addNodeUnderParent({
670671
insertedTreeIndex = nextTreeIndex;
671672

672673
const children = addAsFirstChild
673-
? [ newNode, ...parentNode.children]
674+
? [newNode, ...parentNode.children]
674675
: [...parentNode.children, newNode];
675676

676677
return {
@@ -885,7 +886,7 @@ export function insertNode({
885886
depth: targetDepth,
886887
minimumTreeIndex,
887888
newNode,
888-
getNodeKey = () => {},
889+
getNodeKey = () => { },
889890
ignoreCollapsed = true,
890891
expandParent = false,
891892
}) {
@@ -1093,9 +1094,9 @@ export function find({
10931094
const extraInfo = isPseudoRoot
10941095
? null
10951096
: {
1096-
path: selfPath,
1097-
treeIndex: currentIndex,
1098-
};
1097+
path: selfPath,
1098+
treeIndex: currentIndex,
1099+
};
10991100

11001101
// Nodes with with children that aren't lazy
11011102
const hasChildren =

0 commit comments

Comments
 (0)