diff --git a/lib/main.js b/lib/main.js index 481c8e5..a256dc7 100644 --- a/lib/main.js +++ b/lib/main.js @@ -38,7 +38,7 @@ var numel = require( '@stdlib/ndarray-base-numel' ); var slice = require( '@stdlib/ndarray-base-slice' ); var nextCartesianIndex = require( '@stdlib/ndarray-base-next-cartesian-index' ).assign; var args2multislice = require( '@stdlib/slice-base-args2multislice' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); // MAIN // @@ -103,7 +103,7 @@ function nditerStacks( x, dims ) { var j; if ( !isndarrayLike( x ) ) { - throw new TypeError( format( 'invalid argument. First argument must be an ndarray. Value: `%s`.', x ) ); + throw new TypeError( format( 'null4f', x ) ); } if ( !isIntegerArray( dims ) ) { throw new TypeError( format( 'invalid argument. Second argument must be an array of integers. Value: `%s`.', dims ) ); @@ -114,15 +114,15 @@ function nditerStacks( x, dims ) { if ( arguments.length > 2 ) { options = arguments[ 2 ]; if ( !isPlainObject( options ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); + throw new TypeError( format( 'null2V', options ) ); } if ( hasOwnProp( options, 'readonly' ) ) { if ( !isBoolean( options.readonly ) ) { - throw new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'readonly', options.readonly ) ); + throw new TypeError( format( 'null2o', 'readonly', options.readonly ) ); } opts.writable = !options.readonly; if ( opts.writable && isReadOnly( x ) ) { - throw new Error( format( 'invalid option. Cannot write to read-only array.' ) ); + throw new Error( format( 'nullF4' ) ); } } } @@ -142,7 +142,7 @@ function nditerStacks( x, dims ) { for ( i = 0; i < M; i++ ) { d = normalizeIndex( dims[ i ], ndims-1 ); if ( d === -1 ) { - throw new RangeError( format( 'invalid argument. Dimension index exceeds the number of dimensions. Number of dimensions: %d. Value: `%d`.', ndims, dims[ i ] ) ); + throw new RangeError( format( 'nullF8', ndims, dims[ i ] ) ); } dims[ i ] = d; } diff --git a/package.json b/package.json index d3d6e96..064b776 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@stdlib/ndarray-base-slice": "^0.2.2", "@stdlib/ndarray-shape": "^0.2.2", "@stdlib/slice-base-args2multislice": "^0.2.2", - "@stdlib/string-format": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", "@stdlib/symbol-iterator": "^0.2.2", "@stdlib/types": "^0.4.3", "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",