8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed91ca0 commit ded60ccCopy full SHA for ded60cc
lib/factory.js
@@ -22,7 +22,7 @@
22
23
var isFunction = require( '@stdlib/assert-is-function' );
24
var isCollection = require( '@stdlib/assert-is-collection' );
25
-var format = require( '@stdlib/string-format' );
+var format = require( '@stdlib/error-tools-fmtprodmsg' );
26
var PINF = require( '@stdlib/constants-float64-pinf' );
27
var validate = require( './validate.js' );
28
var limit = require( './limit.js' );
@@ -109,7 +109,7 @@ function factory( options, predicate ) {
109
f = options;
110
}
111
if ( !isFunction( f ) ) {
112
- throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );
+ throw new TypeError( format( '1RV3q', f ) );
113
114
if ( opts.series ) {
115
opts.limit = 1;
@@ -130,10 +130,10 @@ function factory( options, predicate ) {
130
*/
131
function noneByAsync( collection, done ) {
132
if ( !isCollection( collection ) ) {
133
- throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
+ throw new TypeError( format( '1RVAh', collection ) );
134
135
if ( !isFunction( done ) ) {
136
- throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );
+ throw new TypeError( format( '1RV3q', done ) );
137
138
return limit( collection, opts, f, clbk );
139
lib/validate.js
@@ -24,7 +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;
29
30
// MAIN //
@@ -54,21 +54,21 @@ var format = require( '@stdlib/string-format' );
54
55
function validate( opts, options ) {
56
if ( !isObject( options ) ) {
57
- return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
+ return new TypeError( format( '1RV2V', options ) );
58
59
if ( hasOwnProp( options, 'thisArg' ) ) {
60
opts.thisArg = options.thisArg;
61
62
if ( hasOwnProp( options, 'series' ) ) {
63
opts.series = options.series;
64
if ( !isBoolean( opts.series ) ) {
65
- return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );
+ return new TypeError( format( '1RV2o', 'series', opts.series ) );
66
67
68
if ( hasOwnProp( options, 'limit' ) ) {
69
opts.limit = options.limit;
70
if ( !isPositiveInteger( opts.limit ) ) {
71
- return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );
+ return new TypeError( format( '1RV3P', 'limit', opts.limit ) );
72
73
74
return null;
package.json
@@ -44,7 +44,7 @@
44
"@stdlib/assert-is-plain-object": "^0.2.2",
45
"@stdlib/assert-is-positive-integer": "^0.2.2",
46
"@stdlib/constants-float64-pinf": "^0.2.2",
47
- "@stdlib/string-format": "^0.2.2",
+ "@stdlib/error-tools-fmtprodmsg": "^0.2.2",
48
"@stdlib/types": "^0.4.3",
49
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",
50
"debug": "^2.6.9",