diff --git a/lib/main.js b/lib/main.js index b87b74b..afcb515 100644 --- a/lib/main.js +++ b/lib/main.js @@ -23,7 +23,7 @@ var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; var isCollection = require( '@stdlib/assert-is-collection' ); var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); // MAIN // @@ -48,7 +48,7 @@ function offset( 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( '1k9Dv', x ) ); } n = x.offset; if ( isNonNegativeInteger( n ) ) { @@ -56,7 +56,7 @@ function offset( x ) { } sh = x.shape; if ( !isCollection( sh ) ) { - throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) ); + throw new TypeError( format( '1k9Dv', x ) ); } st = x.strides; if ( sh.length === 0 || !isCollection( st ) ) { @@ -66,7 +66,7 @@ function offset( x ) { if ( isNonNegativeInteger( n ) ) { return n; } - throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) ); + throw new TypeError( format( '1k9Dv', x ) ); } diff --git a/package.json b/package.json index 358e231..1c3c89b 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@stdlib/assert-is-collection": "^0.2.2", "@stdlib/assert-is-nonnegative-integer": "^0.2.2", "@stdlib/ndarray-base-strides2offset": "^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" },