@@ -30,7 +30,7 @@ var MultiSlice = require( '@stdlib/slice-multi' );
30
30
var args2multislice = require ( '@stdlib/slice-base-args2multislice' ) ;
31
31
var base = require ( '@stdlib/ndarray-base-slice' ) ;
32
32
var getShape = require ( '@stdlib/ndarray-shape' ) ;
33
- var format = require ( '@stdlib/string-format ' ) ;
33
+ var format = require ( '@stdlib/error-tools-fmtprodmsg ' ) ;
34
34
35
35
36
36
// MAIN //
@@ -98,32 +98,32 @@ function slice( x, s ) {
98
98
} ;
99
99
nargs = arguments . length ;
100
100
if ( ! isndarrayLike ( x ) ) {
101
- throw new TypeError ( format ( 'invalid argument. First argument must be an ndarray. Value: `%s`. ' , x ) ) ;
101
+ throw new TypeError ( format ( '1jV4f ' , x ) ) ;
102
102
}
103
103
if ( isPlainObject ( arguments [ nargs - 1 ] ) ) {
104
104
nargs -= 1 ;
105
105
options = arguments [ nargs ] ;
106
106
if ( hasOwnProp ( options , 'strict' ) ) {
107
107
if ( ! isBoolean ( options . strict ) ) {
108
- throw new TypeError ( format ( 'invalid option. `%s` option must be a boolean. Option: `%s`. ' , 'strict' , options . strict ) ) ;
108
+ throw new TypeError ( format ( '1jV2o ' , 'strict' , options . strict ) ) ;
109
109
}
110
110
opts . strict = options . strict ;
111
111
}
112
112
sh = getShape ( x ) ;
113
113
if ( nargs === 1 && sh . length > 0 ) {
114
- throw new RangeError ( format ( 'invalid argument. Number of slice dimensions does not match the number of array dimensions. Array shape: (%s). Slice dimensions: %u. ' , sh . join ( ',' ) , 0 ) ) ;
114
+ throw new RangeError ( format ( '1jVEt ' , sh . join ( ',' ) , 0 ) ) ;
115
115
}
116
116
}
117
117
if ( isMultiSlice ( s ) ) {
118
118
S = s ;
119
119
if ( nargs > 2 ) {
120
- throw new Error ( 'invalid invocation. Too many arguments.' ) ;
120
+ throw new Error ( format ( '1jV0m' ) ) ;
121
121
}
122
122
} else {
123
123
if ( isArrayLikeObject ( s ) ) {
124
124
args = s ;
125
125
if ( nargs > 2 ) {
126
- throw new Error ( 'invalid invocation. Too many arguments.' ) ;
126
+ throw new Error ( format ( '1jV0m' ) ) ;
127
127
}
128
128
} else {
129
129
args = [ ] ;
@@ -139,7 +139,7 @@ function slice( x, s ) {
139
139
try {
140
140
new MultiSlice ( args [ i ] ) ; // eslint-disable-line no-new
141
141
} catch ( err ) { // eslint-disable-line no-unused-vars
142
- throw new TypeError ( format ( 'invalid argument. Slice arguments must be either a Slice, integer, null, or undefined. Value: `%s`. ' , String ( args [ i ] ) ) ) ;
142
+ throw new TypeError ( format ( '1jVEu ' , String ( args [ i ] ) ) ) ;
143
143
}
144
144
}
145
145
}
0 commit comments