8000 Transform error messages · stdlib-js/array-slice@a61d2ed · GitHub
[go: up one dir, main page]

Skip to content

Commit a61d2ed

Browse files
committed
Transform error messages
1 parent ba7227f commit a61d2ed

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var isCollection = require( '@stdlib/assert-is-collection' );
2424
var isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive;
2525
var base = require( '@stdlib/array-base-slice' );
26-
var format = require( '@stdlib/string-format' );
26+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
2727

2828

2929
// MAIN //
@@ -64,17 +64,17 @@ function slice( x ) {
6464
var end;
6565

6666
if ( !isCollection( x ) ) {
67-
throw new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', x ) );
67+
throw new TypeError( format( '1pF2O', x ) );
6868
}
6969
if ( arguments.length > 1 ) {
7070
start = arguments[ 1 ];
7171
if ( !isInteger( start ) ) {
72-
throw new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );
72+
throw new TypeError( format( '1pF7f', start ) );
7373
}
7474
if ( arguments.length > 2 ) {
7575
end = arguments[ 2 ];
7676
if ( !isInteger( end ) ) {
77-
throw new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );
77+
throw new TypeError( format( '1pF2z', end ) );
7878
}
7979
} else {
8080
end = x.length;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@stdlib/array-base-slice": "^0.2.1",
4141
"@stdlib/assert-is-collection": "^0.2.1",
4242
"@stdlib/assert-is-integer": "^0.2.1",
43-
"@stdlib/string-format": "^0.2.1",
43+
"@stdlib/error-tools-fmtprodmsg": "^0.2.1",
4444
"@stdlib/types": "^0.3.2",
4545
"@stdlib/error-tools-fmtprodmsg": "^0.2.1"
4646
},

0 commit comments

Comments
 (0)
0