From 1bf8459b2513c66f39a7993becf665ed4aee0462 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 1 Dec 2024 04:24:01 +0000 Subject: [PATCH] Transform error messages --- lib/main.js | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/main.js b/lib/main.js index 3b6c1c7..79ff436 100644 --- a/lib/main.js +++ b/lib/main.js @@ -27,7 +27,7 @@ var setReadOnlyAccessor = require( '@stdlib/utils-define-nonenumerable-read-only var isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive; var isNull = require( '@stdlib/assert-is-null' ); var isUndefined = require( '@stdlib/assert-is-undefined' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); // FUNCTIONS // @@ -139,15 +139,15 @@ function Slice() { return new Slice( start, stop, step ); } if ( !isValid( start ) ) { - throw new TypeError( format( 'invalid argument. First argument must be an integer, null, or undefined. Value: `%s`.', start ) ); + throw new TypeError( format( '1izEf', start ) ); } if ( !isValid( stop ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be an integer, null, or undefined. Value: `%s`.', stop ) ); + throw new TypeError( format( '1izEg', stop ) ); } if ( !isValid( step ) ) { - throw new TypeError( format( 'invalid argument. Third argument must be an integer, null, or undefined. Value: `%s`.', step ) ); + throw new TypeError( format( '1izEh', step ) ); } else if ( step === 0 ) { - throw new RangeError( format( 'invalid argument. Third argument cannot be zero. Value: `%s`.', step ) ); + throw new RangeError( format( '1izEi', step ) ); } this._start = ( start === void 0 ) ? null : start; this._stop = ( stop === void 0 ) ? null : stop; diff --git a/package.json b/package.json index 73b2622..c2d7f4b 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@stdlib/assert-is-integer": "^0.2.2", "@stdlib/assert-is-null": "^0.2.2", "@stdlib/assert-is-undefined": "^0.2.2", - "@stdlib/string-format": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", "@stdlib/types": "^0.4.3", "@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.2.3", "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",