From 44cf05546ab911257a4f953c9ef3cd8561dad7d2 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 12 May 2026 13:29:33 +0000 Subject: [PATCH] refactor: align `ndarray/*` errors and remove `namespace` self-ref Propagates fix from c77fbd9a ("refactor: align `ndarray/base/diagonal` error message and remove `namespace` self-refs") to sibling packages. In `ndarray/*` lib/main.js files, replaces the `at least two dimensions` phrasing with `two or more dimensions` in `@throws` JSDoc tags and in runtime error messages, aligning with the wording established by `ndarray/transpose`, `ndarray/vconcat`, `ndarray/base/diagonal`, and others. In `ndarray/base/rot90/lib/main.js`, the runtime throw already used the aligned wording; only the `@throws` JSDoc lagged. In `lib/node_modules/@stdlib/namespace/lib/namespace/u.js`, removes the self-reference in the `US_STATES_NAMES_CAPITALS` entry's `related` array (the entry's own path was listed among its related packages). --- lib/node_modules/@stdlib/namespace/lib/namespace/u.js | 3 +-- .../@stdlib/ndarray/base/fill-diagonal/lib/main.js | 2 +- lib/node_modules/@stdlib/ndarray/base/rot90/lib/main.js | 2 +- lib/node_modules/@stdlib/ndarray/base/to-rot180/lib/main.js | 2 +- lib/node_modules/@stdlib/ndarray/base/to-rot90/lib/main.js | 2 +- lib/node_modules/@stdlib/ndarray/diagonal/lib/main.js | 2 +- .../@stdlib/ndarray/iter/column-entries/lib/main.js | 4 ++-- lib/node_modules/@stdlib/ndarray/iter/columns/lib/main.js | 4 ++-- lib/node_modules/@stdlib/ndarray/iter/row-entries/lib/main.js | 4 ++-- lib/node_modules/@stdlib/ndarray/iter/rows/lib/main.js | 4 ++-- lib/node_modules/@stdlib/ndarray/rot180/lib/main.js | 2 +- lib/node_modules/@stdlib/ndarray/rot90/lib/main.js | 2 +- lib/node_modules/@stdlib/ndarray/to-rot180/lib/main.js | 2 +- lib/node_modules/@stdlib/ndarray/to-rot90/lib/main.js | 2 +- 14 files changed, 18 insertions(+), 19 deletions(-) diff --git a/lib/node_modules/@stdlib/namespace/lib/namespace/u.js b/lib/node_modules/@stdlib/namespace/lib/namespace/u.js index d943a8ac4db9..92edaa59d8e1 100644 --- a/lib/node_modules/@stdlib/namespace/lib/namespace/u.js +++ b/lib/node_modules/@stdlib/namespace/lib/namespace/u.js @@ -588,8 +588,7 @@ ns.push({ 'type': 'Function', 'related': [ '@stdlib/datasets/us-states-capitals', - '@stdlib/datasets/us-states-names', - '@stdlib/datasets/us-states-names-capitals' + '@stdlib/datasets/us-states-names' ] }); diff --git a/lib/node_modules/@stdlib/ndarray/base/fill-diagonal/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/fill-diagonal/lib/main.js index 571a2628bde8..f6c6fdc50333 100644 --- a/lib/node_modules/@stdlib/ndarray/base/fill-diagonal/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/base/fill-diagonal/lib/main.js @@ -41,7 +41,7 @@ var fill = require( '@stdlib/ndarray/base/fill' ); * @param {IntegerArray} dims - dimension indices defining the plane in which to fill the diagonal * @param {integer} k - diagonal offset * @throws {RangeError} must provide exactly two dimension indices -* @throws {RangeError} input ndarray must have at least two dimensions +* @throws {RangeError} input ndarray must have two or more dimensions * @throws {RangeError} must provide valid dimension indices * @throws {Error} must provide unique dimension indices * @throws {TypeError} second argument cannot be safely cast to the input array data type diff --git a/lib/node_modules/@stdlib/ndarray/base/rot90/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/rot90/lib/main.js index 6d8179b98277..a07f4ae71167 100644 --- a/lib/node_modules/@stdlib/ndarray/base/rot90/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/base/rot90/lib/main.js @@ -47,7 +47,7 @@ var format = require( '@stdlib/string/format' ); * @param {integer} k - number of times to rotate by 90 degrees * @param {boolean} writable - boolean indicating whether the returned ndarray should be writable * @throws {RangeError} must provide exactly two dimension indices -* @throws {RangeError} input ndarray must have at least two dimensions +* @throws {RangeError} input ndarray must have two or more dimensions * @throws {RangeError} must provide valid dimension indices * @throws {Error} must provide unique dimension indices * @returns {ndarray} ndarray view diff --git a/lib/node_modules/@stdlib/ndarray/base/to-rot180/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/to-rot180/lib/main.js index de46eb500ce9..deeba29963e1 100644 --- a/lib/node_modules/@stdlib/ndarray/base/to-rot180/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/base/to-rot180/lib/main.js @@ -37,7 +37,7 @@ var assign = require( '@stdlib/ndarray/base/assign' ); * @param {ndarray} x - input array * @param {IntegerArray} dims - dimension indices defining the plane of rotation * @throws {RangeError} must provide exactly two dimension indices -* @throws {RangeError} input ndarray must have at least two dimensions +* @throws {RangeError} input ndarray must have two or more dimensions * @throws {RangeError} must provide valid dimension indices * @throws {Error} must provide unique dimension indices * @returns {ndarray} output array diff --git a/lib/node_modules/@stdlib/ndarray/base/to-rot90/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/to-rot90/lib/main.js index 43b6a611585d..40a118b72e5b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/to-rot90/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/base/to-rot90/lib/main.js @@ -40,7 +40,7 @@ var assign = require( '@stdlib/ndarray/base/assign' ); * @param {IntegerArray} dims - dimension indices defining the plane of rotation * @param {integer} k - number of times to rotate by 90 degrees * @throws {RangeError} must provide exactly two dimension indices -* @throws {RangeError} input ndarray must have at least two dimensions +* @throws {RangeError} input ndarray must have two or more dimensions * @throws {RangeError} must provide valid dimension indices * @throws {Error} must provide unique dimension indices * @returns {ndarray} output array diff --git a/lib/node_modules/@stdlib/ndarray/diagonal/lib/main.js b/lib/node_modules/@stdlib/ndarray/diagonal/lib/main.js index b978f08b56d3..2113cf6be565 100644 --- a/lib/node_modules/@stdlib/ndarray/diagonal/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/diagonal/lib/main.js @@ -49,7 +49,7 @@ var format = require( '@stdlib/string/format' ); * @throws {TypeError} `k` option must be an integer * @throws {TypeError} `dims` option must be an array of integers * @throws {RangeError} must provide exactly two dimension indices -* @throws {RangeError} input ndarray must have at least two dimensions +* @throws {RangeError} input ndarray must have two or more dimensions * @throws {RangeError} must provide valid dimension indices * @throws {Error} must provide unique dimension indices * @returns {ndarray} ndarray view diff --git a/lib/node_modules/@stdlib/ndarray/iter/column-entries/lib/main.js b/lib/node_modules/@stdlib/ndarray/iter/column-entries/lib/main.js index 1a905f033d7f..fd7b8c3e50a3 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/column-entries/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/iter/column-entries/lib/main.js @@ -45,7 +45,7 @@ var format = require( '@stdlib/string/format' ); * @param {Options} [options] - function options * @param {boolean} [options.readonly=true] - boolean indicating whether returned views should be read-only * @throws {TypeError} first argument must be an ndarray -* @throws {TypeError} first argument must have at least two dimensions +* @throws {TypeError} first argument must have two or more dimensions * @throws {TypeError} options argument must be an object * @throws {TypeError} must provide valid options * @throws {Error} cannot write to a read-only array @@ -120,7 +120,7 @@ function nditerColumnEntries( x ) { // Ensure that the input array has sufficient dimensions... if ( ndims < 2 ) { - throw new TypeError( 'invalid argument. First argument must be an ndarray having at least two dimensions.' ); + throw new TypeError( 'invalid argument. First argument must be an ndarray having two or more dimensions.' ); } // Check whether the input array is empty... diff --git a/lib/node_modules/@stdlib/ndarray/iter/columns/lib/main.js b/lib/node_modules/@stdlib/ndarray/iter/columns/lib/main.js index ff7da68a5d86..c0743073434e 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/columns/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/iter/columns/lib/main.js @@ -45,7 +45,7 @@ var format = require( '@stdlib/string/format' ); * @param {Options} [options] - function options * @param {boolean} [options.readonly=true] - boolean indicating whether returned views should be read-only * @throws {TypeError} first argument must be an ndarray -* @throws {TypeError} first argument must have at least two dimensions +* @throws {TypeError} first argument must have two or more dimensions * @throws {TypeError} options argument must be an object * @throws {TypeError} must provide valid options * @throws {Error} cannot write to a read-only array @@ -120,7 +120,7 @@ function nditerColumns( x ) { // Ensure that the input array has sufficient dimensions... if ( ndims < 2 ) { - throw new TypeError( 'invalid argument. First argument must be an ndarray having at least two dimensions.' ); + throw new TypeError( 'invalid argument. First argument must be an ndarray having two or more dimensions.' ); } // Check whether the input array is empty... N = numel( shape ); diff --git a/lib/node_modules/@stdlib/ndarray/iter/row-entries/lib/main.js b/lib/node_modules/@stdlib/ndarray/iter/row-entries/lib/main.js index 2f6d21e84864..9e713ea1c967 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/row-entries/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/iter/row-entries/lib/main.js @@ -45,7 +45,7 @@ var format = require( '@stdlib/string/format' ); * @param {Options} [options] - function options * @param {boolean} [options.readonly=true] - boolean indicating whether returned views should be read-only * @throws {TypeError} first argument must be an ndarray -* @throws {TypeError} first argument must have at least two dimensions +* @throws {TypeError} first argument must have two or more dimensions * @throws {TypeError} options argument must be an object * @throws {TypeError} must provide valid options * @throws {Error} cannot write to a read-only array @@ -120,7 +120,7 @@ function nditerRowEntries( x ) { // Ensure that the input array has sufficient dimensions... if ( ndims < 2 ) { - throw new TypeError( 'invalid argument. First argument must be an ndarray having at least two dimensions.' ); + throw new TypeError( 'invalid argument. First argument must be an ndarray having two or more dimensions.' ); } // Check whether the input array is empty... diff --git a/lib/node_modules/@stdlib/ndarray/iter/rows/lib/main.js b/lib/node_modules/@stdlib/ndarray/iter/rows/lib/main.js index 44214b507195..2e5ef326fdd5 100644 --- a/lib/node_modules/@stdlib/ndarray/iter/rows/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/iter/rows/lib/main.js @@ -45,7 +45,7 @@ var format = require( '@stdlib/string/format' ); * @param {Options} [options] - function options * @param {boolean} [options.readonly=true] - boolean indicating whether returned views should be read-only * @throws {TypeError} first argument must be an ndarray -* @throws {TypeError} first argument must have at least two dimensions +* @throws {TypeError} first argument must have two or more dimensions * @throws {TypeError} options argument must be an object * @throws {TypeError} must provide valid options * @throws {Error} cannot write to a read-only array @@ -120,7 +120,7 @@ function nditerRows( x ) { // Ensure that the input array has sufficient dimensions... if ( ndims < 2 ) { - throw new TypeError( 'invalid argument. First argument must be an ndarray having at least two dimensions.' ); + throw new TypeError( 'invalid argument. First argument must be an ndarray having two or more dimensions.' ); } // Check whether the input array is empty... N = numel( shape ); diff --git a/lib/node_modules/@stdlib/ndarray/rot180/lib/main.js b/lib/node_modules/@stdlib/ndarray/rot180/lib/main.js index 80e6b56bd97a..7cb8bf7b7a98 100644 --- a/lib/node_modules/@stdlib/ndarray/rot180/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/rot180/lib/main.js @@ -44,7 +44,7 @@ var format = require( '@stdlib/string/format' ); * @throws {TypeError} options argument must be an object * @throws {TypeError} `dims` option must be an array of integers * @throws {RangeError} must provide exactly two dimension indices -* @throws {RangeError} input ndarray must have at least two dimensions +* @throws {RangeError} input ndarray must have two or more dimensions * @throws {RangeError} must provide valid dimension indices * @throws {Error} must provide unique dimension indices * @returns {ndarray} ndarray view diff --git a/lib/node_modules/@stdlib/ndarray/rot90/lib/main.js b/lib/node_modules/@stdlib/ndarray/rot90/lib/main.js index 6f74edf260a3..84c609b0b640 100644 --- a/lib/node_modules/@stdlib/ndarray/rot90/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/rot90/lib/main.js @@ -49,7 +49,7 @@ var format = require( '@stdlib/string/format' ); * @throws {TypeError} `k` option must be an integer * @throws {TypeError} `dims` option must be an array of integers * @throws {RangeError} must provide exactly two dimension indices -* @throws {RangeError} input ndarray must have at least two dimensions +* @throws {RangeError} input ndarray must have two or more dimensions * @throws {RangeError} must provide valid dimension indices * @throws {Error} must provide unique dimension indices * @returns {ndarray} ndarray view diff --git a/lib/node_modules/@stdlib/ndarray/to-rot180/lib/main.js b/lib/node_modules/@stdlib/ndarray/to-rot180/lib/main.js index f3583235fce2..48fa7e1ff4d2 100644 --- a/lib/node_modules/@stdlib/ndarray/to-rot180/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/to-rot180/lib/main.js @@ -44,7 +44,7 @@ var base = require( '@stdlib/ndarray/base/to-rot180' ); * @throws {TypeError} options argument must be an object * @throws {TypeError} `dims` option must be an array of integers * @throws {RangeError} must provide exactly two dimension indices -* @throws {RangeError} input ndarray must have at least two dimensions +* @throws {RangeError} input ndarray must have two or more dimensions * @throws {RangeError} must provide valid dimension indices * @throws {Error} must provide unique dimension indices * @returns {ndarray} output ndarray diff --git a/lib/node_modules/@stdlib/ndarray/to-rot90/lib/main.js b/lib/node_modules/@stdlib/ndarray/to-rot90/lib/main.js index 9fde384f92e8..89964699af8c 100644 --- a/lib/node_modules/@stdlib/ndarray/to-rot90/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/to-rot90/lib/main.js @@ -49,7 +49,7 @@ var format = require( '@stdlib/string/format' ); * @throws {TypeError} `k` option must be an integer * @throws {TypeError} `dims` option must be an array of integers * @throws {RangeError} must provide exactly two dimension indices -* @throws {RangeError} input ndarray must have at least two dimensions +* @throws {RangeError} input ndarray must have two or more dimensions * @throws {RangeError} must provide valid dimension indices * @throws {Error} must provide unique dimension indices * @returns {ndarray} output ndarray