Skip to content

Commit 79e81bc

Browse files
committed
refactor: typescript
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent d197725 commit 79e81bc

6 files changed

Lines changed: 172 additions & 78 deletions

File tree

lib/node_modules/@stdlib/ndarray/to-filled-slice/README.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,23 @@ Returns a new [`ndarray`][@stdlib/ndarray/ctor] with a specified slice region fi
4343
<!-- eslint-disable max-len -->
4444

4545
```javascript
46-
var array = require( '@stdlib/ndarray/array' );
46+
var zeros = require( '@stdlib/ndarray/zeros' );
4747
var MultiSlice = require( '@stdlib/slice/multi' );
4848
var Slice = require( '@stdlib/slice/ctor' );
4949

50-
var x = array( [ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ] );
51-
// returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ]
50+
var x = zeros( [ 3, 4 ], {
51+
'dtype': 'float64'
52+
});
53+
// returns <ndarray>[ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ]
5254

53-
// Define the fill region:
54-
var s0 = new Slice( 1, 3 );
55-
var s1 = new Slice( 2, 4 );
55+
// Define an interior fill region:
56+
var s0 = new Slice( 1, 2 );
57+
var s1 = new Slice( 1, 3 );
5658
var s = new MultiSlice( s0, s1 );
5759

5860
// Fill the region with a scalar value:
59-
var y = toFilledSlice( x, 0.0, s );
60-
// returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 0.0, 0.0 ], [ 9.0, 10.0, 0.0, 0.0 ] ]
61+
var y = toFilledSlice( x, 9.0, s );
62+
// returns <ndarray>[ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 9.0, 9.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ]
6163

6264
var bool = ( y === x );
6365
// returns false
@@ -81,28 +83,30 @@ The following example demonstrates each invocation style achieving equivalent re
8183
<!-- eslint-disable max-len -->
8284

8385
```javascript
84-
var array = require( '@stdlib/ndarray/array' );
86+
var zeros = require( '@stdlib/ndarray/zeros' );
8587
var MultiSlice = require( '@stdlib/slice/multi' );
8688
var Slice = require( '@stdlib/slice/ctor' );
8789

88-
var s0 = new Slice( 1, 3 );
89-
var s1 = new Slice( 2, 4 );
90+
var s0 = new Slice( 1, 2 );
91+
var s1 = new Slice( 1, 3 );
9092
var s = new MultiSlice( s0, s1 );
9193

9294
// 1. Using a MultiSlice:
93-
var x = array( [ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ] );
94-
// returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ]
95+
var x = zeros( [ 3, 4 ], {
96+
'dtype': 'float64'
97+
});
98+
// returns <ndarray>[ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ]
9599

96-
var out = toFilledSlice( x, 0.0, s );
97-
// returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 0.0, 0.0 ], [ 9.0, 10.0, 0.0, 0.0 ] ]
100+
var out = toFilledSlice( x, 9.0, s );
101+
// returns <ndarray>[ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 9.0, 9.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ]
98102

99103
// 2. Using an array of slice arguments:
100-
out = toFilledSlice( x, 0.0, [ s0, s1 ] );
101-
// returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 0.0, 0.0 ], [ 9.0, 10.0, 0.0, 0.0 ] ]
104+
out = toFilledSlice( x, 9.0, [ s0, s1 ] );
105+
// returns <ndarray>[ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 9.0, 9.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ]
102106

103107
// 3. Providing separate arguments:
104-
out = toFilledSlice( x, 0.0, s0, s1 );
105-
// returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 0.0, 0.0 ], [ 9.0, 10.0, 0.0, 0.0 ] ]
108+
out = toFilledSlice( x, 9.0, s0, s1 );
109+
// returns <ndarray>[ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 9.0, 9.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ]
106110
```
107111

108112
The function supports the following options:
@@ -114,23 +118,25 @@ By default, the function throws an error when provided a slice which exceeds arr
114118
<!-- eslint-disable max-len -->
115119

116120
```javascript
117-
var array = require( '@stdlib/ndarray/array' );
121+
var zeros = require( '@stdlib/ndarray/zeros' );
118122
var MultiSlice = require( '@stdlib/slice/multi' );
119123
var Slice = require( '@stdlib/slice/ctor' );
120124

