Skip to content

Commit

Permalink
fix: tree.find types error
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangshichun committed Jul 9, 2023
1 parent 1869983 commit 3d6c8b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const breadthImpl: FindImpl<ChildrenKey> = (treeItem, callback, options) => {
options
}
]
const runQueue = () => {
const runQueue = (): Tree | undefined => {
if (queue.length === 0) {
return undefined
}
Expand Down Expand Up @@ -102,7 +102,7 @@ const strategies = {
'breadth': breadthImpl
}

function find<T extends ChildrenKey>(tree: Tree<T> | Tree<T>[], callback , options?: FindOptions): Tree<T> | undefined {
function find<T extends ChildrenKey>(tree: Tree<T> | Tree<T>[], callback: FindCallback<T>, options?: FindOptions): Tree<T> | undefined {
const childrenKey = options?.childrenKey ?? 'children'
const strategy = options?.strategy ?? 'pre'
const method = strategies[strategy]
Expand Down

0 comments on commit 3d6c8b8

Please sign in to comment.