You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewTypeError('invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `'+buf+'`.');
263
264
}
264
265
if(!isFunction(buf[ITERATOR_SYMBOL])){
265
-
thrownewTypeError('invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `'+buf+'`.');
266
+
thrownewTypeError(format('invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.',buf));
266
267
}
267
268
buf=buf[ITERATOR_SYMBOL]();
268
269
if(!isFunction(buf.next)){
@@ -279,11 +280,11 @@ function Complex128Array() {
279
280
}else{
280
281
buf=arguments[0];
281
282
if(!isArrayBuffer(buf)){
282
-
thrownewTypeError('invalid argument. First argument must be an array buffer. Value: `'+buf+'`.');
283
+
thrownewTypeError(format('invalid argument. First argument must be an array buffer. Value: `%s`.',buf));
283
284
}
284
285
byteOffset=arguments[1];
285
286
if(!isNonNegativeInteger(byteOffset)){
286
-
thrownewTypeError('invalid argument. Byte offset must be a nonnegative integer. Value: `'+byteOffset+'`.');
287
+
thrownewTypeError(format('invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.',byteOffset));
287
288
}
288
289
if(!isInteger(byteOffset/BYTES_PER_ELEMENT)){
289
290
thrownewRangeError('invalid argument. Byte offset must be a multiple of '+BYTES_PER_ELEMENT+'. Value: `'+byteOffset+'`.');
@@ -297,7 +298,7 @@ function Complex128Array() {
297
298
}else{
298
299
len=arguments[2];
299
300
if(!isNonNegativeInteger(len)){
300
-
thrownewTypeError('invalid argument. Length must be a nonnegative integer. Value: `'+len+'`.');
301
+
thrownewTypeError(format('invalid argument. Length must be a nonnegative integer. Value: `%s`.',len));
thrownewRangeError('invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `'+(len*BYTES_PER_ELEMENT)+'`.');
thrownewTypeError('invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `'+v+'`.');
437
+
thrownewTypeError(format('invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.',v));
thrownewTypeError('invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `'+v+'`.');
484
+
thrownewTypeError(format('invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.',v));
thrownewTypeError('invalid invocation. `this` is not a complex number array.');
830
831
}
831
832
if(!isNonNegativeInteger(idx)){
832
-
thrownewTypeError('invalid argument. Must provide a nonnegative integer. Value: `'+idx+'`.');
833
+
thrownewTypeError(format('invalid argument. Must provide a nonnegative integer. Value: `%s`.',idx));
833
834
}
834
835
if(idx>=this._length){
835
836
return;
@@ -938,7 +939,7 @@ setReadOnly( Complex128Array.prototype, 'set', function set( value ) {
938
939
if(arguments.length>1){
939
940
idx=arguments[1];
940
941
if(!isNonNegativeInteger(idx)){
941
-
thrownewTypeError('invalid argument. Index argument must be a nonnegative integer. Value: `'+idx+'`.');
942
+
thrownewTypeError(format('invalid argument. Index argument must be a nonnegative integer. Value: `%s`.',idx));
942
943
}
943
944
}else{
944
945
idx=0;
@@ -1044,7 +1045,7 @@ setReadOnly( Complex128Array.prototype, 'set', function set( value ) {
1044
1045
}
1045
1046
return;
1046
1047
}
1047
-
thrownewTypeError('invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `'+value+'`.');
1048
+
thrownewTypeError(format('invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.',value));
thrownewTypeError('invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `'+buf+'`.');
263
264
}
264
265
if(!isFunction(buf[ITERATOR_SYMBOL])){
265
-
thrownewTypeError('invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `'+buf+'`.');
266
+
thrownewTypeError(format('invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.',buf));
266
267
}
267
268
buf=buf[ITERATOR_SYMBOL]();
268
269
if(!isFunction(buf.next)){
@@ -279,11 +280,11 @@ function Complex64Array() {
279
280
}else{
280
281
buf=arguments[0];
281
282
if(!isArrayBuffer(buf)){
282
-
thrownewTypeError('invalid argument. First argument must be an array buffer. Value: `'+buf+'`.');
283
+
thrownewTypeError(format('invalid argument. First argument must be an array buffer. Value: `%s`.',buf));
283
284
}
284
285
byteOffset=arguments[1];
285
286
if(!isNonNegativeInteger(byteOffset)){
286
-
thrownewTypeError('invalid argument. Byte offset must be a nonnegative integer. Value: `'+byteOffset+'`.');
287
+
thrownewTypeError(format('invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.',byteOffset));
287
288
}
288
289
if(!isInteger(byteOffset/BYTES_PER_ELEMENT)){
289
290
thrownewRangeError('invalid argument. Byte offset must be a multiple of '+BYTES_PER_ELEMENT+'. Value: `'+byteOffset+'`.');
@@ -297,7 +298,7 @@ function Complex64Array() {
297
298
}else{
298
299
len=arguments[2];
299
300
if(!isNonNegativeInteger(len)){
300
-
thrownewTypeError('invalid argument. Length must be a nonnegative integer. Value: `'+len+'`.');
301
+
thrownewTypeError(format('invalid argument. Length must be a nonnegative integer. Value: `%s`.',len));
thrownewRangeError('invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `'+(len*BYTES_PER_ELEMENT)+'`.');
thrownewTypeError('invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `'+v+'`.');
437
+
thrownewTypeError(format('invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.',v));
thrownewTypeError('invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `'+v+'`.');
484
+
thrownewTypeError(format('invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.',v));
thrownewTypeError('invalid invocation. `this` is not a complex number array.');
830
831
}
831
832
if(!isNonNegativeInteger(idx)){
832
-
thrownewTypeError('invalid argument. Must provide a nonnegative integer. Value: `'+idx+'`.');
833
+
thrownewTypeError(format('invalid argument. Must provide a nonnegative integer. Value: `%s`.',idx));
833
834
}
834
835
if(idx>=this._length){
835
836
return;
@@ -938,7 +939,7 @@ setReadOnly( Complex64Array.prototype, 'set', function set( value ) {
938
939
if(arguments.length>1){
939
940
idx=arguments[1];
940
941
if(!isNonNegativeInteger(idx)){
941
-
thrownewTypeError('invalid argument. Index argument must be a nonnegative integer. Value: `'+idx+'`.');
942
+
thrownewTypeError(format('invalid argument. Index argument must be a nonnegative integer. Value: `%s`.',idx));
942
943
}
943
944
}else{
944
945
idx=0;
@@ -1044,7 +1045,7 @@ setReadOnly( Complex64Array.prototype, 'set', function set( value ) {
1044
1045
}
1045
1046
return;
1046
1047
}
1047
-
thrownewTypeError('invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `'+value+'`.');
1048
+
thrownewTypeError(format('invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.',value));
@@ -85,7 +86,7 @@ function incrBinaryClassification( N, options ) {
85
86
varerr;
86
87
87
88
if(!isPositiveInteger(N)){
88
-
thrownewTypeError('invalid argument. First argument must be a positive integer. Value: `'+N+'`.');
89
+
thrownewTypeError(format('invalid argument. First argument must be a positive integer. Value: `%s`.',N));
89
90
}
90
91
opts={
91
92
'intercept': true,
@@ -136,10 +137,10 @@ function incrBinaryClassification( N, options ) {
136
137
returnmodel.coefficients;
137
138
}
138
139
if(!isVectorLike(x)){
139
-
thrownewTypeError('invalid argument. First argument must be a one-dimensional ndarray. Value: `'+x+'`.');
140
+
thrownewTypeError(format('invalid argument. First argument must be a one-dimensional ndarray. Value: `%s`.',x));
140
141
}
141
142
if(y!==-1&&y!==1){
142
-
thrownewTypeError('invalid argument. Second argument must be either +1 or -1. Value: `'+y+'`.');
143
+
thrownewTypeError(format('invalid argument. Second argument must be either +1 or -1. Value: `%s`.',y));
143
144
}
144
145
if(x.shape[0]!==model.nfeatures){
145
146
thrownewTypeError('invalid argument. First argument must be a one-dimensional ndarray of length '+model.nfeatures+'. Actual length: `'+x.shape[0]+'`.');
@@ -180,7 +181,7 @@ function incrBinaryClassification( N, options ) {
180
181
varsh;
181
182
vart;
182
183
if(!isndarrayLike(X)){
183
-
thrownewTypeError('invalid argument. First argument must be an ndarray. Value: `'+X+'`.');
184
+
thrownewTypeError(format('invalid argument. First argument must be an ndarray. Value: `%s`.',X));
184
185
}
185
186
sh=X.shape;
186
187
if(sh[sh.length-1]!==N){
@@ -193,7 +194,7 @@ function incrBinaryClassification( N, options ) {
193
194
thrownewError('invalid argument. Second argument is incompatible with model loss function. Probability predictions are only supported when the loss function is either `log` or `modifiedHuber`. Model loss function: `'+opts.loss+'`.');
194
195
}
195
196
}elseif(type!=='label'&&type!=='linear'){
196
-
thrownewTypeError('invalid argument. Second argument must be a string value equal to either \'label\', \'probability\', or \'linear\'. Value: `'+type+'`.');
197
+
thrownewTypeError(format('invalid argument. Second argument must be a string value equal to either \'label\', \'probability\', or \'linear\'. Value: `%s`.',type));
0 commit comments