File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
lib/node_modules/@stdlib/array/from-iterator/docs/types Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments