Skip to content

Commit

Permalink
fix for addIndex(forEach) use case
Browse files Browse the repository at this point in the history
  • Loading branch information
Harris-Miller committed Apr 2, 2024
1 parent 486f393 commit 3b0e504
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions types/forEach.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ import { Placeholder } from './util/tools';
export function forEach<T>(fn: (x: T) => void): <U extends readonly T[]>(list: U) => U;
export function forEach<U extends readonly any[]>(__: Placeholder, list: U): (fn: (x: U extends readonly (infer T)[] ? T : never) => void) => U;
export function forEach<U extends readonly any[]>(fn: (x: U extends readonly (infer T)[] ? T : never) => void, list: U): U;
// this last one is for addIndex(forEach)
export function forEach<T>(fn: (item: T) => void, list: readonly T[]): T[];

0 comments on commit 3b0e504

Please sign in to comment.