Skip to content

Commit aae1ab1

Browse files
committed
types: fix inference bug with "each" helper
1 parent e5cf72c commit aae1ab1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/shared/src/helpers.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ export const isAnimatedString = (value: unknown): value is string =>
4343
!!(G.colorNames && G.colorNames[value]))
4444

4545
interface EachFn {
46+
<T = any, This = any>(
47+
arr: readonly T[],
48+
cb: (this: This, value: T, index: number) => void,
49+
ctx?: This
50+
): void
51+
4652
<T = any, This = any>(
4753
obj: ReadonlySet<T> | readonly T[],
4854
cb: (this: This, value: T) => void,
@@ -55,12 +61,6 @@ interface EachFn {
5561
ctx?: This
5662
): void
5763

58-
<T = any, This = any>(
59-
arr: readonly T[],
60-
cb: (this: This, value: T, index: number) => void,
61-
ctx?: This
62-
): void
63-
6464
<T extends Indexable = any, This = any>(
6565
obj: T,
6666
cb: (this: This, value: T[keyof T], key: keyof T) => void,

0 commit comments

Comments
 (0)