Skip to content

Commit 7f09633

Browse files
committed
Auto-generated commit
1 parent f0194de commit 7f09633

File tree

5 files changed

+22
-21
lines changed

5 files changed

+22
-21
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-06-01)
7+
## Unreleased (2025-06-02)
88

99
<section class="features">
1010

@@ -36,6 +36,9 @@
3636

3737
<details>
3838

39+
- [`9168604`](https://github.com/stdlib-js/stdlib/commit/9168604c1138d438bee5c6856026cc36de35e705) - **refactor:** improve type specificity _(by Athan Reines)_
40+
- [`49952f7`](https://github.com/stdlib-js/stdlib/commit/49952f7b2fbfdad1b20108aab89a34aeab73da48) - **refactor:** improve type specificity _(by Athan Reines)_
41+
- [`d47c5ea`](https://github.com/stdlib-js/stdlib/commit/d47c5eab74c76573c9479de1bc7addf8a97483cb) - **docs:** update example _(by Athan Reines)_
3942
- [`0643a79`](https://github.com/stdlib-js/stdlib/commit/0643a7936cfa4d916eb52b0f4ad89964ceb70560) - **bench:** fix call signatures _(by Athan Reines)_
4043
- [`344834e`](https://github.com/stdlib-js/stdlib/commit/344834ebf6c9102b86aee2c7c45b9e60e8486576) - **refactor:** rename template parameter _(by Athan Reines)_
4144
- [`37070e8`](https://github.com/stdlib-js/stdlib/commit/37070e8d3748ba83f8fcbf41f5a3dc9a4f2bd2a8) - **bench:** refactor value generation _(by Athan Reines)_

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,8 @@ The callback function is provided the following arguments:
163163
<!-- eslint no-undef: "error" -->
164164

165165
```javascript
166-
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' ).factory;
167-
var filledarray = require( '@stdlib/array-filled' );
168-
var filledarrayBy = require( '@stdlib/array-filled-by' );
166+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
167+
var zeros = require( '@stdlib/array-zeros' );
169168
var abs = require( '@stdlib/math-base-special-abs' );
170169
var shape2strides = require( '@stdlib/ndarray-base-shape2strides' );
171170
var ndarray2array = require( '@stdlib/ndarray-base-to-array' );
@@ -175,15 +174,17 @@ var map = require( '@stdlib/ndarray-base-map' );
175174
var N = 10;
176175
var x = {
177176
'dtype': 'generic',
178-
'data': filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ),
177+
'data': discreteUniform( N, -100, 100, {
178+
'dtype': 'generic'
179+
}),
179180
'shape': [ 5, 2 ],
180181
'strides': [ 2, 1 ],
181182
'offset': 0,
182183
'order': 'row-major'
183184
};
184185
var y = {
185186
'dtype': 'generic',
186-
'data': filledarray( 0, N, 'generic' ),
187+
'data': zeros( N, 'generic' ),
187188
'shape': x.shape.slice(),
188189
'strides': shape2strides( x.shape, 'column-major' ),
189190
'offset': 0,

docs/types/index.d.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,22 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { ArrayLike } from '@stdlib/types/array';
2423
import { typedndarray } from '@stdlib/types/ndarray';
2524

2625
/**
2726
* Callback invoked for each ndarray element.
2827
*
2928
* @returns output value
3029
*/
31-
type Nullary<U, ThisArg> = ( this: ThisArg ) => U;
30+
type Nullary<V, ThisArg> = ( this: ThisArg ) => V;
3231

3332
/**
3433
* Callback invoked for each ndarray element.
3534
*
3635
* @param value - current array element
3736
* @returns output value
3837
*/
39-
type Unary<T, U, ThisArg> = ( this: ThisArg, value: T ) => U;
38+
type Unary<T, V, ThisArg> = ( this: ThisArg, value: T ) => V;
4039

4140
/**
4241
* Callback invoked for each ndarray element.
@@ -45,7 +44,7 @@ type Unary<T, U, ThisArg> = ( this: ThisArg, value: T ) => U;
4544
* @param indices - current array element indices
4645
* @returns output value
4746
*/
48-
type Binary<T, U, ThisArg> = ( this: ThisArg, value: T, indices: Array<number> ) => U;
47+
type Binary<T, V, ThisArg> = ( this: ThisArg, value: T, indices: Array<number> ) => V;
4948

5049
/**
5150
* Callback invoked for each ndarray element.
@@ -55,7 +54,7 @@ type Binary<T, U, ThisArg> = ( this: ThisArg, value: T, indices: Array<number> )
5554
* @param arr - input array
5655
* @returns output value
5756
*/
58-
type Ternary<T, U, ThisArg> = ( this: ThisArg, value: T, indices: Array<number>, arr: typedndarray<T> ) => U;
57+
type Ternary<T, U, V, ThisArg> = ( this: ThisArg, value: T, indices: Array<number>, arr: U ) => V;
5958

6059
/**
6160
* Callback invoked for each ndarray element.
@@ -65,7 +64,7 @@ type Ternary<T, U, ThisArg> = ( this: ThisArg, value: T, indices: Array<number>,
6564
* @param arr - input array
6665
* @returns output value
6766
*/
68-
type Callback<T, U, ThisArg> = Nullary<U, ThisArg> | Unary<T, U, ThisArg> | Binary<T, U, ThisArg> | Ternary<T, U, ThisArg>;
67+
type Callback<T, U, V, ThisArg> = Nullary<V, ThisArg> | Unary<T, V, ThisArg> | Binary<T, V, ThisArg> | Ternary<T, U, V, ThisArg>;
6968

7069
/**
7170
* Applies a callback function to elements in an input ndarray and assigns results to elements in an output ndarray.
@@ -109,7 +108,7 @@ type Callback<T, U, ThisArg> = Nullary<U, ThisArg> | Unary<T, U, ThisArg> | Bina
109108
* console.log( y.data );
110109
* // => <Float64Array>[ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]
111110
*/
112-
declare function map<T = unknown, U = unknown, ThisArg = unknown>( arrays: ArrayLike<typedndarray<T>>, fcn: Callback<T, U, ThisArg>, thisArg?: ThisParameterType<Callback<T, U, ThisArg>> ): void;
111+
declare function map<T = unknown, U extends typedndarray<T> = typedndarray<T>, V = unknown, ThisArg = unknown>( arrays: [ U, typedndarray<V> ], fcn: Callback<T, U, V, ThisArg>, thisArg?: ThisParameterType<Callback<T, U, V, ThisArg>> ): void;
113112

114113

115114
// EXPORTS //

examples/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818

1919
'use strict';
2020

21-
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' ).factory;
22-
var filledarray = require( '@stdlib/array-filled' );
23-
var filledarrayBy = require( '@stdlib/array-filled-by' );
21+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
22+
var zeros = require( '@stdlib/array-zeros' );
2423
var abs = require( '@stdlib/math-base-special-abs' );
2524
var shape2strides = require( '@stdlib/ndarray-base-shape2strides' );
2625
var ndarray2array = require( '@stdlib/ndarray-base-to-array' );
@@ -30,15 +29,17 @@ var map = require( './../lib' );
3029
var N = 10;
3130
var x = {
3231
'dtype': 'generic',
33-
'data': filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) ),
32+
'data': discreteUniform( N, -100, 100, {
33+
'dtype': 'generic'
34+
}),
3435
'shape': [ 5, 2 ],
3536
'strides': [ 2, 1 ],
3637
'offset': 0,
3738
'order': 'row-major'
3839
};
3940
var y = {
4041
'dtype': 'generic',
41-
'data': filledarray( 0, N, 'generic' ),
42+
'data': zeros( N, 'generic' ),
4243
'shape': x.shape.slice(),
4344
'strides': shape2strides( x.shape, 'column-major' ),
4445
'offset': 0,

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454
},
5555
"devDependencies": {
5656
"@stdlib/array-complex128": "^0.3.0",
57-
"@stdlib/array-filled": "^0.2.1",
58-
"@stdlib/array-filled-by": "^0.2.1",
5957
"@stdlib/array-float64": "^0.2.2",
6058
"@stdlib/array-ones": "^0.2.1",
6159
"@stdlib/array-typed-complex-ctors": "^0.2.2",
@@ -80,7 +78,6 @@
8078
"@stdlib/ndarray-from-scalar": "^0.2.1",
8179
"@stdlib/number-float64-base-identity": "github:stdlib-js/number-float64-base-identity#main",
8280
"@stdlib/random-array-discrete-uniform": "^0.2.1",
83-
"@stdlib/random-base-discrete-uniform": "^0.2.1",
8481
"@stdlib/utils-nary-function": "^0.2.2",
8582
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
8683
"istanbul": "^0.4.1",

0 commit comments

Comments
 (0)