diff --git a/lib/main.js b/lib/main.js index a792bff..c1a4fa9 100644 --- a/lib/main.js +++ b/lib/main.js @@ -22,7 +22,7 @@ var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; var isCollection = require( '@stdlib/assert-is-collection' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); // MAIN // @@ -48,18 +48,18 @@ function shape( x ) { // Note: we intentionally avoid rigorous ndarray checks to minimize performance impacts. This obviously means that non-ndarray-like objects can sneak through, but this is likely all right for the purposes of this function... if ( typeof x !== 'object' || x === null ) { - throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) ); + throw new TypeError( format( '1kBDv', x ) ); } sh = x.shape; if ( !isCollection( sh ) ) { - throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) ); + throw new TypeError( format( '1kBDv', x ) ); } // Copy the shape in order to avoid unintended mutation... out = []; for ( i = 0; i < sh.length; i++ ) { d = sh[ i ]; if ( !isNonNegativeInteger( d ) ) { - throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) ); + throw new TypeError( format( '1kBDv', x ) ); } out.push( d ); } diff --git a/package.json b/package.json index 91d6ad2..1d9c837 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "dependencies": { "@stdlib/assert-is-collection": "^0.2.2", "@stdlib/assert-is-nonnegative-integer": "^0.2.2", - "@stdlib/string-format": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", "@stdlib/types": "^0.4.3", "@stdlib/error-tools-fmtprodmsg": "^0.2.2" },