From 33e12a61828da5dfa71bfea6fb89abab2a46da0b Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 24 Feb 2025 01:12:16 +0000 Subject: [PATCH] Transform error messages --- lib/main.js | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/main.js b/lib/main.js index 0bf1216..1cd29a9 100644 --- a/lib/main.js +++ b/lib/main.js @@ -21,7 +21,7 @@ // MODULES // var isDataType = require( '@stdlib/ndarray-base-assert-is-data-type' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); // MAIN // @@ -48,14 +48,14 @@ function dtype( 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( '1kVDv', x ) ); } dt = x.dtype; if ( isDataType( dt ) ) { return dt; } // A data type is essential for interpreting the memory associated with an ndarray object, so no fallbacks or workarounds for data type resolution... - throw new TypeError( format( 'invalid argument. Must provide an ndarray having a supported data type. Value: `%s`.', dt ) ); + throw new TypeError( format( '1kVF6', dt ) ); } diff --git a/package.json b/package.json index 40c8531..e83deaf 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ }, "dependencies": { "@stdlib/ndarray-base-assert-is-data-type": "^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" },