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 18, 2022
1 parent a7030e2 commit 7f40046
Show file tree
Hide file tree
Showing 184 changed files with 548 additions and 356 deletions.
1 change: 0 additions & 1 deletion .github/.keepalive

This file was deleted.

5 changes: 3 additions & 2 deletions any-by-right/lib/any_by_right.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

var isCollection = require( '@stdlib/assert/is-collection' );
var isFunction = require( '@stdlib/assert/is-function' );
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -51,10 +52,10 @@ function anyByRight( collection, predicate, thisArg ) {
var len;
var i;
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. First argument must be a collection. Value: `'+collection+'`.' );
throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
}
if ( !isFunction( predicate ) ) {
throw new TypeError( 'invalid argument. Second argument must be a function. Value: `'+predicate+'`.' );
throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );
}
len = collection.length;
for ( i = len-1; i >= 0; i-- ) {
Expand Down
5 changes: 3 additions & 2 deletions any-by/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

var isCollection = require( '@stdlib/assert/is-collection' );
var isFunction = require( '@stdlib/assert/is-function' );
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -51,10 +52,10 @@ function anyBy( collection, predicate, thisArg ) {
var len;
var i;
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. First argument must be a collection. Value: `'+collection+'`.' );
throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
}
if ( !isFunction( predicate ) ) {
throw new TypeError( 'invalid argument. Second argument must be a function. Value: `'+predicate+'`.' );
throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );
}
len = collection.length;
for ( i = 0; i < len; i++ ) {
Expand Down
3 changes: 2 additions & 1 deletion any/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// MODULES //

var isCollection = require( '@stdlib/assert/is-collection' );
var format = require( '@stdlib/string/format' );


// MAIN //
Expand All @@ -42,7 +43,7 @@ function any( collection ) {
var len;
var i;
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. Must provide a collection. Value: `'+collection+'`.' );
throw new TypeError( format( 'invalid argument. Must provide a collection. Value: `%s`.', collection ) );
}
len = collection.length;
for ( i = 0; i < len; i++ ) {
Expand Down
5 changes: 3 additions & 2 deletions append/lib/append.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var isArray = require( '@stdlib/assert/is-array' );
var isCollection = require( '@stdlib/assert/is-collection' );
var isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );
var isInteger = require( '@stdlib/assert/is-integer' );
var format = require( '@stdlib/string/format' );
var appendArray = require( './append_array.js' );
var appendObject = require( './append_object.js' );
var appendTypedArray = require( './append_typed_array.js' );
Expand Down Expand Up @@ -55,7 +56,7 @@ var appendTypedArray = require( './append_typed_array.js' );
*/
function append( collection1, collection2 ) {
if ( !isCollection( collection2 ) ) {
throw new TypeError( 'invalid argument. Second argument must be an array-like object. Value: `'+collection2+'`.' );
throw new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', collection2 ) );
}
if ( isArray( collection1 ) ) {
return appendArray( collection1, collection2 );
Expand All @@ -74,7 +75,7 @@ function append( collection1, collection2 ) {
) {
return appendObject( collection1, collection2 );
}
throw new TypeError( 'invalid argument. First argument must be either an Array, Typed Array, or an array-like Object. Value: `'+collection1+'`.' );
throw new TypeError( format( 'invalid argument. First argument must be either an Array, Typed Array, or an array-like Object. Value: `%s`.', collection1 ) );
}


Expand Down
3 changes: 2 additions & 1 deletion argument-function/lib/argument_function.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// MODULES //

var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
var format = require( '@stdlib/string/format' );


// MAIN //
Expand All @@ -46,7 +47,7 @@ var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).is
*/
function wrap( idx ) {
if ( !isNonNegativeInteger( idx ) ) {
throw new TypeError( 'invalid argument. Must provide a nonnegative integer. Value: `'+idx+'`.' );
throw new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );
}
return argn;

Expand Down
7 changes: 4 additions & 3 deletions async/any-by-right/lib/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

var isFunction = require( '@stdlib/assert/is-function' );
var isCollection = require( '@stdlib/assert/is-collection' );
var format = require( '@stdlib/string/format' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var validate = require( './validate.js' );
var limit = require( './limit.js' );
Expand Down Expand Up @@ -109,7 +110,7 @@ function factory( options, predicate ) {
f = options;
}
if ( !isFunction( f ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+f+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );
}
if ( opts.series ) {
opts.limit = 1;
Expand All @@ -130,10 +131,10 @@ function factory( options, predicate ) {
*/
function anyByRightAsync( collection, done ) {
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. First argument must be a collection. Value: `'+collection+'.`' );
throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
}
if ( !isFunction( done ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+done+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );
}
return limit( collection, opts, f, clbk );

Expand Down
7 changes: 4 additions & 3 deletions async/any-by/lib/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

var isFunction = require( '@stdlib/assert/is-function' );
var isCollection = require( '@stdlib/assert/is-collection' );
var format = require( '@stdlib/string/format' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var validate = require( './validate.js' );
var limit = require( './limit.js' );
Expand Down Expand Up @@ -109,7 +110,7 @@ function factory( options, predicate ) {
f = options;
}
if ( !isFunction( f ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+f+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );
}
if ( opts.series ) {
opts.limit = 1;
Expand All @@ -130,10 +131,10 @@ function factory( options, predicate ) {
*/
function anyByAsync( collection, done ) {
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. First argument must be a collection. Value: `'+collection+'.`' );
throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
}
if ( !isFunction( done ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+done+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );
}
return limit( collection, opts, f, clbk );

Expand Down
7 changes: 4 additions & 3 deletions async/bifurcate-by/lib/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

var isFunction = require( '@stdlib/assert/is-function' );
var isCollection = require( '@stdlib/assert/is-collection' );
var format = require( '@stdlib/string/format' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var validate = require( './validate.js' );
var limit = require( './limit.js' );
Expand Down Expand Up @@ -105,7 +106,7 @@ function factory( options, predicate ) {
f = options;
}
if ( !isFunction( f ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+f+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );
}
if ( opts.series ) {
opts.limit = 1;
Expand All @@ -126,10 +127,10 @@ function factory( options, predicate ) {
*/
function bifurcateByAsync( collection, done ) {
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. First argument must be a collection. Value: `'+collection+'.`' );
throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
}
if ( !isFunction( done ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+done+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );
}
return limit( collection, opts, f, clbk );

Expand Down
7 changes: 4 additions & 3 deletions async/count-by/lib/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

var isFunction = require( '@stdlib/assert/is-function' );
var isCollection = require( '@stdlib/assert/is-collection' );
var format = require( '@stdlib/string/format' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var validate = require( './validate.js' );
var limit = require( './limit.js' );
Expand Down Expand Up @@ -104,7 +105,7 @@ function factory( options, indicator ) {
f = options;
}
if ( !isFunction( f ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+f+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );
}
if ( opts.series ) {
opts.limit = 1;
Expand All @@ -125,10 +126,10 @@ function factory( options, indicator ) {
*/
function countByAsync( collection, done ) {
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. First argument must be a collection. Value: `'+collection+'.`' );
throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
}
if ( !isFunction( done ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+done+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );
}
return limit( collection, opts, f, clbk );

Expand Down
7 changes: 4 additions & 3 deletions async/do-until/lib/do_until_async.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// MODULES //

var isFunction = require( '@stdlib/assert/is-function' );
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -61,13 +62,13 @@ function doUntilAsync( fcn, predicate, done, thisArg ) {
var args;
var idx;
if ( !isFunction( fcn ) ) {
throw new TypeError( 'invalid argument. First argument must be a function. Value: `'+fcn+'`.' );
throw new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );
}
if ( !isFunction( predicate ) ) {
throw new TypeError( 'invalid argument. Second argument must be a function. Value: `'+predicate+'`.' );
throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );
}
if ( !isFunction( done ) ) {
throw new TypeError( 'invalid argument. Third argument must be a function. Value: `'+done+'`.' );
throw new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', done ) );
}
args = [];
idx = 0;
Expand Down
7 changes: 4 additions & 3 deletions async/do-while/lib/do_while_async.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// MODULES //

var isFunction = require( '@stdlib/assert/is-function' );
var format = require( '@stdlib/string/format' );


// MAIN //
Expand Down Expand Up @@ -61,13 +62,13 @@ function doWhileAsync( fcn, predicate, done, thisArg ) {
var args;
var idx;
if ( !isFunction( fcn ) ) {
throw new TypeError( 'invalid argument. First argument must be a function. Value: `'+fcn+'`.' );
throw new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );
}
if ( !isFunction( predicate ) ) {
throw new TypeError( 'invalid argument. Second argument must be a function. Value: `'+predicate+'`.' );
throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', predicate ) );
}
if ( !isFunction( done ) ) {
throw new TypeError( 'invalid argument. Third argument must be a function. Value: `'+done+'`.' );
throw new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', done ) );
}
args = [];
idx = 0;
Expand Down
7 changes: 4 additions & 3 deletions async/every-by-right/lib/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
var isFunction = require( '@stdlib/assert/is-function' );
var isCollection = require( '@stdlib/assert/is-collection' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var format = require( '@stdlib/string/format' );
var validate = require( './validate.js' );
var limit = require( './limit.js' );

Expand Down Expand Up @@ -109,7 +110,7 @@ function factory( options, predicate ) {
f = options;
}
if ( !isFunction( f ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+f+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );
}
if ( opts.series ) {
opts.limit = 1;
Expand All @@ -130,10 +131,10 @@ function factory( options, predicate ) {
*/
function everyByRightAsync( collection, done ) {
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. First argument must be a collection. Value: `'+collection+'.`' );
throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
}
if ( !isFunction( done ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+done+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );
}
return limit( collection, opts, f, clbk );

Expand Down
7 changes: 4 additions & 3 deletions async/every-by/lib/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
var isFunction = require( '@stdlib/assert/is-function' );
var isCollection = require( '@stdlib/assert/is-collection' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var format = require( '@stdlib/string/format' );
var validate = require( './validate.js' );
var limit = require( './limit.js' );

Expand Down Expand Up @@ -109,7 +110,7 @@ function factory( options, predicate ) {
f = options;
}
if ( !isFunction( f ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+f+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );
}
if ( opts.series ) {
opts.limit = 1;
Expand All @@ -130,10 +131,10 @@ function factory( options, predicate ) {
*/
function everyByAsync( collection, done ) {
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. First argument must be a collection. Value: `'+collection+'.`' );
throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
}
if ( !isFunction( done ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+done+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );
}
return limit( collection, opts, f, clbk );

Expand Down
7 changes: 4 additions & 3 deletions async/for-each-right/lib/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

var isFunction = require( '@stdlib/assert/is-function' );
var isCollection = require( '@stdlib/assert/is-collection' );
var format = require( '@stdlib/string/format' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var validate = require( './validate.js' );
var limit = require( './limit.js' );
Expand Down Expand Up @@ -106,7 +107,7 @@ function factory( options, fcn ) {
f = options;
}
if ( !isFunction( f ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+f+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );
}
if ( opts.series ) {
opts.limit = 1;
Expand All @@ -127,10 +128,10 @@ function factory( options, fcn ) {
*/
function forEachRightAsync( collection, done ) {
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. First argument must be a collection. Value: `'+collection+'.`' );
throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
}
if ( !isFunction( done ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+done+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );
}
return limit( collection, opts, f, clbk );

Expand Down
7 changes: 4 additions & 3 deletions async/for-each/lib/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

var isFunction = require( '@stdlib/assert/is-function' );
var isCollection = require( '@stdlib/assert/is-collection' );
var format = require( '@stdlib/string/format' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var validate = require( './validate.js' );
var limit = require( './limit.js' );
Expand Down Expand Up @@ -106,7 +107,7 @@ function factory( options, fcn ) {
f = options;
}
if ( !isFunction( f ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+f+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );
}
if ( opts.series ) {
opts.limit = 1;
Expand All @@ -127,10 +128,10 @@ function factory( options, fcn ) {
*/
function forEachAsync( collection, done ) {
if ( !isCollection( collection ) ) {
throw new TypeError( 'invalid argument. First argument must be a collection. Value: `'+collection+'.`' );
throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
}
if ( !isFunction( done ) ) {
throw new TypeError( 'invalid argument. Last argument must be a function. Value: `'+done+'`.' );
throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );
}
return limit( collection, opts, f, clbk );

Expand Down
Loading

0 comments on commit 7f40046

Please sign in to comment.