Skip to content

Commit cf3f508

Browse files
committed
Update return type
1 parent 7afffd0 commit cf3f508

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/node_modules/@stdlib/array/from-iterator/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type MapFunction = Nullary | Unary | Binary;
7777
* var arr = iterator2array( iter );
7878
* // returns <Array>
7979
*/
80-
declare function iterator2array( iterator: Iterator, mapFcn?: MapFunction, thisArg?: any ): Collection; // tslint:disable-line:max-line-length
80+
declare function iterator2array( iterator: Iterator, mapFcn?: MapFunction, thisArg?: any ): Array<any>; // tslint:disable-line:max-line-length
8181

8282
/**
8383
* Creates (or fills) an array from an iterator.

lib/node_modules/@stdlib/array/from-iterator/docs/types/test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ function times10( v: number ): number {
3535
// The function returns an iterator...
3636
{
3737
const iter = randu();
38-
iterator2array( iter ); // $ExpectType Collection
39-
iterator2array( iter, times10 ); // $ExpectType Collection
40-
iterator2array( iter, times10, {} ); // $ExpectType Collection
38+
iterator2array( iter ); // $ExpectType any[]
39+
// iterator2array( iter, times10 ); // $ExpectType any[] => fails in older TypeScript versions
40+
iterator2array( iter, times10, {} ); // $ExpectType any[]
41+
4142
const out = new Float64Array( 10 );
4243
iterator2array( iter, out ); // $ExpectType Collection
4344
iterator2array( iter, out, times10 ); // $ExpectType Collection

0 commit comments

Comments
 (0)