Skip to content

Commit fc88a1c

Browse files
Don't use any[] in arrayFrom (#31201)
Don't use `any[]` in `arrayFrom`
2 parents 66d4010 + b5ffc26 commit fc88a1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/core.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,8 +1400,8 @@ namespace ts {
14001400
/** Shims `Array.from`. */
14011401
export function arrayFrom<T, U>(iterator: Iterator<T> | IterableIterator<T>, map: (t: T) => U): U[];
14021402
export function arrayFrom<T>(iterator: Iterator<T> | IterableIterator<T>): T[];
1403-
export function arrayFrom(iterator: Iterator<any> | IterableIterator<any>, map?: (t: any) => any): any[] {
1404-
const result: any[] = [];
1403+
export function arrayFrom<T, U>(iterator: Iterator<T> | IterableIterator<T>, map?: (t: T) => U): (T | U)[] {
1404+
const result: (T | U)[] = [];
14051405
for (let { value, done } = iterator.next(); !done; { value, done } = iterator.next()) {
14061406
result.push(map ? map(value) : value);
14071407
}

0 commit comments

Comments
 (0)