Skip to content

Commit 70c6f7a

Browse files
committed
Update error messages
1 parent c0b0bbe commit 70c6f7a

47 files changed

Lines changed: 55 additions & 55 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/node_modules/@stdlib/_tools/bundle/pkg-list/lib/validate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function validate( opts, options ) {
7575
return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'namespace', opts.namespace ) );
7676
}
7777
if ( indexOf( NS, opts.namespace ) === -1 ) {
78-
return new RangeError( format( 'invalid option. `%s` option must be one of the following: `[%s]`.', 'namespace', NS.join( ',' ) ) );
78+
return new RangeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'namespace', NS.join( '", "' ), opts.namespace ) );
7979
}
8080
}
8181
if ( hasOwnProp( options, 'bundler' ) ) {
@@ -84,7 +84,7 @@ function validate( opts, options ) {
8484
return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'bundler', opts.bundler ) );
8585
}
8686
if ( indexOf( BUNDLERS, opts.bundler ) === -1 ) {
87-
return new RangeError( format( 'invalid option. `%s` option must be one of the following: `[%s]`. Option: `%s`.', 'bundler', BUNDLERS.join( ',' ), opts.bundler ) );
87+
return new RangeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'bundler', BUNDLERS.join( '", "' ), opts.bundler ) );
8888
}
8989
}
9090
if ( hasOwnProp( options, 'requireName' ) ) {

lib/node_modules/@stdlib/_tools/github/get/lib/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function validate( opts, options ) {
8989
if ( hasOwnProp( options, 'last_page' ) ) {
9090
opts.last_page = options.last_page;
9191
if ( !isPositiveInteger( opts.last_page ) && opts.last_page !== 'last' ) {
92-
return new TypeError( format( 'invalid option. `%s` option must be a positive integer or \'last\'. Option: `%s`.', 'last_page', opts.last_page ) );
92+
return new TypeError( format( 'invalid option. `%s` option must be a positive integer or "last". Option: `%s`.', 'last_page', opts.last_page ) );
9393
}
9494
}
9595
if ( hasOwnProp( options, 'per_page' ) ) {

lib/node_modules/@stdlib/_tools/github/rank-users/lib/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function validate( opts, options ) {
6767
return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'method', opts.method ) );
6868
}
6969
if ( methods[ opts.method ] === void 0 ) {
70-
return new Error( format( 'invalid option. Unrecognized `%s` option. Must be one of the following: [%s]. Option: `%s`.', 'method', METHODS, opts.method ) );
70+
return new Error( format( 'invalid option. Unrecognized `%s` option. Must be one of the following: "%s". Option: `%s`.', 'method', METHODS.join( '", "' ), opts.method ) );
7171
}
7272
}
7373
return null;

lib/node_modules/@stdlib/array/complex128/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ function Complex128Array() {
267267
}
268268
buf = buf[ ITERATOR_SYMBOL ]();
269269
if ( !isFunction( buf.next ) ) {
270-
throw new TypeError( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable.' );
270+
throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );
271271
}
272272
buf = fromIterator( buf );
273273
if ( buf instanceof Error ) {

lib/node_modules/@stdlib/array/complex64/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ function Complex64Array() {
267267
}
268268
buf = buf[ ITERATOR_SYMBOL ]();
269269
if ( !isFunction( buf.next ) ) {
270-
throw new TypeError( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable.' );
270+
throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );
271271
}
272272
buf = fromIterator( buf );
273273
if ( buf instanceof Error ) {

lib/node_modules/@stdlib/array/datespace/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function datespace( start, stop, length, options ) {
152152
throw new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'round', opts.round ) );
153153
}
154154
if ( rounders.indexOf( opts.round ) === -1 ) {
155-
throw new Error( format( 'invalid option. `%s` option must be one of [%s].', 'round', rounders.join( ',' ) ) );
155+
throw new Error( format( 'invalid option. `%s` option must be one of the following: "%s".', 'round', rounders.join( '", "' ) ) );
156156
}
157157
}
158158
}

