@@ -34,7 +34,7 @@ var numel = require( '@stdlib/ndarray-base-numel' );
34
34
var slice = require ( '@stdlib/ndarray-base-slice' ) ;
35
35
var nextCartesianIndex = require ( '@stdlib/ndarray-base-next-cartesian-index' ) . assign ;
36
36
var args2multislice = require ( '@stdlib/slice-base-args2multislice' ) ;
37
- var format = require ( '@stdlib/string-format ' ) ;
37
+ var format = require ( '@stdlib/error-tools-fmtprodmsg ' ) ;
38
38
39
39
40
40
// MAIN //
@@ -91,26 +91,26 @@ function nditerSubarrays( x, ndims ) {
91
91
var i ;
92
92
93
93
if ( ! isndarrayLike ( x ) ) {
94
- throw new TypeError ( format ( 'invalid argument. First argument must be an ndarray. Value: `%s`. ' , x ) ) ;
94
+ throw new TypeError ( format ( 'null4f ' , x ) ) ;
95
95
}
96
96
if ( ! isPositiveInteger ( ndims ) ) {
97
- throw new TypeError ( format ( 'invalid argument. Second argument must be a positive integer. Value: `%s`. ' , ndims ) ) ;
97
+ throw new TypeError ( format ( 'null45 ' , ndims ) ) ;
98
98
}
99
99
opts = {
100
100
'writable' : false
101
101
} ;
102
102
if ( arguments . length > 2 ) {
103
103
options = arguments [ 2 ] ;
104
104
if ( ! isPlainObject ( options ) ) {
105
- throw new TypeError ( format ( 'invalid argument. Options argument must be an object. Value: `%s`. ' , options ) ) ;
105
+ throw new TypeError ( format ( 'null2V ' , options ) ) ;
106
106
}
107
107
if ( hasOwnProp ( options , 'readonly' ) ) {
108
108
if ( ! isBoolean ( options . readonly ) ) {
109
- throw new TypeError ( format ( 'invalid option. `%s` option must be a boolean. Option: `%s`. ' , 'readonly' , options . readonly ) ) ;
109
+ throw new TypeError ( format ( 'null2o ' , 'readonly' , options . readonly ) ) ;
110
110
}
111
111
opts . writable = ! options . readonly ;
112
112
if ( opts . writable && isReadOnly ( x ) ) {
113
- throw new Error ( format ( 'invalid option. Cannot write to read-only array. ' ) ) ;
113
+ throw new Error ( format ( 'nullF4 ' ) ) ;
114
114
}
115
115
}
116
116
}
0 commit comments