@@ -30,7 +30,7 @@ var isUndefined = require( '@stdlib/assert-is-undefined' );
30
30
var hasOwnProp = require ( '@stdlib/assert-has-own-property' ) ;
31
31
var getShape = require ( '@stdlib/ndarray-shape' ) ;
32
32
var base = require ( '@stdlib/ndarray-base-slice-to' ) ;
33
- var format = require ( '@stdlib/string-format ' ) ;
33
+ var format = require ( '@stdlib/error-tools-fmtprodmsg ' ) ;
34
34
35
35
36
36
// FUNCTIONS //
@@ -118,26 +118,26 @@ function sliceTo( x, stop ) {
118
118 } ;
119
119
nargs = arguments . length ;
120
120
if ( ! isndarrayLike ( x ) ) {
121
- throw new TypeError ( format ( 'invalid argument. First argument must be an ndarray. Value: `%s`. ' , x ) ) ;
121
+ throw new TypeError ( format ( '1mj4f ' , x ) ) ;
122
122
}
123
123
if ( isPlainObject ( arguments [ nargs - 1 ] ) ) {
124
124
nargs -= 1 ;
125
125
options = arguments [ nargs ] ;
126
126
if ( hasOwnProp ( options , 'strict' ) ) {
127
127
if ( ! isBoolean ( options . strict ) ) {
128
- throw new TypeError ( format ( 'invalid option. `%s` option must be a boolean. Option: `%s`. ' , 'strict' , options . strict ) ) ;
128
+ throw new TypeError ( format ( '1mj2o ' , 'strict' , options . strict ) ) ;
129
129
}
130
130
opts . strict = options . strict ;
131
131
}
132
132
sh = getShape ( x ) ;
133
133
if ( nargs === 1 && sh . length > 0 ) {
134
- throw new RangeError ( format ( 'invalid argument. Number of indices does not match the number of array dimensions. Array shape: (%s). Number of indices: %u. ' , sh . join ( ',' ) , 0 ) ) ;
134
+ throw new RangeError ( format ( '1mjFE ' , sh . join ( ',' ) , 0 ) ) ;
135
135
}
136
136
}
137
137
if ( isArrayLikeObject ( stop ) ) {
138
138
args = stop ;
139
139
if ( nargs > 2 ) {
140
- throw new Error ( 'invalid invocation. Too many arguments.' ) ;
140
+ throw new Error ( format ( '1mj0m' ) ) ;
141
141
}
142
142
} else {
143
143
args = [ ] ;
@@ -147,7 +147,7 @@ function sliceTo( x, stop ) {
147
147
}
148
148
for ( i = 0 ; i < args . length ; i ++ ) {
149
149
if ( isInvalidIndex ( args [ i ] ) ) {
150
- throw new TypeError ( format ( 'invalid argument. Each index argument must be either an integer, null, or undefined. Value: `%s`. ' , String ( args [ i ] ) ) ) ;
150
+ throw new TypeError ( format ( '1mjFF ' , String ( args [ i ] ) ) ) ;
151
151
}
152
152
}
153
153
return base ( x , args , opts . strict , false ) ;
0 commit comments