Skip to content

Commit caa94dd

Browse files
committed
Harmonize and fix error messages
1 parent 2ea2b71 commit caa94dd

File tree

125 files changed

+135
-135
lines changed

Some content is hidden

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

125 files changed

+135
-135
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ test = {
139139
' throw new TypeError( \'invalid argument. Callback argument must be a function. Value: `\' + cb + \'`\' );',
140140
' }',
141141
' if ( !isObject( opts ) ) {',
142-
' throw new TypeError( \'invalid argument. Options must be an object. Value: `\' + opts + \'`\' );',
142+
' throw new TypeError( \'invalid argument. Options argument must be an object. Value: `\' + opts + \'`\' );',
143143
' }',
144144
' if ( hasOwnProp( opts, \'k\' ) ) {',
145145
' k = opts.k;',

lib/node_modules/@stdlib/_tools/github/workflow-runs/lib/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function validate( opts, options ) {
106106
!contains( STATUS_VALUES, opts.status ) &&
107107
!contains( CONCLUSION_VALUES, opts.status )
108108
) {
109-
return new TypeError( format( 'invalid option. `%` soption must be a either one of %s or %s. Option: `%s`.', 'status', STATUS_VALUES.join( ', ' ), CONCLUSION_VALUES.join( ', '), opts.status ) );
109+
return new TypeError( format( 'invalid option. `%s` option must be a either one of %s or %s. Option: `%s`.', 'status', STATUS_VALUES.join( ', ' ), CONCLUSION_VALUES.join( ', '), opts.status ) );
110110
}
111111
}
112112
return null;

lib/node_modules/@stdlib/_tools/markdown/to-html/lib/convert.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ var hTransform = rehype()
5555
* @param {(string|Buffer)} markdown - markdown to convert
5656
* @param {string} [base='/docs/api/develop/'] - base path for internal URLs
5757
* @param {Function} clbk - callback to invoke on completion
58-
* @throws {TypeError} first argument must be either a string or a Buffer
58+
* @throws {TypeError} first argument must be either a string or Buffer
5959
* @throws {TypeError} last argument must be a function
6060
*
6161
* @example
@@ -78,7 +78,7 @@ function convert( markdown ) {
7878
!isString( markdown ) &&
7979
!isBuffer( markdown )
8080
) {
81-
throw new TypeError( format( 'invalid argument. First argument must be either a string or a Buffer. Value: `%s`.', markdown ) );
81+
throw new TypeError( format( 'invalid argument. First argument must be either a string or Buffer. Value: `%s`.', markdown ) );
8282
}
8383
if ( arguments.length === 2 ) {
8484
base = '/docs/api/develop/';

lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-urls-github/lib/attacher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function attacher( options ) {
5656
}
5757
if ( hasOwnProp( options, 'branch' ) ) {
5858
if ( !isString( options.branch ) ) {
59-
throw new TypeError( format( 'invalid option. `%s` option must be a string. Value: `%s`.', 'branch', options.branch ) );
59+
throw new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'branch', options.branch ) );
6060
}
6161
opts.branch = options.branch;
6262
}

lib/node_modules/@stdlib/_tools/remark/plugins/remark-stdlib-urls-www/lib/attacher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function attacher( options ) {
5656
}
5757
if ( hasOwnProp( options, 'base' ) ) {
5858
if ( !isString( options.base ) ) {
59-
throw new TypeError( format( 'invalid option. `%s` option must be a string. Value: `%s`.', 'base', options.base ) );
59+
throw new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'base', options.base ) );
6060
}
6161
opts.base = options.base;
6262
}

lib/node_modules/@stdlib/_tools/remark/plugins/remark-svg-equations-to-file/lib/attacher.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ function attacher( options ) {
5757
}
5858
if ( hasOwnProp( options, 'dir' ) ) {
5959
if ( !isString( options.dir ) ) {
60-
throw new TypeError( format( 'invalid option. `%s` option must be a string. Value: `%s`.', 'dir', options.dir ) );
60+
throw new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'dir', options.dir ) );
6161
}
6262
opts.dir = options.dir;
6363
}
6464
if ( hasOwnProp( options, 'prefix' ) ) {
6565
if ( !isString( options.prefix ) ) {
66-
throw new TypeError( format( 'invalid option. `%s` option must be a string. Value: `%s`.', 'prefix', options.prefix ) );
66+
throw new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'prefix', options.prefix ) );
6767
}
6868
opts.prefix = options.prefix;
6969
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ setReadOnly( Complex128Array, 'from', function from( src ) {
492492
if ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len
493493
buf = src[ ITERATOR_SYMBOL ]();
494494
if ( !isFunction( buf.next ) ) {
495-
throw new TypeError( 'invalid argument. First argument must be an array-like object or an iterable.' );
495+
throw new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );
496496
}
497497
if ( clbk ) {
498498
tmp = fromIteratorMap( buf, clbk, thisArg );

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ setReadOnly( Complex64Array, 'from', function from( src ) {
492492
if ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len
493493
buf = src[ ITERATOR_SYMBOL ]();
494494
if ( !isFunction( buf.next ) ) {
495-
throw new TypeError( 'invalid argument. First argument must be an array-like object or an iterable.' );
495+
throw new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );
496496
}
497497
if ( clbk ) {
498498
tmp = fromIteratorMap( buf, clbk, thisArg );

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function datespace( start, stop, length, options ) {
141141
return [];
142142
}
143143
if ( !isInteger( len ) || len < 0 ) {
144-
throw new TypeError( 'invalid argument. Length must a positive integer.' );
144+
throw new TypeError( format( 'invalid argument. Length must be a positive integer. Value: `%s`.', len ) );
145145
}
146146
if ( flg ) {
147147
if ( !isObject( opts ) ) {

lib/node_modules/@stdlib/number/float32/base/from-binary-string/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function fromBinaryStringf( bstr ) {
6969
var exp;
7070

7171
if ( bstr.length !== 32 ) {
72-
throw new Error( format( 'invalid argument. Input string must have a length equal to 32. Value: `%s`.', bstr ) );
72+
throw new Error( format( 'invalid argument. Input string must have a length equal to `%u`. Value: `%s`.', 32, bstr ) );
7373
}
7474
// Sign bit:
7575
sign = ( bstr[0] === '1' ) ? -1.0 : 1.0;

0 commit comments

Comments
 (0)