Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Mar 15, 2022
1 parent c64ee37 commit 5b9dcb6
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 44 deletions.
7 changes: 4 additions & 3 deletions async/inmap-right/lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -53,21 +54,21 @@ var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimit
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
}
if ( hasOwnProp( options, 'thisArg' ) ) {
opts.thisArg = options.thisArg;
}
if ( hasOwnProp( options, 'series' ) ) {
opts.series = options.series;
if ( !isBoolean( opts.series ) ) {
return new TypeError( 'invalid option. `series` option must be a boolean primitive. Option: `' + opts.series + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a boolean primitive. Option: `%s`.', 'series', opts.series ) );
}
}
if ( hasOwnProp( options, 'limit' ) ) {
opts.limit = options.limit;
if ( !isPositiveInteger( opts.limit ) ) {
return new TypeError( 'invalid option. `limit` option must be a positive integer. Option: `' + opts.limit + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
}
}
return null;
Expand Down
7 changes: 4 additions & 3 deletions async/inmap/lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -53,21 +54,21 @@ var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimit
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
}
if ( hasOwnProp( options, 'thisArg' ) ) {
opts.thisArg = options.thisArg;
}
if ( hasOwnProp( options, 'series' ) ) {
opts.series = options.series;
if ( !isBoolean( opts.series ) ) {
return new TypeError( 'invalid option. `series` option must be a boolean primitive. Option: `' + opts.series + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a boolean primitive. Option: `%s`.', 'series', opts.series ) );
}
}
if ( hasOwnProp( options, 'limit' ) ) {
opts.limit = options.limit;
if ( !isPositiveInteger( opts.limit ) ) {
return new TypeError( 'invalid option. `limit` option must be a positive integer. Option: `' + opts.limit + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
}
}
return null;
Expand Down
7 changes: 4 additions & 3 deletions async/map-function/lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -53,21 +54,21 @@ var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimit
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
}
if ( hasOwnProp( options, 'thisArg' ) ) {
opts.thisArg = options.thisArg;
}
if ( hasOwnProp( options, 'series' ) ) {
opts.series = options.series;
if ( !isBoolean( opts.series ) ) {
return new TypeError( 'invalid option. `series` option must be a boolean primitive. Option: `' + opts.series + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a boolean primitive. Option: `%s`.', 'series', opts.series ) );
}
}
if ( hasOwnProp( options, 'limit' ) ) {
opts.limit = options.limit;
if ( !isPositiveInteger( opts.limit ) ) {
return new TypeError( 'invalid option. `limit` option must be a positive integer. Option: `' + opts.limit + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
}
}
return null;
Expand Down
7 changes: 4 additions & 3 deletions async/map-keys/lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -53,21 +54,21 @@ var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimit
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
}
if ( hasOwnProp( options, 'thisArg' ) ) {
opts.thisArg = options.thisArg;
}
if ( hasOwnProp( options, 'series' ) ) {
opts.series = options.series;
if ( !isBoolean( opts.series ) ) {
return new TypeError( 'invalid option. `series` option must be a boolean primitive. Option: `' + opts.series + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a boolean primitive. Option: `%s`.', 'series', opts.series ) );
}
}
if ( hasOwnProp( options, 'limit' ) ) {
opts.limit = options.limit;
if ( !isPositiveInteger( opts.limit ) ) {
return new TypeError( 'invalid option. `limit` option must be a positive integer. Option: `' + opts.limit + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
}
}
return null;
Expand Down
7 changes: 4 additions & 3 deletions async/map-values/lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -53,21 +54,21 @@ var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimit
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
}
if ( hasOwnProp( options, 'thisArg' ) ) {
opts.thisArg = options.thisArg;
}
if ( hasOwnProp( options, 'series' ) ) {
opts.series = options.series;
if ( !isBoolean( opts.series ) ) {
return new TypeError( 'invalid option. `series` option must be a boolean primitive. Option: `' + opts.series + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a boolean primitive. Option: `%s`.', 'series', opts.series ) );
}
}
if ( hasOwnProp( options, 'limit' ) ) {
opts.limit = options.limit;
if ( !isPositiveInteger( opts.limit ) ) {
return new TypeError( 'invalid option. `limit` option must be a positive integer. Option: `' + opts.limit + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
}
}
return null;
Expand Down
7 changes: 4 additions & 3 deletions async/none-by-right/lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -53,21 +54,21 @@ var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimit
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
}
if ( hasOwnProp( options, 'thisArg' ) ) {
opts.thisArg = options.thisArg;
}
if ( hasOwnProp( options, 'series' ) ) {
opts.series = options.series;
if ( !isBoolean( opts.series ) ) {
return new TypeError( 'invalid option. `series` option must be a boolean primitive. Option: `' + opts.series + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a boolean primitive. Option: `%s`.', 'series', opts.series ) );
}
}
if ( hasOwnProp( options, 'limit' ) ) {
opts.limit = options.limit;
if ( !isPositiveInteger( opts.limit ) ) {
return new TypeError( 'invalid option. `limit` option must be a positive integer. Option: `' + opts.limit + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
}
}
return null;
Expand Down
7 changes: 4 additions & 3 deletions async/reduce-right/lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -53,21 +54,21 @@ var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimit
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
}
if ( hasOwnProp( options, 'thisArg' ) ) {
opts.thisArg = options.thisArg;
}
if ( hasOwnProp( options, 'series' ) ) {
opts.series = options.series;
if ( !isBoolean( opts.series ) ) {
return new TypeError( 'invalid option. `series` option must be a boolean primitive. Option: `' + opts.series + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a boolean primitive. Option: `%s`.', 'series', opts.series ) );
}
}
if ( hasOwnProp( options, 'limit' ) ) {
opts.limit = options.limit;
if ( !isPositiveInteger( opts.limit ) ) {
return new TypeError( 'invalid option. `limit` option must be a positive integer. Option: `' + opts.limit + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
}
}
return null;
Expand Down
7 changes: 4 additions & 3 deletions async/reduce/lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -53,21 +54,21 @@ var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimit
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
}
if ( hasOwnProp( options, 'thisArg' ) ) {
opts.thisArg = options.thisArg;
}
if ( hasOwnProp( options, 'series' ) ) {
opts.series = options.series;
if ( !isBoolean( opts.series ) ) {
return new TypeError( 'invalid option. `series` option must be a boolean primitive. Option: `' + opts.series + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a boolean primitive. Option: `%s`.', 'series', opts.series ) );
}
}
if ( hasOwnProp( options, 'limit' ) ) {
opts.limit = options.limit;
if ( !isPositiveInteger( opts.limit ) ) {
return new TypeError( 'invalid option. `limit` option must be a positive integer. Option: `' + opts.limit + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
}
}
return null;
Expand Down
7 changes: 4 additions & 3 deletions async/some-by-right/lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -53,21 +54,21 @@ var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimit
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
}
if ( hasOwnProp( options, 'thisArg' ) ) {
opts.thisArg = options.thisArg;
}
if ( hasOwnProp( options, 'series' ) ) {
opts.series = options.series;
if ( !isBoolean( opts.series ) ) {
return new TypeError( 'invalid option. `series` option must be a boolean primitive. Option: `' + opts.series + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a boolean primitive. Option: `%s`.', 'series', opts.series ) );
}
}
if ( hasOwnProp( options, 'limit' ) ) {
opts.limit = options.limit;
if ( !isPositiveInteger( opts.limit ) ) {
return new TypeError( 'invalid option. `limit` option must be a positive integer. Option: `' + opts.limit + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
}
}
return null;
Expand Down
7 changes: 4 additions & 3 deletions async/some-by/lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -53,21 +54,21 @@ var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimit
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
}
if ( hasOwnProp( options, 'thisArg' ) ) {
opts.thisArg = options.thisArg;
}
if ( hasOwnProp( options, 'series' ) ) {
opts.series = options.series;
if ( !isBoolean( opts.series ) ) {
return new TypeError( 'invalid option. `series` option must be a boolean primitive. Option: `' + opts.series + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a boolean primitive. Option: `%s`.', 'series', opts.series ) );
}
}
if ( hasOwnProp( options, 'limit' ) ) {
opts.limit = options.limit;
if ( !isPositiveInteger( opts.limit ) ) {
return new TypeError( 'invalid option. `limit` option must be a positive integer. Option: `' + opts.limit + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
}
}
return null;
Expand Down
7 changes: 4 additions & 3 deletions async/tabulate-by/lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -53,21 +54,21 @@ var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimit
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
}
if ( hasOwnProp( options, 'thisArg' ) ) {
opts.thisArg = options.thisArg;
}
if ( hasOwnProp( options, 'series' ) ) {
opts.series = options.series;
if ( !isBoolean( opts.series ) ) {
return new TypeError( 'invalid option. `series` option must be a boolean primitive. Option: `' + opts.series + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a boolean primitive. Option: `%s`.', 'series', opts.series ) );
}
}
if ( hasOwnProp( options, 'limit' ) ) {
opts.limit = options.limit;
if ( !isPositiveInteger( opts.limit ) ) {
return new TypeError( 'invalid option. `limit` option must be a positive integer. Option: `' + opts.limit + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
}
}
return null;
Expand Down
5 changes: 3 additions & 2 deletions bifurcate-in/lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var indexOf = require( './../../index-of' );
var format = require( '@stdlib/string/format' );


// VARIABLES //
Expand Down Expand Up @@ -55,15 +56,15 @@ var returns = [ 'values', 'keys', '*' ];
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
}
if ( hasOwnProp( options, 'thisArg' ) ) {
opts.thisArg = options.thisArg;
}
if ( hasOwnProp( options, 'returns' ) ) {
opts.returns = options.returns;
if ( indexOf( returns, opts.returns ) === -1 ) {
return new TypeError( 'invalid option. `returns` option must be one of the following: "' + returns.join( '", "' ) + '". Option: `' + opts.returns + '`.' );
return new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'returns', returns.join( '", "' ), opts.returns ) );
}
}
return null;
Expand Down
Loading

0 comments on commit 5b9dcb6

Please sign in to comment.