Skip to content

Commit d9bce8a

Browse files
committed
Update error messages
1 parent dc5cc1f commit d9bce8a

File tree

25 files changed

+34
-34
lines changed

25 files changed

+34
-34
lines changed

lib/node_modules/@stdlib/_tools/licenses/remove-header-file-list/lib/sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function removeHeader( files, header ) {
9696
}
9797
}
9898
} else if ( !isString( header ) && !isRegExp( header ) ) {
99-
throw new TypeError( format( 'invalid argument. Second argument must be either a string, regular expression, or an object whose keys are filename extensions and whose values are header strings or regular expressions. Value: `%s`.', header ) );
99+
throw new TypeError( format( 'invalid argument. Second argument must be either a string, a regular expression, or an object whose keys are filename extensions and whose values are header strings or regular expressions. Value: `%s`.', header ) );
100100
}
101101
header = normalizeHeader( header );
102102

lib/node_modules/@stdlib/_tools/lint/license-header-file-list/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function lint( files, header, clbk ) {
113113
}
114114
}
115115
} else if ( !isString( h ) && !isRegExp( h ) ) {
116-
throw new TypeError( format( 'invalid argument. Second argument must be either a string, regular expression, or an object whose keys are filename extensions and whose values are header strings or regular expressions. Value: `%s`.', h ) );
116+
throw new TypeError( format( 'invalid argument. Second argument must be either a string, a regular expression, or an object whose keys are filename extensions and whose values are header strings or regular expressions. Value: `%s`.', h ) );
117117
}
118118
}
119119
if ( !isFunction( cb ) ) {

lib/node_modules/@stdlib/_tools/lint/license-header-file-list/lib/sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function lint( files, header ) {
104104
}
105105
}
106106
} else if ( !isString( h ) && !isRegExp( h ) ) {
107-
throw new TypeError( format( 'invalid argument. Second argument must be either a string, regular expression, or an object whose keys are filename extensions and whose values are header strings or regular expressions. Value: `%s`.', h ) );
107+
throw new TypeError( format( 'invalid argument. Second argument must be either a string, a regular expression, or an object whose keys are filename extensions and whose values are header strings or regular expressions. Value: `%s`.', h ) );
108108
}
109109
} else {
110110
h = headers( SPDX );

lib/node_modules/@stdlib/_tools/lint/license-header-glob/lib/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function validate( opts, options ) {
9090
}
9191
}
9292
} else if ( !isString( opts.header ) && !isRegExp( opts.header ) ) {
93-
return new TypeError( format( 'invalid option. `%s` option must be either a string, regular expression, or an object whose keys are filename extensions and whose values are header strings or regular expressions. Option: `%s`.', 'header', opts.header ) );
93+
return new TypeError( format( 'invalid option. `%s` option must be either a string, a regular expression, or an object whose keys are filename extensions and whose values are header strings or regular expressions. Option: `%s`.', 'header', opts.header ) );
9494
}
9595
}
9696
return null;

lib/node_modules/@stdlib/datasets/sotu/lib/validate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ function validate( opts, options ) {
8585
return new TypeError( format( 'invalid option. `%s` option must be a positive integer array of length two. Option: `%s`.', 'range', opts.range ) );
8686
}
8787
if ( opts.range[ 0 ] < 1790 ) {
88-
return new RangeError( format( 'invalid option. `%s` cannot be less than `1790`. Option: `%s`.', 'range[0]', opts.range ) );
88+
return new RangeError( format( 'invalid option. `%s` option cannot be less than 1790. Option: `%s`.', 'range[0]', opts.range ) );
8989
}
9090
if ( opts.range[ 1 ] > 5000 ) {
91-
return new RangeError( format( 'invalid option. `%s` cannot be greater than `5000`. Option: `%s`.', 'range[1]', opts.range ) );
91+
return new RangeError( format( 'invalid option. `%s` option cannot be greater than 5000. Option: `%s`.', 'range[1]', opts.range ) );
9292
}
9393
}
9494
if ( hasOwnProp( options, 'party' ) ) {

lib/node_modules/@stdlib/net/http-server/lib/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function validate( opts, options ) {
5959
if ( hasOwnProp( options, 'port' ) ) {
6060
opts.port = options.port;
6161
if ( !isNonNegativeInteger( opts.port ) ) {
62-
return new TypeError( format( 'invalid option. `%s` must be a nonnegative integer. Option: `%s`.', 'port', opts.port ) );
62+
return new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'port', opts.port ) );
6363
}
6464
}
6565
if ( hasOwnProp( options, 'maxport' ) ) {

lib/node_modules/@stdlib/regexp/color-hexadecimal/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var MODES = [ 'full', 'shorthand', 'either' ];
5151
function reColorHexadecimal( mode ) {
5252
if ( arguments.length > 0 ) {
5353
if ( !contains( MODES, mode ) ) {
54-
throw new Error( format( 'invalid argument. Mode must be either `full`, `shorthand`, or `either`. Value: `%s`.', mode ) );
54+
throw new Error( format( 'invalid argument. Mode must be one of the following: "%s". Value: `%s`.', MODES.join( '", "' ), mode ) );
5555
}
5656
}
5757
if ( mode === 'shorthand' ) {

lib/node_modules/@stdlib/stats/anova1/lib/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function validate( opts, options ) {
5858
return new TypeError( format( 'invalid option. `%s` option must be a number. Option: `%s`.', 'alpha', opts.alpha ) );
5959
}
6060
if ( opts.alpha < 0.0 || opts.alpha > 1.0 ) {
61-
return new RangeError( format( 'invalid option. `%s` must be a number in [0,1]. Option: `%f`.', 'alpha' , alpha ) );
61+
return new RangeError( format( 'invalid option. `%s` option must be a number on the interval: [0, 1]. Option: `%f`.', 'alpha', opts.alpha ) );
6262
}
6363
}
6464
return null;

lib/node_modules/@stdlib/stats/bartlett-test/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function bartlett() {
134134
alpha = opts.alpha;
135135
}
136136
if ( alpha < 0.0 || alpha > 1.0 ) {
137-
throw new RangeError( format( 'invalid argument. Option `alpha` must be a number in the range 0 to 1. Value: `%f`.', alpha ) );
137+
throw new RangeError( format( 'invalid argument. `%s` option must be a number on the interval: [0, 1]. Value: `%f`.', 'alpha', alpha ) );
138138
}
139139

140140
stat = ( ( nSum * ln( vSum ) ) - lnv );

lib/node_modules/@stdlib/stats/binomial-test/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,15 @@ function binomialTest() {
139139
alpha = opts.alpha;
140140
}
141141
if ( alpha < 0.0 || alpha > 1.0 ) {
142-
throw new RangeError( format( 'invalid argument. Option `alpha` must be a number in the range 0 to 1. Value: `%f`.', alpha ) );
142+
throw new RangeError( format( 'invalid argument. `%s` option must be a number on the interval: [0, 1]. Value: `%f`.', 'alpha', alpha ) );
143143
}
144144
if ( opts.p === void 0 ) {
145145
p = 0.5;
146146
} else {
147147
p = opts.p;
148148
}
149149
if ( p < 0.0 || p > 1.0 ) {
150-
throw new RangeError( format( 'invalid argument. Option `%s` must be a probability. Value: `%f`.', 'p', p ) );
150+
throw new RangeError( format( 'invalid argument. `%s` option must be a probability. Value: `%f`.', 'p', p ) );
151151
}
152152

153153
alt = opts.alternative || 'two-sided';

0 commit comments

Comments
 (0)