Skip to content

Commit

Permalink
fix: callback should be optional on first() and last()
Browse files Browse the repository at this point in the history
  • Loading branch information
laurence79 committed Jan 17, 2025
1 parent b28529a commit c1cc968
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/extensions/first/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ declare global {
* @returns The first element where the callback returned true, or
* `undefined`
*/
first(callback: Callback<T, boolean>): T | undefined;
first(callback?: Callback<T, boolean>): T | undefined;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/extensions/last/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ declare global {
* @returns The last element where the callback returned true, or if none
* do then `undefined`
*/
last(callback: Callback<T, boolean>): T | undefined;
last(callback?: Callback<T, boolean>): T | undefined;
}
}

Expand Down

0 comments on commit c1cc968

Please sign in to comment.