Skip to content

Commit 2601b4c

Browse files
committed
Update error messages
1 parent d3c7893 commit 2601b4c

File tree

24 files changed

+32
-26
lines changed

24 files changed

+32
-26
lines changed

lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest-quote-props/test/fixtures/valid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ test = {
147147
' throw new TypeError( \'invalid argument. Must provide an array of nonnegative integers. Value: `\' + time + \'`.\' );',
148148
' }',
149149
' if ( time.length !== 2 ) {',
150-
' throw new RangeError( \'invalid argument. Input array must have length `2`.\' );',
150+
' throw new RangeError( \'invalid argument. Input array must contain two elements.\' );',
151151
' }',
152152
' sec = now[ 0 ] - time[ 0 ];',
153153
' ns = now[ 1 ] - time[ 1 ];',

lib/node_modules/@stdlib/_tools/github/create-issue/lib/validate.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
2626
var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
2727
var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
2828
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
29+
var indexOf = require( '@stdlib/utils/index-of' );
2930
var format = require( '@stdlib/string/format' );
3031

3132

33+
// VARIABLES //
34+
35+
var PROTOCOLS = [ 'http', 'https' ];
36+
37+
3238
// MAIN //
3339

3440
/**
@@ -61,8 +67,8 @@ function validate( opts, options ) {
6167
if ( !isString( opts.protocol ) ) {
6268
return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'protocol', opts.protocol ) );
6369
}
64-
if ( opts.protocol !== 'http' && opts.protocol !== 'https' ) {
65-
return new Error( format( 'invalid option. `protocol` must be either `http` or `https`. Option: `%s`.', opts.protocol ) );
70+
if ( indexOf( PROTOCOLS, opts.protocol ) === -1 ) {
71+
return new Error( format( 'invalid option. `%s` must be one of the following: "%s". Option: `%s`.', 'protocol', PROTOCOLS.join( '", "' ), opts.protocol ) );
6672
}
6773
}
6874
if ( hasOwnProp( options, 'hostname' ) ) {

lib/node_modules/@stdlib/math/tools/unary/lib/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var DTYPES = dtypes();
5858
*/
5959
function validate( opts, options ) {
6060
if ( !isPlainObject( options ) ) {
61-
return new TypeError( format( 'invalid argument. Options argument must be a plain object. Value: `%s`.', options ) );
61+
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
6262
}
6363
if ( hasOwnProp( options, 'dtype' ) ) {
6464
opts.dtype = options.dtype;

lib/node_modules/@stdlib/math/tools/unary/lib/validate_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var POLICIES = require( './policies.json' );
5050
*/
5151
function validate( opts, options ) {
5252
if ( !isPlainObject( options ) ) {
53-
return new TypeError( format( 'invalid argument. Options argument must be a plain object. Value: `%s`.', options ) );
53+
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
5454
}
5555
if ( hasOwnProp( options, 'output_dtype_policy' ) ) {
5656
opts.policy = options.output_dtype_policy;

lib/node_modules/@stdlib/math/tools/unary/lib/validate_table.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function validate( out, table ) {
6262
var i;
6363

6464
if ( !isPlainObject( table ) ) {
65-
return new TypeError( format( 'invalid argument. Resolution table must be a plain object. Value: `%s`.', table ) );
65+
return new TypeError( format( 'invalid argument. Resolution table must be an object. Value: `%s`.', table ) );
6666
}
6767
fields = objectKeys( out );
6868
for ( i = 0; i < fields.length; i++ ) {

lib/node_modules/@stdlib/plot/base/ctor/lib/props/engine/set.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var debug = logger( 'plot:base:set:engine' );
4343
function set( engine ) {
4444
/* eslint-disable no-invalid-this */
4545
if ( !contains( ENGINES, engine ) ) {
46-
throw new TypeError( format( 'invalid value. `%s` must be one of "%s". Value: `%s`.', 'engine', ENGINES.join( '", "' ), engine ) );
46+
throw new TypeError( format( 'invalid value. `%s` must be one of the following: "%s". Value: `%s`.', 'engine', ENGINES.join( '", "' ), engine ) );
4747
}
4848
if ( engine !== this._engine ) {
4949
debug( 'Current value: %s.', this._engine );

lib/node_modules/@stdlib/plot/base/ctor/lib/props/x-axis-orient/set.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var debug = logger( 'plot:base:set:x-axis-orient' );
4343
function set( orientation ) {
4444
/* eslint-disable no-invalid-this */
4545
if ( indexOf( ORIENTATIONS, orientation ) === -1 ) {
46-
throw new TypeError( format( 'invalid value. `%s` must be one of "%s". Value: `%s`.', 'xAxisOrient', ORIENTATIONS.join( '", "' ), orientation ) );
46+
throw new TypeError( format( 'invalid value. `%s` must be one of the following: "%s". Value: `%s`.', 'xAxisOrient', ORIENTATIONS.join( '", "' ), orientation ) );
4747
}
4848
if ( orientation !== this._xAxisOrient ) {
4949
debug( 'Current value: %s.', this._xAxisOrient );

lib/node_modules/@stdlib/plot/base/ctor/lib/props/y-axis-orient/set.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var debug = logger( 'plot:base:set:y-axis-orient' );
4343
function set( orientation ) {
4444
/* eslint-disable no-invalid-this */
4545
if ( indexOf( ORIENTATIONS, orientation ) === -1 ) {
46-
throw new TypeError( format( 'invalid value. `%s` must be one of "%s". Value: `%s`.', 'yAxisOrient', ORIENTATIONS.join( '", "' ), orientation ) );
46+
throw new TypeError( format( 'invalid value. `%s` must be one of the following: "%s". Value: `%s`.', 'yAxisOrient', ORIENTATIONS.join( '", "' ), orientation ) );
4747
}
4848
if ( orientation !== this._yAxisOrient ) {
4949
debug( 'Current value: %s.', this._yAxisOrient );

lib/node_modules/@stdlib/plot/components/svg/axis/lib/validators/orientation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var ORIENTATIONS = require( './../etc/orientations.json' );
3636
*/
3737
function test( v ) {
3838
if ( indexOf( ORIENTATIONS, v ) === -1 ) {
39-
return new TypeError( format( 'invalid value. `%s` must be one of "%s". Value: `%s`.', 'orientation', ORIENTATIONS.join( '", "' ), v ) );
39+
return new TypeError( format( 'invalid value. `%s` must be one of the following: "%s". Value: `%s`.', 'orientation', ORIENTATIONS.join( '", "' ), v ) );
4040
}
4141
return null;
4242
}

lib/node_modules/@stdlib/plot/components/svg/rug/lib/props/orientation/set.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var debug = logger( 'rug:set:orientation' );
4343
function set( orient ) {
4444
/* eslint-disable no-invalid-this */
4545
if ( indexOf( ORIENTATIONS, orient ) === -1 ) {
46-
throw new Error( format( 'invalid value. `%s` must be one of "%s". Value: `%s`.', 'orientation', ORIENTATIONS.join( '", "' ), orient ) );
46+
throw new Error( format( 'invalid value. `%s` must be one of the following: "%s". Value: `%s`.', 'orientation', ORIENTATIONS.join( '", "' ), orient ) );
4747
}
4848
if ( orient !== this._orientation ) {
4949
debug( 'Current value: %d.', this._orientation );

0 commit comments

Comments
 (0)