Skip to content

Commit

Permalink
fix(types): reduce accumulator type when no initial value is given
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Jan 26, 2025
1 parent e1768b5 commit 7a14bf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/async/reduce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function reduce<T, K>(
): Promise<K>
export async function reduce<T, K>(
array: readonly T[],
reducer: (acc: K, item: T, index: number) => Promise<K>,
reducer: (acc: T | K, item: T, index: number) => Promise<K>,
): Promise<K>
export async function reduce<T, K>(
array: readonly T[],
Expand Down

0 comments on commit 7a14bf6

Please sign in to comment.