Skip to content

Commit

Permalink
fix(getExtendedNodes): parentNode is null in first iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
rwieruch committed Aug 31, 2022
1 parent 07c9cb5 commit 16fee62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/util/tree/getExtendedNodes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TableNode } from '@table-library/react-table-library/types/table';

export const getExtendedNodes = (nodes: TableNode[], parentNode: TableNode): TableNode[] => {
export const getExtendedNodes = (nodes: TableNode[], parentNode: TableNode | null): TableNode[] => {
const extendedNodes = nodes.map((node) => ({
...node,
ancestors: parentNode ? parentNode.ancestors.concat(node) : [node],
Expand Down

0 comments on commit 16fee62

Please sign in to comment.