Skip to content

Commit

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

export const hasLeaves = (node: TableNode) => !!node.nodes?.length;
export const hasLeaves = <T extends TableNode>(node: T): boolean => !!node.nodes?.length;
2 changes: 1 addition & 1 deletion src/common/util/tree/isLeaf.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { TableNode } from '@table-library/react-table-library/types/table';

export const isLeaf = (node: TableNode) => !node.nodes;
export const isLeaf = <T extends TableNode>(node: T): boolean => !node.nodes;

0 comments on commit 75d4193

Please sign in to comment.