lib/node_modules/@stdlib/array/filled-by/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ function filledarrayBy() {
345345
}
346346
arg = arg[ ITERATOR_SYMBOL ]();
347347
if ( !isFunction( arg.next ) ) {
348-
throw new TypeError( 'invalid argument. Must provide a length, typed array, array-like object, or an iterable.' );
348+
throw new TypeError( format( 'invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );
349349
}
350350
return filledArrayIterator( arg, clbk, thisArg );
351351
}
@@ -372,7 +372,7 @@ function filledarrayBy() {
372372
}
373373
arg = arg[ ITERATOR_SYMBOL ]();
374374
if ( !isFunction( arg.next ) ) {
375-
throw new TypeError( 'invalid argument. Must provide a length, typed array, array-like object, or an iterable.' );
375+
throw new TypeError( format( 'invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );
376376
}
377377
arr = new ctor( iterLength( arg ) );
378378
} else {

lib/node_modules/@stdlib/array/filled/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ function filledarray() {
221221
}
222222
arg = arg[ ITERATOR_SYMBOL ]();
223223
if ( !isFunction( arg.next ) ) {
224-
throw new TypeError( 'invalid argument. Must provide a length, typed array, array-like object, or an iterable.' );
224+
throw new TypeError( format( 'invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );
225225
}
226226
return filledIterator( arg, value );
227227
}
@@ -251,7 +251,7 @@ function filledarray() {
251251
}
252252
arg = arg[ ITERATOR_SYMBOL ]();
253253
if ( !isFunction( arg.next ) ) {
254-
throw new TypeError( 'invalid argument. Must provide a length, typed array, array-like object, or an iterable.' );
254+
throw new TypeError( format( 'invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );
255255
}
256256
arr = new ctor( iterLength( arg ) );
257257
} else {

lib/node_modules/@stdlib/assert/is-between-array/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ function isBetweenArray( value, a, b, left, right ) {
6868
var i;
6969
if ( arguments.length > 3 ) {
7070
if ( left !== 'closed' && left !== 'open' ) {
71-
throw new TypeError( format( 'invalid argument. `left` must be one of the following strings: \'closed\' or \'open\'. Value: `%s`.', left ) );
71+
throw new TypeError( format( 'invalid argument. `left` must be one of the following: "closed" or "open". Value: `%s`.', left ) );
7272
}
7373
if ( right !== 'closed' && right !== 'open' ) {
74-
throw new TypeError( format( 'invalid argument. `right` must be one of the following strings: \'closed\' or \'open\'. Value: `%s`.', right ) );
74+
throw new TypeError( format( 'invalid argument. `right` must be one of the following: "closed" or "open". Value: `%s`.', right ) );
7575
}
7676
}
7777
if ( !isCollection( value ) ) {

lib/node_modules/@stdlib/assert/is-between/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ var format = require( '@stdlib/string/format' );
6464
function isBetween( value, a, b, left, right ) {
6565
if ( arguments.length > 3 ) {
6666
if ( left !== 'closed' && left !== 'open' ) {
67-
throw new TypeError( format( 'invalid argument. `left` must be one of the following strings: \'closed\' or \'open\'. Value: `%s`.', left ) );
67+
throw new TypeError( format( 'invalid argument. `left` must be one of the following: "closed" or "open". Value: `%s`.', left ) );
6868
}
6969
if ( right !== 'closed' && right !== 'open' ) {
70-
throw new TypeError( format( 'invalid argument. `right` must be one of the following strings: \'closed\' or \'open\'. Value: `%s`.', right ) );
70+
throw new TypeError( format( 'invalid argument. `right` must be one of the following: "closed" or "open". Value: `%s`.', right ) );
7171
}
7272
}
7373
if ( left === 'closed' || left === void 0 ) {

0 commit comments

Comments
 (0)