Skip to content

Commit 3b278aa

Browse files
committed
Auto-generated commit
1 parent 4de8a31 commit 3b278aa

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
### Bug Fixes
2525

26+
- [`098451f`](https://github.com/stdlib-js/stdlib/commit/098451fcfd33729cc05260ae5c74113819741f80) - widen `mode` option type in `ndarray/sub2ind` to accept a single mode [(#12628)](https://github.com/stdlib-js/stdlib/pull/12628)
2627
- [`b696736`](https://github.com/stdlib-js/stdlib/commit/b696736186a5c6acce24c49f6b613832941c0cf1) - bind generic type parameter to input ndarray in `ndarray/with` [(#12626)](https://github.com/stdlib-js/stdlib/pull/12626)
2728
- [`a2a20a2`](https://github.com/stdlib-js/stdlib/commit/a2a20a2a6731a73a6e58cdf84d4e527ae939799e) - infer input ndarray type in `ndarray/some-by` assign overloads [(#12627)](https://github.com/stdlib-js/stdlib/pull/12627)
2829
- [`07a3349`](https://github.com/stdlib-js/stdlib/commit/07a3349f6ab025490bafad9cd3b2d08df70f1fed) - use correct export names [(#12665)](https://github.com/stdlib-js/stdlib/pull/12665)
@@ -39,6 +40,7 @@
3940

4041
<details>
4142

43+
- [`098451f`](https://github.com/stdlib-js/stdlib/commit/098451fcfd33729cc05260ae5c74113819741f80) - **fix:** widen `mode` option type in `ndarray/sub2ind` to accept a single mode [(#12628)](https://github.com/stdlib-js/stdlib/pull/12628) _(by Philipp Burckhardt, Athan Reines)_
4244
- [`b696736`](https://github.com/stdlib-js/stdlib/commit/b696736186a5c6acce24c49f6b613832941c0cf1) - **fix:** bind generic type parameter to input ndarray in `ndarray/with` [(#12626)](https://github.com/stdlib-js/stdlib/pull/12626) _(by Philipp Burckhardt)_
4345
- [`a2a20a2`](https://github.com/stdlib-js/stdlib/commit/a2a20a2a6731a73a6e58cdf84d4e527ae939799e) - **fix:** infer input ndarray type in `ndarray/some-by` assign overloads [(#12627)](https://github.com/stdlib-js/stdlib/pull/12627) _(by Philipp Burckhardt)_
4446
- [`a7e07a6`](https://github.com/stdlib-js/stdlib/commit/a7e07a6f17f0974dca43b7bdc0245ce71c28ec86) - **docs:** update namespace table of contents [(#12690)](https://github.com/stdlib-js/stdlib/pull/12690) _(by stdlib-bot)_

sub2ind/docs/types/index.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919
// TypeScript Version: 4.1
2020

2121
/// <reference types="@stdlib/types"/>
22-
/// <reference types="node"/>
2322

2423
import { ArrayLike } from '@stdlib/types/array';
25-
import { Order } from '@stdlib/types/ndarray';
24+
import { Mode, Order } from '@stdlib/types/ndarray';
2625

2726
/**
2827
* Interface defining function options.
@@ -31,10 +30,10 @@ interface Options {
3130
/**
3231
* Specifies how to handle subscripts which exceed array dimensions (default: ['throw']).
3332
*/
34-
mode?: Array<string>;
33+
mode?: Mode | Array<Mode>;
3534

3635
/**
37-
* specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major').
36+
* Specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major').
3837
*/
3938
order?: Order;
4039
}
@@ -57,9 +56,10 @@ interface Options {
5756
* @param args - subscripts followed by an optional options object
5857
* @throws first argument must be an array-like object containing nonnegative integers
5958
* @throws subscripts must be integer valued
59+
* @throws options argument must be an object
6060
* @throws must provide valid options
6161
* @throws must provide subscripts which do not exceed array dimensions
62-
* @throws number of subscripts much match the number of dimensions
62+
* @throws number of subscripts must match the number of dimensions
6363
* @returns linear index
6464
*
6565
* @example

sub2ind/docs/types/test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import subd2ind = require( './index' );
2424
// The function returns a number...
2525
{
2626
const shape = [ 3, 3, 3 ];
27+
subd2ind( shape, 1, 2, 2, { 'mode': 'throw' } ); // $ExpectType number
2728
subd2ind( shape, 1, 2, 2, { 'mode': [ 'throw' ] } ); // $ExpectType number
2829
subd2ind( shape, 1, 2, 2, { 'order': 'row-major' } ); // $ExpectType number
2930
}
@@ -65,7 +66,7 @@ import subd2ind = require( './index' );
6566
subd2ind( shape, 1, 2, 2, { 'order': ( x: number ): number => x } ); // $ExpectError
6667
}
6768

68-
// The compiler throws an error if the function is provided a `mode` option which is not an array of strings...
69+
// The compiler throws an error if the function is provided a `mode` option which is not a recognized mode or array of recognized modes...
6970
{
7071
const shape = [ 3, 3, 3 ];
7172
subd2ind( shape, 1, 2, 2, { 'mode': 'abc' } ); // $ExpectError

0 commit comments

Comments
 (0)