Skip to content

Commit

Permalink
fix(hasLeaves): allow null
Browse files Browse the repository at this point in the history
  • Loading branch information
rwieruch committed Aug 31, 2022
1 parent 62ccc17 commit d82d049
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/util/tree/hasLeaves.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Nullish } from '@table-library/react-table-library/types/common';
import { TableNode } from '@table-library/react-table-library/types/table';

export const hasLeaves = <T extends TableNode>(node?: T): boolean => !!node?.nodes?.length;
export const hasLeaves = <T extends TableNode>(node: T | Nullish): boolean => !!node?.nodes?.length;

0 comments on commit d82d049

Please sign in to comment.