Skip to content

Commit 4f887d8

Browse files
committed
Auto-generated commit
1 parent 2a53340 commit 4f887d8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

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

427427
<details>
428428

429+
- [`0367f1d`](https://github.com/stdlib-js/stdlib/commit/0367f1d22be37c646f5a354c6c34ee3a755b3aeb) - **refactor:** fix error messages and use string interpolation _(by Athan Reines)_
429430
- [`f50db5b`](https://github.com/stdlib-js/stdlib/commit/f50db5b43e51607e188f38bd6fab7d0ad5098110) - **docs:** update namespace table of contents [(#7152)](https://github.com/stdlib-js/stdlib/pull/7152) _(by stdlib-bot)_
430431
- [`4f41317`](https://github.com/stdlib-js/stdlib/commit/4f413178393495c6fb1a25d9ebcfd90132013ea5) - **docs:** update comments _(by Athan Reines)_
431432
- [`63eaebc`](https://github.com/stdlib-js/stdlib/commit/63eaebc120e5588352cd7b78871eb5c1b736c9bc) - **docs:** update comment _(by Athan Reines)_

base/map/lib/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var iterationOrder = require( './../../../base/iteration-order' );
2424
var strides2order = require( './../../../base/strides2order' );
2525
var ndarray2object = require( './../../../base/ndarraylike2object' );
26+
var format = require( '@stdlib/string/format' );
2627
var blockedaccessormap2d = require( './2d_blocked_accessors.js' );
2728
var blockedaccessormap3d = require( './3d_blocked_accessors.js' );
2829
var blockedaccessormap4d = require( './4d_blocked_accessors.js' );
@@ -211,7 +212,7 @@ function map( arrays, fcn, thisArg ) {
211212
shy = y.shape;
212213
ndims = shx.length;
213214
if ( ndims !== shy.length ) {
214-
throw new Error( 'invalid arguments. Arrays must have the same number of dimensions (i.e., same rank). ndims(x) == '+ndims+'. ndims(y) == '+shy.length+'.' );
215+
throw new Error( format( 'invalid arguments. Arrays must have the same number of dimensions (i.e., same rank). ndims(x) == %d. ndims(y) == %d.', ndims, shy.length ) );
215216
}
216217
// Determine whether we can avoid iteration altogether...
217218
if ( ndims === 0 ) {
@@ -225,7 +226,7 @@ function map( arrays, fcn, thisArg ) {
225226
for ( i = 0; i < ndims; i++ ) {
226227
d = shx[ i ];
227228
if ( d !== shy[ i ] ) {
228-
throw new Error( 'invalid arguments. Array must have the same shape.' );
229+
throw new Error( 'invalid arguments. Arrays must have the same shape.' );
229230
}
230231
// Note that, if one of the dimensions is `0`, the length will be `0`...
231232
len *= d;

0 commit comments

Comments
 (0)