Skip to content

Commit 36b3b57

Browse files
authored
refactor: apply suggestions from code review
Signed-off-by: Muhammad Haris <[email protected]>
1 parent 158be7b commit 36b3b57

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/node_modules/@stdlib/blas/ext/base/gcusumors/docs/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { NumericArray, Collection, AccessorArrayLike } from '@stdlib/types/array
2828
type InputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
2929

3030
/**
31-
* Input array.
31+
* Output array.
3232
*/
3333
type OutputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
3434

@@ -54,7 +54,7 @@ interface Routine {
5454
* gcusumors( x.length, 0.0, x, 1, y, 1 );
5555
* // y => [ 1.0, -1.0, 1.0 ]
5656
*/
57-
( N: number, sum: number, x: InputArray, strideX: number, y: OutputArray, strideY: number ): OutputArray;
57+
<T extends OutputArray>( N: number, sum: number, x: InputArray, strideX: number, y: T, strideY: number ): T;
5858

5959
/**
6060
* Computes the cumulative sum of strided array elements using ordinary recursive summation and alternative indexing semantics.
@@ -76,7 +76,7 @@ interface Routine {
7676
* gcusumors.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 );
7777
* // y => [ 1.0, -1.0, 1.0 ]
7878
*/
79-
ndarray( N: number, sum: number, x: InputArray, strideX: number, offsetX: number, y: OutputArray, strideY: number, offsetY: number ): OutputArray;
79+
ndarray<T extends OutputArray>( N: number, sum: number, x: InputArray, strideX: number, offsetX: number, y: T, strideY: number, offsetY: number ): T;
8080
}
8181

8282
/**

lib/node_modules/@stdlib/blas/ext/base/gcusumors/docs/types/test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import gcusumors = require( './index' );
2727
const x = new Float64Array( 10 );
2828
const y = new Float64Array( 10 );
2929

30-
gcusumors( x.length, 0.0, x, 1, y, 1 ); // $ExpectType OutputArray
31-
gcusumors( x.length, 0.0, new AccessorArray( x ), 1, new AccessorArray( y ), 1 ); // $ExpectType OutputArray
30+
gcusumors( x.length, 0.0, x, 1, y, 1 ); // $ExpectType Float64Array
31+
gcusumors( x.length, 0.0, new AccessorArray( x ), 1, new AccessorArray( y ), 1 ); // $ExpectType AccessorArray
3232
}
3333

3434
// The compiler throws an error if the function is provided a first argument which is not a number...
@@ -141,8 +141,8 @@ import gcusumors = require( './index' );
141141
const x = new Float64Array( 10 );
142142
const y = new Float64Array( 10 );
143143

144-
gcusumors.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // $ExpectType OutputArray
145-
gcusumors.ndarray( x.length, 0.0, new AccessorArray( x ), 1, 0, new AccessorArray( y ), 1, 0 ); // $ExpectType OutputArray
144+
gcusumors.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 ); // $ExpectType Float64Array
145+
gcusumors.ndarray( x.length, 0.0, new AccessorArray( x ), 1, 0, new AccessorArray( y ), 1, 0 ); // $ExpectType AccessorArray
146146
}
147147

148148
// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...

0 commit comments

Comments
 (0)