Skip to content

Commit 054af5e

Browse files
committed
Auto-generated commit
1 parent 4368650 commit 054af5e

File tree

9 files changed

+40
-7
lines changed

9 files changed

+40
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ A total of 40 issues were closed in this release:
702702

703703
<details>
704704

705+
- [`5149a6b`](https://github.com/stdlib-js/stdlib/commit/5149a6b650b60568bd0df248c2a97a3d8ca2ca87) - **chore:** minor clean-up _(by Philipp Burckhardt)_
705706
- [`1aff763`](https://github.com/stdlib-js/stdlib/commit/1aff763c61863b7d737a699db89729d2bba0e1bc) - **feat:** add `ndarray/spread-dimensions` [(#9424)](https://github.com/stdlib-js/stdlib/pull/9424) _(by Muhammad Haris, Athan Reines)_
706707
- [`9d53583`](https://github.com/stdlib-js/stdlib/commit/9d53583c9f82e1b2e5dc084849d98bd9c3214d45) - **test:** update descriptions _(by Athan Reines)_
707708
- [`3c567b6`](https://github.com/stdlib-js/stdlib/commit/3c567b634cf5e5fa5e31b64f94206db5b4a88133) - **feat:** update `ndarray/base` TypeScript declarations (#9640) [(#9640)](https://github.com/stdlib-js/stdlib/pull/9640) _(by stdlib-bot)_

base/expand-dimensions/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ sh = getShape( y );
7777
The function accepts the following arguments:
7878

7979
- **x**: input ndarray.
80-
- **axis**: axis at which to insert a singleton dimension
80+
- **axis**: axis at which to insert a singleton dimension.
8181
- **writable**: boolean indicating whether a returned ndarray should be writable.
8282

8383
</section>

find-last/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The function accepts the following options:
7171
- **keepdims**: boolean indicating whether the reduced dimensions should be included in the returned [ndarray][@stdlib/ndarray/ctor] as singleton dimensions. Default: `false`.
7272
- **sentinel**: value to return when no element passes the test. May be either a scalar value or a zero-dimensional [ndarray][@stdlib/ndarray/ctor].
7373

74-
By default, the function performs reduction over all all elements in a provided [ndarray][@stdlib/ndarray/ctor]. To reduce specific dimensions, set the `dims` option.
74+
By default, the function performs reduction over all elements in a provided [ndarray][@stdlib/ndarray/ctor]. To reduce specific dimensions, set the `dims` option.
7575

7676
<!-- eslint-disable max-len -->
7777

find-last/docs/types/index.d.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ interface Options<T> extends BaseOptions {
9292
sentinel?: T | typedndarray<T>;
9393
}
9494

95+
/**
96+
* Assign options.
97+
*/
98+
interface AssignOptions<T> extends BaseOptions {
99+
/**
100+
* Sentinel value.
101+
*/
102+
sentinel?: T | typedndarray<T>;
103+
}
104+
95105
/**
96106
* Interface describing `findLast`.
97107
*/
@@ -255,7 +265,7 @@ interface FindLast {
255265
* var out = findLast.assign( x, y, {}, isEven );
256266
* // returns <ndarray>[ 6.0 ]
257267
*/
258-
assign<T = unknown, U extends typedndarray<T> = typedndarray<T>, V = T, ThisArg = unknown>( x: ndarray, out: U, options: Options<V>, predicate: Predicate<T, U, ThisArg>, thisArg?: ThisParameterType<Predicate<T, U, ThisArg>> ): U;
268+
assign<T = unknown, U extends typedndarray<T> = typedndarray<T>, V = T, ThisArg = unknown>( x: ndarray, out: U, options: AssignOptions<V>, predicate: Predicate<T, U, ThisArg>, thisArg?: ThisParameterType<Predicate<T, U, ThisArg>> ): U;
259269
}
260270

261271
/**

find-last/lib/assign.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ var wrap = require( './callback_wrapper.js' );
3737
* @param {ndarray} out - output ndarray
3838
* @param {Options} [options] - function options
3939
* @param {IntegerArray} [options.dims] - list of dimensions over which to perform a reduction
40-
* @param {boolean} [options.keepdims=false] - boolean indicating whether the reduced dimensions should be included in the returned ndarray as singleton dimensions
4140
* @param {(*|ndarray)} [options.sentinel] - sentinel value
4241
* @param {Function} predicate - predicate function
4342
* @param {*} [thisArg] - predicate function execution context
@@ -84,7 +83,7 @@ function assign( x, out, options, predicate, thisArg ) {
8483
throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );
8584
}
8685
if ( !isndarrayLike( out ) ) {
87-
throw new TypeError( format( 'invalid argument. Second argument must be an ndarray-like object. Value: `%s`.', x ) );
86+
throw new TypeError( format( 'invalid argument. Second argument must be an ndarray-like object. Value: `%s`.', out ) );
8887
}
8988
// Case: assign( x, out, predicate )
9089
if ( nargs < 4 ) {

find/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The function accepts the following options:
7575
- **keepdims**: boolean indicating whether the reduced dimensions should be included in the returned [ndarray][@stdlib/ndarray/ctor] as singleton dimensions. Default: `false`.
7676
- **sentinel**: value to return when no element passes the test. May be either a scalar value or a zero-dimensional [ndarray][@stdlib/ndarray/ctor].
7777

78-
By default, the function performs reduction over all all elements in a provided [ndarray][@stdlib/ndarray/ctor]. To reduce specific dimensions, set the `dims` option.
78+
By default, the function performs reduction over all elements in a provided [ndarray][@stdlib/ndarray/ctor]. To reduce specific dimensions, set the `dims` option.
7979

8080
```javascript
8181
var array = require( '@stdlib/ndarray/array' );

find/docs/types/index.d.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ interface Options<T> extends BaseOptions {
9292
sentinel?: T | typedndarray<T>;
9393
}
9494

95+
/**
96+
* Assign options.
97+
*/
98+
interface AssignOptions<T> extends BaseOptions {
99+
/**
100+
* Sentinel value.
101+
*/
102+
sentinel?: T | typedndarray<T>;
103+
}
104+
95105
/**
96106
* Interface describing `find`.
97107
*/
@@ -261,7 +271,7 @@ interface Find {
261271
* var out = find.assign( x, y, {}, isEven );
262272
* // returns <ndarray>
263273
*/
264-
assign<T = unknown, U extends typedndarray<T> = typedndarray<T>, V = T, ThisArg = unknown>( x: ndarray, out: U, options: Options<V>, predicate: Predicate<T, U, ThisArg>, thisArg?: ThisParameterType<Predicate<T, U, ThisArg>> ): U;
274+
assign<T = unknown, U extends typedndarray<T> = typedndarray<T>, V = T, ThisArg = unknown>( x: ndarray, out: U, options: AssignOptions<V>, predicate: Predicate<T, U, ThisArg>, thisArg?: ThisParameterType<Predicate<T, U, ThisArg>> ): U;
265275
}
266276

267277
/**

prepend-singleton-dimensions/docs/repl.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
Returns a read-only view of an input ndarray with a specified number of
44
prepended singleton dimensions.
55

6+
If `n` is equal to zero, the function returns a read-only view of the input
7+
ndarray.
8+
69
Parameters
710
----------
811
x: ndarray

prepend-singleton-dimensions/test/test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ tape( 'the function prepends singleton dimensions', function test( t ) {
101101
var x;
102102
var y;
103103

104+
x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
105+
y = prependSingletonDimensions( x, 0 );
106+
107+
expected = [ 2, 2 ];
108+
109+
t.deepEqual( getShape( y ), expected, 'returns expected value' );
110+
t.strictEqual( getData( y ), getData( x ), 'returns expected value' );
111+
t.notEqual( y, x, 'returns expected value' );
112+
t.strictEqual( isReadOnly( y ), true, 'returns expected value' );
113+
104114
x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
105115
y = prependSingletonDimensions( x, 3 );
106116

0 commit comments

Comments
 (0)