From 251469b43cbef1e6b45baae9895953aa0779603d Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 17 Mar 2025 01:58:19 +0000 Subject: [PATCH] Transform error messages --- lib/main.js | 4 ++-- lib/polyfill.js | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/main.js b/lib/main.js index 92a8c7a..3ea2f89 100644 --- a/lib/main.js +++ b/lib/main.js @@ -21,7 +21,7 @@ // MODULES // var isCollection = require( '@stdlib/assert-is-collection' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); var Buffer = require( '@stdlib/buffer-ctor' ); @@ -42,7 +42,7 @@ var Buffer = require( '@stdlib/buffer-ctor' ); */ function fromArray( arr ) { if ( !isCollection( arr ) ) { - throw new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) ); + throw new TypeError( format( '0GJ2u', arr ) ); } return Buffer.from( arr ); } diff --git a/lib/polyfill.js b/lib/polyfill.js index cf26ae8..4edff2a 100644 --- a/lib/polyfill.js +++ b/lib/polyfill.js @@ -21,7 +21,7 @@ // MODULES // var isCollection = require( '@stdlib/assert-is-collection' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); var Buffer = require( '@stdlib/buffer-ctor' ); @@ -42,7 +42,7 @@ var Buffer = require( '@stdlib/buffer-ctor' ); */ function fromArray( arr ) { if ( !isCollection( arr ) ) { - throw new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) ); + throw new TypeError( format( '0GJ2u', arr ) ); } return new Buffer( arr ); // eslint-disable-line no-buffer-constructor } diff --git a/package.json b/package.json index 99cbdf5..4c99a3c 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@stdlib/assert-is-collection": "^0.2.2", "@stdlib/assert-is-function": "^0.2.2", "@stdlib/buffer-ctor": "^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" },