From db1aa6ec61a4527dec2e820b409d9ad7b17155fb Mon Sep 17 00:00:00 2001 From: marq Date: Sat, 14 Feb 2026 10:13:28 +0530 Subject: [PATCH] fix javascript lint errors --- .../_tools/github/fetch-file/lib/factory.js | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/lib/node_modules/@stdlib/_tools/github/fetch-file/lib/factory.js b/lib/node_modules/@stdlib/_tools/github/fetch-file/lib/factory.js index 7332b2b962e6..de48766cf6ac 100644 --- a/lib/node_modules/@stdlib/_tools/github/fetch-file/lib/factory.js +++ b/lib/node_modules/@stdlib/_tools/github/fetch-file/lib/factory.js @@ -20,13 +20,13 @@ // MODULES // -var isFunction = require( '@stdlib/assert/is-function' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; -var copy = require( '@stdlib/utils/copy' ); -var format = require( '@stdlib/string/format' ); -var defaults = require( './defaults.json' ); -var resolve = require( './resolve.js' ); +var isFunction = require('@stdlib/assert/is-function'); +var isString = require('@stdlib/assert/is-string').isPrimitive; +var isStringArray = require('@stdlib/assert/is-string-array').primitives; +var copy = require('@stdlib/utils/copy'); +var format = require('@stdlib/string/format'); +var defaults = require('./defaults.json'); +var resolve = require('./resolve.js'); // MAIN // @@ -42,18 +42,18 @@ var resolve = require( './resolve.js' ); * @throws {TypeError} callback argument must be a function * @returns {Function} function for fetching a file from one or more repositories */ -function factory( filepath, repos, clbk ) { +function factory(filepath, repos, clbk) { var opts; - if ( !isString( filepath ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', filepath ) ); + if (!isString(filepath)) { + throw new TypeError(format('invalid argument. First argument must be a string. Value: `%s`.', filepath)); } - if ( !isStringArray( repos ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', repos ) ); + if (!isStringArray(repos)) { + throw new TypeError(format('invalid argument. Second argument must be an array of strings. Value: `%s`.', repos)); } - if ( !isFunction( clbk ) ) { - throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) ); + if (!isFunction(clbk)) { + throw new TypeError(format('invalid argument. Callback argument must be a function. Value: `%s`.', clbk)); } - opts = copy( defaults ); + opts = copy(defaults); return fetchFile; /** @@ -63,21 +63,22 @@ function factory( filepath, repos, clbk ) { * @returns {void} */ function fetchFile() { - resolve( filepath, repos, opts, done ); - /** - * Callback invoked after query completion. - * - * @private - * @param {(Error|null)} error - error object - * @param {Object} results - query results - * @returns {void} - */ - function done( error, results ) { - if ( error ) { - return clbk( error ); - } - clbk( null, results ); + resolve(filepath, repos, opts, done); + } + + /** + * Callback invoked after query completion. + * + * @private + * @param {(Error|null)} error - error object + * @param {Object} results - query results + * @returns {void} + */ + function done(error, results) { + if (error) { + return clbk(error); } + clbk(null, results); } }