File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 23
23
var isInteger = require ( '@stdlib/assert-is-integer' ) . isPrimitive ;
24
24
var isCollection = require ( '@stdlib/assert-is-collection' ) ;
25
25
var getStride = require ( '@stdlib/ndarray-base-stride' ) ;
26
- var format = require ( '@stdlib/string-format ' ) ;
26
+ var format = require ( '@stdlib/error-tools-fmtprodmsg ' ) ;
27
27
28
28
29
29
// MAIN //
@@ -49,17 +49,17 @@ function stride( x, dim ) {
49
49
50
50
// Note: we intentionally avoid rigorous ndarray checks to minimize performance impacts. This obviously means that non-ndarray-like objects can sneak through, but this is likely all right for the purposes of this function...
51
51
if ( typeof x !== 'object' || x === null || ! isCollection ( x . shape ) ) {
52
- throw new TypeError ( format ( 'invalid argument. First argument must be an ndarray. Value: `%s`. ' , x ) ) ;
52
+ throw new TypeError ( format ( '1ml4f ' , x ) ) ;
53
53
}
54
54
if ( ! isInteger ( dim ) ) {
55
- throw new TypeError ( format ( 'invalid argument. Second argument must be an integer. Value: `%s`. ' , dim ) ) ;
55
+ throw new TypeError ( format ( '1ml7f ' , dim ) ) ;
56
56
}
57
57
st = getStride ( x , dim ) ;
58
58
if ( isInteger ( st ) ) {
59
59
return st ;
60
60
}
61
61
// As ndarrays must have integer-valued strides, if the returned "stride" value is not integer-valued, assume we haven't been provided an ndarray:
62
- throw new TypeError ( format ( 'invalid argument. First argument must be an ndarray. Value: `%s`. ' , x ) ) ;
62
+ throw new TypeError ( format ( '1ml4f ' , x ) ) ;
63
63
}
64
64
65
65
Original file line number Diff line number Diff line change 40
40
"@stdlib/assert-is-collection" : " ^0.2.2" ,
41
41
"@stdlib/assert-is-integer" : " ^0.2.2" ,
42
42
"@stdlib/ndarray-base-stride" : " ^0.2.2" ,
43
- "@stdlib/string-format " : " ^0.2.2" ,
43
+ "@stdlib/error-tools-fmtprodmsg " : " ^0.2.2" ,
44
44
"@stdlib/types" : " ^0.4.1" ,
45
45
"@stdlib/error-tools-fmtprodmsg" : " ^0.2.2"
46
46
},
You can’t perform that action at this time.
0 commit comments