diff --git a/lib/node_modules/@stdlib/_tools/github/org-repos/lib/validate.js b/lib/node_modules/@stdlib/_tools/github/org-repos/lib/validate.js index 6676d503d2ba..627eff876546 100644 --- a/lib/node_modules/@stdlib/_tools/github/org-repos/lib/validate.js +++ b/lib/node_modules/@stdlib/_tools/github/org-repos/lib/validate.js @@ -56,13 +56,13 @@ function validate( opts, options ) { if ( hasOwnProp( options, 'token' ) ) { opts.token = options.token; if ( !isString( opts.token ) ) { - return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'token', opts.token ) ); + return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'token', opts.token ) ); } } if ( hasOwnProp( options, 'useragent' ) ) { opts.useragent = options.useragent; if ( !isString( opts.useragent ) ) { - return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'useragent', opts.useragent ) ); + return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'useragent', opts.useragent ) ); } } return null; diff --git a/lib/node_modules/@stdlib/_tools/scripts/transform.js b/lib/node_modules/@stdlib/_tools/scripts/transform.js index 7692af0f366f..d0d2291bf3a7 100644 --- a/lib/node_modules/@stdlib/_tools/scripts/transform.js +++ b/lib/node_modules/@stdlib/_tools/scripts/transform.js @@ -50,6 +50,74 @@ var ERROR_NAMES = [ // MAIN // +/** +* Tests whether a variable declaration is for the `@stdlib/string-format` require. +* +* @private +* @param {Object} path - AST node path +* @returns {boolean} boolean indicating whether a variable declaration is for +* the `@stdlib/string-format` require +*/ +function onStringFormat( path ) { + var node = path.node; + return node.init && + node.init.type === 'CallExpression' && + node.init.callee.name === 'require' && + node.init.arguments[0].value === '@stdlib/string-format'; +} +/** +* Returns false if the node index is equal to zero and true otherwise. +* +* @private +* @param {Object} path - AST node path +* @param {number} idx - node index +* @returns {boolean} boolean indicating whether to keep the node +*/ +function dropFirst( path, idx ) { + return idx !== 0; +} +/** +* Deletes the comments associated with a given node. +* +* @private +* @param {Object} path - AST node path +* @returns {void} +*/ +function deleteComment( path ) { + var i; + if ( path.node.comments ) { + for ( i = 0; i < path.node.comments.length; i++ ) { + if ( contains( path.node.comments[ i ].value, '@license Apache-2.0' ) ) { + path.node.comments[ i ].value = '* @license Apache-2.0 '; + } + } + } +} +/** +* Rewrites a `require` statement to include the `/dist` directory if the. +* module being required starts with `@stdlib`. +* +* @private +* @param {Object} path - AST node path +* @returns {void} +*/ +function rewriteRequire( path ) { + if ( startsWith( path.value.arguments[0].value, '@stdlib' ) ) { + path.value.arguments[0].value += '/dist'; + } +} +/** +* Tests whether a path is a require call for `@stdlib/error-tools-fmtprodmsg`. +* +* @private +* @param {Object} path - AST node path +* @returns {boolean} boolean indicating whether a path is a require call for +* `@stdlib/error-tools-fmtprodmsg` +*/ +function hasRequire( path ) { + return path.value.callee.name === 'require' && + path.value.arguments[ 0 ].value === '@stdlib/error-tools-fmtprodmsg'; +} /** * Transforms a file for a production build. * @@ -61,7 +129,7 @@ var ERROR_NAMES = [ * * @param {Object} fileInfo - file information * @param {Object} api - JSCodeshift API -* @returns {Object} transformed file +* @returns {string} transformed file */ function transformer( fileInfo, api ) { var formatRequire; @@ -128,13 +196,6 @@ function transformer( fileInfo, api ) { * @param {Object} path - AST node path * @returns {boolean} boolean indicating whether a variable declaration is for the `@stdlib/string-format` require */ - function onStringFormat( path ) { - var node = path.node; - return node.init && - node.init.type === 'CallExpression' && - node.init.callee.name === 'require' && - node.init.arguments[0].value === '@stdlib/string-format'; - } /** * Assigns the variable name for the `@stdlib/string-format` require. @@ -155,9 +216,6 @@ function transformer( fileInfo, api ) { * @param {number} idx - node index * @returns {boolean} boolean indicating whether to keep the node */ - function dropFirst( path, idx ) { - return idx !== 0; - } /** * Deletes the comments associated with a given node. @@ -166,16 +224,6 @@ function transformer( fileInfo, api ) { * @param {Object} path - AST node path * @returns {void} */ - function deleteComment( path ) { - var i; - if ( path.node.comments ) { - for ( i = 0; i < path.node.comments.length; i++ ) { - if ( contains( path.node.comments[ i ].value, '@license Apache-2.0' ) ) { - path.node.comments[ i ].value = '* @license Apache-2.0 '; - } - } - } - } /** * Rewrites a `require` statement to include the `/dist` directory if the module being required starts with `@stdlib`. @@ -184,11 +232,6 @@ function transformer( fileInfo, api ) { * @param {Object} path - AST node path * @returns {void} */ - function rewriteRequire( path ) { - if ( startsWith( path.value.arguments[0].value, '@stdlib' ) ) { - path.value.arguments[0].value += '/dist'; - } - } /** * Callback invoked upon finding a string literal. @@ -237,13 +280,12 @@ function transformer( fileInfo, api ) { nRequires = requires.size(); debug( 'Found ' + nRequires + ' `require` calls...' ); if ( !requires.some( hasRequire ) ) { - formatRequire = j.variableDeclaration('var', [ - j.variableDeclarator(j.identifier( formatVar ), j.callExpression(j.identifier( 'require' ), [ - j.stringLiteral( '@stdlib/error-tools-fmtprodmsg' ) - ])) + formatRequire = j.variableDeclaration( 'var', [ + j.variableDeclarator( j.identifier( formatVar ), j.callExpression( j.identifier( 'require' ), [ j.stringLiteral( '@stdlib/error-tools-fmtprodmsg' ) ]) ) ]); debug( 'Adding `require` call to `@stdlib/error-tools-fmtprodmsg`...' ); - j( root.find( j.Declaration ).at( 0 ).get() ).insertBefore( formatRequire ); + j( root.find( j.Declaration ).at( 0 ).get() ) + .insertBefore( formatRequire ); } } } @@ -256,10 +298,6 @@ function transformer( fileInfo, api ) { * @param {Object} path - AST node path * @returns {boolean} boolean indicating whether a path is a require call for `@stdlib/error-tools-fmtprodmsg` */ - function hasRequire( path ) { - return path.value.callee.name === 'require' && - path.value.arguments[ 0 ].value === '@stdlib/error-tools-fmtprodmsg'; - } } diff --git a/lib/node_modules/@stdlib/utils/async/function-sequence/lib/main.js b/lib/node_modules/@stdlib/utils/async/function-sequence/lib/main.js index 79d5daf7f18d..13b379ca9f10 100644 --- a/lib/node_modules/@stdlib/utils/async/function-sequence/lib/main.js +++ b/lib/node_modules/@stdlib/utils/async/function-sequence/lib/main.js @@ -105,7 +105,7 @@ function funseqAsync() { // Copy arguments which should be provided to the first invoked function... args = []; - for ( i = 0; i < nargs; i++ ) { + for ( i = 0; i < arguments.length - 1; i++ ) { args.push( arguments[ i ] ); } // Append the callback an invoked function should call upon completion: