From e078b81fe59ee3d81cf6402a995ad061ecb1f8f2 Mon Sep 17 00:00:00 2001 From: stdlib-bot <noreply@stdlib.io> Date: Wed, 1 Jan 2025 03:34:52 +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 e23f9ee..3790753 100644 --- a/lib/main.js +++ b/lib/main.js @@ -26,7 +26,7 @@ var isFunction = require( '@stdlib/assert-is-function' ); var hasOwnProp = require( '@stdlib/assert-has-own-property' ); var emptyLike = require( '@stdlib/ndarray-empty-like' ); var base = require( '@stdlib/ndarray-base-map' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); // MAIN // @@ -74,7 +74,7 @@ function map( x, options, fcn, thisArg ) { var ctx; var y; if ( !isndarrayLike( x ) ) { - throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) ); + throw new TypeError( format( 'null5t', x ) ); } if ( arguments.length < 3 ) { clbk = options; @@ -94,11 +94,11 @@ function map( x, options, fcn, thisArg ) { ctx = thisArg; } if ( !isFunction( clbk ) ) { - throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) ); + throw new TypeError( format( 'null2b', clbk ) ); } if ( hasOpts ) { if ( !isPlainObject( opts ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) ); + throw new TypeError( format( 'null2V', opts ) ); } if ( hasOwnProp( opts, 'dtype' ) ) { // Delegate `dtype` validation to `emptyLike` during output array creation: diff --git a/package.json b/package.json index ef1ce04..e936765 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@stdlib/assert-is-plain-object": "^0.2.2", "@stdlib/ndarray-base-map": "github:stdlib-js/ndarray-base-map#main", "@stdlib/ndarray-empty-like": "^0.3.0", - "@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" },