121-
var x = array( [ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ] );
122-
// returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ]
125+
var x = zeros( [ 3, 4 ], {
126+
'dtype': 'float64'
127+
});
128+
// returns <ndarray>[ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ]
123129

124130
// Define the fill region:
125131
var s0 = new Slice( 1, null, 1 );
126132
var s1 = new Slice( 10, 20, 1 );
127133
var s = new MultiSlice( s0, s1 );
128134

129135
// Return a copy of `x` (out-of-bounds slice is ignored):
130-
var y = toFilledSlice( x, 0.0, s, {
136+
var y = toFilledSlice( x, 9.0, s, {
131137
'strict': false
132138
});
133-
// returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ]
139+
// returns <ndarray>[ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ]
134140
```
135141

136142
</section>

lib/node_modules/@stdlib/ndarray/to-filled-slice/docs/repl.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
objects or providing an array of slice arguments followed by additional
2727
slice arguments) is not supported.
2828

29+
If a fill value is a number and `x` has a complex data type, the function
30+
fills the specified region with a complex number whose real component
31+
equals the provided fill value and whose imaginary component is zero.
32+
2933
Parameters
3034
----------
3135
x: ndarray

lib/node_modules/@stdlib/ndarray/to-filled-slice/docs/types/index.d.ts

Lines changed: 115 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@
1616
* limitations under the License.
1717
*/
1818

19+
/* eslint-disable max-lines */
20+
1921
// TypeScript Version: 4.1
2022

2123
/// <reference types="@stdlib/types"/>
2224

23-
import { typedndarray, genericndarray } from '@stdlib/types/ndarray';
25+
import { typedndarray, genericndarray, complexndarray } from '@stdlib/types/ndarray';
2426
import { MultiSlice, Slice } from '@stdlib/types/slice';
27+
import { ComplexLike } from '@stdlib/types/complex';
2528

2629
/**
2730
* Interface defining function options.
@@ -38,6 +41,75 @@ interface Options {
3841
*/
3942
type SliceArgument = Slice | number | null | undefined;
4043

44+
/**
45+
* Typed ndarray element.
46+
*/
47+
type Element<U> = U extends typedndarray<infer T> ? T : never;
48+
49+
/**
50+
* Returns a new ndarray with a specified slice region filled with a provided value.
51+
*
52+
* @param x - input ndarray
53+
* @param value - fill value
54+
* @param s - slice argument
55+
* @param options - function options
56+
* @param options.strict - boolean indicating whether to enforce strict bounds checking
57+
* @returns output ndarray
58+
*
59+
* @example
60+
* var zeros = require( '@stdlib/ndarray/zeros' );
61+
* var MultiSlice = require( '@stdlib/slice/multi' );
62+
* var Slice = require( '@stdlib/slice/ctor' );
63+
*
64+
* var x = zeros( [ 2, 2 ], {
65+
* 'dtype': 'complex128'
66+
* });
67+
* // returns <ndarray>[ [ <Complex128>[ 0.0, 0.0 ], <Complex128>[ 0.0, 0.0 ] ], [ <Complex128>[ 0.0, 0.0 ], <Complex128>[ 0.0, 0.0 ] ] ]
68+
*
69+
* // Define a single-cell fill region:
70+
* var s0 = new Slice( 0, 1 );
71+
* var s1 = new Slice( 1, 2 );
72+
* var s = new MultiSlice( s0, s1 );
73+
*
74+
* // Fill the region with a scalar value:
75+
* var y = toFilledSlice( x, 9.0, s );
76+
* // returns <ndarray>[ [ <Complex128>[ 0.0, 0.0 ], <Complex128>[ 9.0, 0.0 ] ], [ <Complex128>[ 0.0, 0.0 ], <Complex128>[ 0.0, 0.0 ] ] ]
77+
*
78+
* var bool = ( y === x );
79+
* // returns false
80+
*/
81+
declare function toFilledSlice<T extends complexndarray>( x: T, value: number | ComplexLike, s: MultiSlice | ArrayLike<SliceArgument>, options?: Options ): T;
82+
83+
/**
84+
* Returns a new ndarray with a specified slice region filled with a provided value.
85+
*
86+
* @param x - input ndarray
87+
* @param value - fill value
88+
* @param args - slice and option arguments
89+
* @returns output ndarray
90+
*
91+
* @example
92+
* var zeros = require( '@stdlib/ndarray/zeros' );
93+
* var Slice = require( '@stdlib/slice/ctor' );
94+
*
95+
* var x = zeros( [ 2, 2 ], {
96+
* 'dtype': 'complex128'
97+
* });
98+
* // returns <ndarray>[ [ <Complex128>[ 0.0, 0.0 ], <Complex128>[ 0.0, 0.0 ] ], [ <Complex128>[ 0.0, 0.0 ], <Complex128>[ 0.0, 0.0 ] ] ]
99+
*
100+
* // Define a single-cell fill region:
101+
* var s0 = new Slice( 0, 1 );
102+
* var s1 = new Slice( 1, 2 );
103+
*
104+
* // Fill the region with a scalar value:
105+
* var y = toFilledSlice( x, 9.0, s0, s1 );
106+
* // returns <ndarray>[ [ <Complex128>[ 0.0, 0.0 ], <Complex128>[ 9.0, 0.0 ] ], [ <Complex128>[ 0.0, 0.0 ], <Complex128>[ 0.0, 0.0 ] ] ]
107+
*
108+
* var bool = ( y === x );
109+
* // returns false
110+
*/
111+
declare function toFilledSlice<T extends complexndarray>( x: T, value: number | ComplexLike, ...args: Array<SliceArgument | Options> ): T;
112+
41113
/**
42114
* Returns a new ndarray with a specified slice region filled with a provided value.
43115
*
@@ -49,26 +121,28 @@ type SliceArgument = Slice | number | null | undefined;
49121
* @returns output ndarray
50122
*
51123
* @example
52-
* var array = require( '@stdlib/ndarray/array' );
124+
* var zeros = require( '@stdlib/ndarray/zeros' );
53125
* var MultiSlice = require( '@stdlib/slice/multi' );
54126
* var Slice = require( '@stdlib/slice/ctor' );
55127
*
56-
* var x = array( [ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ] );
57-
* // returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ]
128+
* var x = zeros( [ 3, 4 ], {
129+
* 'dtype': 'float64'
130+
* });
131+
* // returns <ndarray>[ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ]
58132
*
59-
* // Define the fill region:
60-
* var s0 = new Slice( 1, 3 );
61-
* var s1 = new Slice( 2, 4 );
133+
* // Define an interior fill region:
134+
* var s0 = new Slice( 1, 2 );
135+
* var s1 = new Slice( 1, 3 );
62136
* var s = new MultiSlice( s0, s1 );
63137
*
64138
* // Fill the region with a scalar value:
65-
* var y = toFilledSlice( x, 0.0, s );
66-
* // returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 0.0, 0.0 ], [ 9.0, 10.0, 0.0, 0.0 ] ]
139+
* var y = toFilledSlice( x, 9.0, s );
140+
* // returns <ndarray>[ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 9.0, 9.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ]
67141
*
68142
* var bool = ( y === x );
69143
* // returns false
70144
*/
71-
declare function toFilledSlice<T = unknown, U extends typedndarray<T> = typedndarray<T>>( x: U, value: T | number, s: MultiSlice | ArrayLike<SliceArgument>, options?: Options ): U;
145+
declare function toFilledSlice<T = unknown, U extends typedndarray<T> = typedndarray<T>>( x: U, value: Element<U>, s: MultiSlice | ArrayLike<SliceArgument>, options?: Options ): U;
72146

73147
/**
74148
* Returns a new ndarray with a specified slice region filled with a provided value.
@@ -79,24 +153,26 @@ declare function toFilledSlice<T = unknown, U extends typedndarray<T> = typednda
79153
* @returns output ndarray
80154
*
81155
* @example
82-
* var array = require( '@stdlib/ndarray/array' );
156+
* var zeros = require( '@stdlib/ndarray/zeros' );
83157
* var Slice = require( '@stdlib/slice/ctor' );
84158
*
85-
* var x = array( [ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ] );
86-
* // returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ]
159+
* var x = zeros( [ 3, 4 ], {
160+
* 'dtype': 'float64'
161+
* });
162+
* // returns <ndarray>[ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ]
87163
*
88-
* // Define the fill region:
89-
* var s0 = new Slice( 1, 3 );
90-
* var s1 = new Slice( 2, 4 );
164+
* // Define an interior fill region:
165+
* var s0 = new Slice( 1, 2 );
166+
* var s1 = new Slice( 1, 3 );
91167
*
92168
* // Fill the region with a scalar value:
93-
* var y = toFilledSlice( x, 0.0, s0, s1 );
94-
* // returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 0.0, 0.0 ], [ 9.0, 10.0, 0.0, 0.0 ] ]
169+
* var y = toFilledSlice( x, 9.0, s0, s1 );
170+
* // returns <ndarray>[ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 9.0, 9.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ]
95171
*
96172
* var bool = ( y === x );
97173
* // returns false
98174
*/
99-
declare function toFilledSlice<T = unknown, U extends typedndarray<T> = typedndarray<T>>( x: U, value: T | number, ...args: Array<SliceArgument | Options> ): U;
175+
declare function toFilledSlice<T = unknown, U extends typedndarray<T> = typedndarray<T>>( x: U, value: Element<U>, ...args: Array<SliceArgument | Options> ): U;
100176

101177
/**
102178
* Returns a new ndarray with a specified slice region filled with a provided value.
@@ -109,21 +185,23 @@ declare function toFilledSlice<T = unknown, U extends typedndarray<T> = typednda
109185
* @returns output ndarray
110186
*
111187
* @example
112-
* var array = require( '@stdlib/ndarray/array' );
188+
* var zeros = require( '@stdlib/ndarray/zeros' );
113189
* var MultiSlice = require( '@stdlib/slice/multi' );
114190
* var Slice = require( '@stdlib/slice/ctor' );
115191
*
116-
* var x = array( [ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ] );
117-
* // returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ]
192+
* var x = zeros( [ 3, 4 ], {
193+
* 'dtype': 'generic'
194+
* });
195+
* // returns <ndarray>[ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ]
118196
*
119-
* // Define the fill region:
120-
* var s0 = new Slice( 1, 3 );
121-
* var s1 = new Slice( 2, 4 );
197+
* // Define an interior fill region:
198+
* var s0 = new Slice( 1, 2 );
199+
* var s1 = new Slice( 1, 3 );
122200
* var s = new MultiSlice( s0, s1 );
123201
*
124202
* // Fill the region with a scalar value:
125-
* var y = toFilledSlice( x, 0.0, s );
126-
* // returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 0.0, 0.0 ], [ 9.0, 10.0, 0.0, 0.0 ] ]
203+
* var y = toFilledSlice( x, 9, s );
204+
* // returns <ndarray>[ [ 0, 0, 0, 0 ], [ 0, 9, 9, 0 ], [ 0, 0, 0, 0 ] ]
127205
*
128206
* var bool = ( y === x );
129207
* // returns false
@@ -139,19 +217,21 @@ declare function toFilledSlice<T = unknown, U = unknown>( x: genericndarray<T>,
139217
* @returns output ndarray
140218
*
141219
* @example
142-
* var array = require( '@stdlib/ndarray/array' );
220+
* var zeros = require( '@stdlib/ndarray/zeros' );
143221
* var Slice = require( '@stdlib/slice/ctor' );
144222
*
145-
* var x = array( [ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ] );
146-
* // returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 7.0, 8.0 ], [ 9.0, 10.0, 11.0, 12.0 ] ]
223+
* var x = zeros( [ 3, 4 ], {
224+
* 'dtype': 'generic'
225+
* });
226+
* // returns <ndarray>[ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ]
147227
*
148-
* // Define the fill region:
149-
* var s0 = new Slice( 1, 3 );
150-
* var s1 = new Slice( 2, 4 );
228+
* // Define an interior fill region:
229+
* var s0 = new Slice( 1, 2 );
230+
* var s1 = new Slice( 1, 3 );
151231
*
152232
* // Fill the region with a scalar value:
153-
* var y = toFilledSlice( x, 0.0, s0, s1 );
154-
* // returns <ndarray>[ [ 1.0, 2.0, 3.0, 4.0 ], [ 5.0, 6.0, 0.0, 0.0 ], [ 9.0, 10.0, 0.0, 0.0 ] ]
233+
* var y = toFilledSlice( x, 9, s0, s1 );
234+
* // returns <ndarray>[ [ 0, 0, 0, 0 ], [ 0, 9, 9, 0 ], [ 0, 0, 0, 0 ] ]
155235
*
156236
* var bool = ( y === x );
157237
* // returns false

lib/node_modules/@stdlib/ndarray/to-filled-slice/docs/types/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import toFilledSlice = require( './index' );
4444
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'uint16' } ), 10.0, s ); // $ExpectType uint16ndarray
4545
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'uint8' } ), 10.0, s ); // $ExpectType uint8ndarray
4646
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'uint8c' } ), 10.0, s ); // $ExpectType uint8cndarray
47-
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'generic' } ), 10.0, s ); // $ExpectType genericndarray<unknown>
47+
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'generic' } ), 10.0, s ); // $ExpectType genericndarray<number>
4848

4949
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'float64' } ), 10.0, s, { 'strict': false } ); // $ExpectType float64ndarray
5050
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'float32' } ), 10.0, s, { 'strict': false } ); // $ExpectType float32ndarray
@@ -57,7 +57,7 @@ import toFilledSlice = require( './index' );
5757
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'uint16' } ), 10.0, s, { 'strict': false } ); // $ExpectType uint16ndarray
5858
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'uint8' } ), 10.0, s, { 'strict': false } ); // $ExpectType uint8ndarray
5959
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'uint8c' } ), 10.0, s, { 'strict': false } ); // $ExpectType uint8cndarray
60-
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'generic' } ), 10.0, s, { 'strict': false } ); // $ExpectType genericndarray<unknown>
60+
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'generic' } ), 10.0, s, { 'strict': false } ); // $ExpectType genericndarray<number>
6161

6262
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'float64' } ), 10.0, s, { 'strict': true } ); // $ExpectType float64ndarray
6363
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'float32' } ), 10.0, s, { 'strict': true } ); // $ExpectType float32ndarray
@@ -70,7 +70,7 @@ import toFilledSlice = require( './index' );
7070
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'uint16' } ), 10.0, s, { 'strict': true } ); // $ExpectType uint16ndarray
7171
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'uint8' } ), 10.0, s, { 'strict': true } ); // $ExpectType uint8ndarray
7272
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'uint8c' } ), 10.0, s, { 'strict': true } ); // $ExpectType uint8cndarray
73-
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'generic' } ), 10.0, s, { 'strict': true } ); // $ExpectType genericndarray<unknown>
73+
toFilledSlice( zeros( [ 2, 2 ], { 'dtype': 'generic' } ), 10.0, s, { 'strict': true } ); // $ExpectType genericndarray<number>
7474
}
7575

7676
// The compiler throws an error if the function is provided a first argument which is not an ndarray...

0 commit comments

Comments
 (0)