From 8d9638d7f64192bf32b4ba0bee4fbbd2e62690d1 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 2 Jun 2025 00:43:33 +0000 Subject: [PATCH] Transform error messages --- lib/main.js | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/main.js b/lib/main.js index 372baf0..d1d46d2 100644 --- a/lib/main.js +++ b/lib/main.js @@ -35,7 +35,7 @@ var getOrder = require( '@stdlib/ndarray-order' ); var ndarray = require( '@stdlib/ndarray-ctor' ); var emptyArray = require( '@stdlib/array-empty' ); var allocUnsafe = require( '@stdlib/buffer-alloc-unsafe' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); // MAIN // @@ -85,13 +85,13 @@ function emptyLike( x ) { var sh; if ( !isndarrayLike( x ) ) { - throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) ); + throw new TypeError( format( '1dZ5t', x ) ); } opts = {}; if ( arguments.length > 1 ) { options = arguments[ 1 ]; if ( !isPlainObject( options ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); + throw new TypeError( format( '1dZ2V', options ) ); } if ( hasOwnProp( options, 'dtype' ) ) { dtype = options.dtype; @@ -104,7 +104,7 @@ function emptyLike( x ) { sh = [ sh ]; } if ( !isNonNegativeIntegerArray( sh ) && !isEmptyCollection( sh ) ) { // eslint-disable-line max-len - throw new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer or an array of nonnegative integers. Option: `%s`.', 'shape', sh ) ); + throw new TypeError( format( '1dZDs', 'shape', sh ) ); } } else { sh = getShape( x ); diff --git a/package.json b/package.json index 9a1b6b2..4f2900e 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@stdlib/ndarray-dtype": "^0.2.2", "@stdlib/ndarray-order": "^0.2.2", "@stdlib/ndarray-shape": "^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" },