From db1aa6ec61a4527dec2e820b409d9ad7b17155fb Mon Sep 17 00:00:00 2001 From: marq Date: Sat, 14 Feb 2026 10:13:28 +0530 Subject: [PATCH 1/3] 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); } } From f04706111be77e8c9fa1e403508271cde6793578 Mon Sep 17 00:00:00 2001 From: marq Date: Sat, 14 Feb 2026 11:09:43 +0530 Subject: [PATCH 2/3] fix additional lint errors in examples and tests --- .../@stdlib/assert/is-bigint64array/README.md | 2 +- .../assert/is-bigint64array/examples/index.js | 2 +- .../normhermitepolyf/test/test.factory.js | 363 +++++++++--------- 3 files changed, 181 insertions(+), 186 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-bigint64array/README.md b/lib/node_modules/@stdlib/assert/is-bigint64array/README.md index eb4c541aaddf..ddb02b418677 100644 --- a/lib/node_modules/@stdlib/assert/is-bigint64array/README.md +++ b/lib/node_modules/@stdlib/assert/is-bigint64array/README.md @@ -98,7 +98,7 @@ bool = isBigInt64Array( new Float64Array( 10 ) ); bool = isBigInt64Array( new Float32Array( 10 ) ); // returns false -bool = isBigInt64Array( new Array( 10 ) ); +bool = isBigInt64Array( [] ); // returns false bool = isBigInt64Array( {} ); diff --git a/lib/node_modules/@stdlib/assert/is-bigint64array/examples/index.js b/lib/node_modules/@stdlib/assert/is-bigint64array/examples/index.js index b46a91b2af7c..10c47d475056 100644 --- a/lib/node_modules/@stdlib/assert/is-bigint64array/examples/index.js +++ b/lib/node_modules/@stdlib/assert/is-bigint64array/examples/index.js @@ -74,7 +74,7 @@ bool = isBigInt64Array( new Float32Array( 10 ) ); console.error( bool ); // => false -bool = isBigInt64Array( new Array( 10 ) ); +bool = isBigInt64Array( [] ); console.error( bool ); // => false diff --git a/lib/node_modules/@stdlib/math/base/tools/normhermitepolyf/test/test.factory.js b/lib/node_modules/@stdlib/math/base/tools/normhermitepolyf/test/test.factory.js index 6502ef5c77d9..8529c14ce924 100644 --- a/lib/node_modules/@stdlib/math/base/tools/normhermitepolyf/test/test.factory.js +++ b/lib/node_modules/@stdlib/math/base/tools/normhermitepolyf/test/test.factory.js @@ -20,53 +20,48 @@ // MODULES // -var tape = require( 'tape' ); -var abs = require( '@stdlib/math/base/special/abs' ); -var EPS = require( '@stdlib/constants/float32/eps' ); -var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var factory = require( './../lib' ).factory; +var tape = require('tape'); +var abs = require('@stdlib/math/base/special/abs'); +var EPS = require('@stdlib/constants/float32/eps'); +var isnanf = require('@stdlib/math/base/assert/is-nanf'); +var float64ToFloat32 = require('@stdlib/number/float64/base/to-float32'); +var factory = require('./../lib').factory; // FIXTURES // -var random2 = require( './fixtures/python/random2.json' ); - -var mediumNegative1 = require( './fixtures/python/medium_negative_1.json' ); -var mediumNegative2 = require( './fixtures/python/medium_negative_2.json' ); -var mediumNegative5 = require( './fixtures/python/medium_negative_5.json' ); - -var mediumPositive1 = require( './fixtures/python/medium_positive_1.json' ); -var mediumPositive2 = require( './fixtures/python/medium_positive_2.json' ); -var mediumPositive5 = require( './fixtures/python/medium_positive_5.json' ); - -var smallPositive1 = require( './fixtures/python/small_positive_1.json' ); -var smallPositive2 = require( './fixtures/python/small_positive_2.json' ); -var smallPositive5 = require( './fixtures/python/small_positive_5.json' ); - -var smallNegative1 = require( './fixtures/python/small_negative_1.json' ); -var smallNegative2 = require( './fixtures/python/small_negative_2.json' ); -var smallNegative5 = require( './fixtures/python/small_negative_5.json' ); - -var tiny1 = require( './fixtures/python/tiny_1.json' ); -var tiny2 = require( './fixtures/python/tiny_2.json' ); -var tiny5 = require( './fixtures/python/tiny_5.json' ); +var random2 = require('./fixtures/python/random2.json'); +var mediumNegative1 = require('./fixtures/python/medium_negative_1.json'); +var mediumNegative2 = require('./fixtures/python/medium_negative_2.json'); +var mediumNegative5 = require('./fixtures/python/medium_negative_5.json'); +var mediumPositive1 = require('./fixtures/python/medium_positive_1.json'); +var mediumPositive2 = require('./fixtures/python/medium_positive_2.json'); +var mediumPositive5 = require('./fixtures/python/medium_positive_5.json'); +var smallPositive1 = require('./fixtures/python/small_positive_1.json'); +var smallPositive2 = require('./fixtures/python/small_positive_2.json'); +var smallPositive5 = require('./fixtures/python/small_positive_5.json'); +var smallNegative1 = require('./fixtures/python/small_negative_1.json'); +var smallNegative2 = require('./fixtures/python/small_negative_2.json'); +var smallNegative5 = require('./fixtures/python/small_negative_5.json'); +var tiny1 = require('./fixtures/python/tiny_1.json'); +var tiny2 = require('./fixtures/python/tiny_2.json'); +var tiny5 = require('./fixtures/python/tiny_5.json'); // TESTS // -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof factory, 'function', 'main export is a function' ); +tape('main export is a function', function test(t) { + t.ok(true, __filename); + t.strictEqual(typeof factory, 'function', 'main export is a function'); t.end(); }); -tape( 'the function returns a function', function test( t ) { - t.strictEqual( typeof factory( 2 ), 'function', 'returns expected value' ); +tape('the function returns a function', function test(t) { + t.strictEqual(typeof factory(2), 'function', 'returns expected value'); t.end(); }); -tape( 'the function returns a function which accurately computes `Hen(x)` for random `n` and `x`', function test( t ) { +tape('the function returns a function which accurately computes `Hen(x)` for random `n` and `x`', function test(t) { var expected; var delta; var tol; @@ -81,18 +76,18 @@ tape( 'the function returns a function which accurately computes `Hen(x)` for ra x = random2.x; expected = random2.expected; - for ( i = 0; i < x.length; i++ ) { - f = factory( n[ i ] ); - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 5.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n[ i ] + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + f = factory(n[i]); + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 5.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n[i] + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He1(x)` for small positive numbers', function test( t ) { +tape('the function returns a function which accurately computes `He1(x)` for small positive numbers', function test(t) { var expected; var delta; var tol; @@ -107,19 +102,19 @@ tape( 'the function returns a function which accurately computes `He1(x)` for sm x = smallPositive1.x; expected = smallPositive1.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function accurately computes `He2(x)` for small positive numbers', function test( t ) { +tape('the function accurately computes `He2(x)` for small positive numbers', function test(t) { var expected; var delta; var tol; @@ -134,19 +129,19 @@ tape( 'the function accurately computes `He2(x)` for small positive numbers', fu x = smallPositive2.x; expected = smallPositive2.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He5(x)` for small positive numbers', function test( t ) { +tape('the function returns a function which accurately computes `He5(x)` for small positive numbers', function test(t) { var expected; var delta; var tol; @@ -161,19 +156,19 @@ tape( 'the function returns a function which accurately computes `He5(x)` for sm x = smallPositive5.x; expected = smallPositive5.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He1(x)` for small negative numbers', function test( t ) { +tape('the function returns a function which accurately computes `He1(x)` for small negative numbers', function test(t) { var expected; var delta; var tol; @@ -188,19 +183,19 @@ tape( 'the function returns a function which accurately computes `He1(x)` for sm x = smallNegative1.x; expected = smallNegative1.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He2(x)` for small negative numbers', function test( t ) { +tape('the function returns a function which accurately computes `He2(x)` for small negative numbers', function test(t) { var expected; var delta; var tol; @@ -215,19 +210,19 @@ tape( 'the function returns a function which accurately computes `He2(x)` for sm x = smallNegative2.x; expected = smallNegative2.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He5(x)` for small negative numbers', function test( t ) { +tape('the function returns a function which accurately computes `He5(x)` for small negative numbers', function test(t) { var expected; var delta; var tol; @@ -242,19 +237,19 @@ tape( 'the function returns a function which accurately computes `He5(x)` for sm x = smallNegative5.x; expected = smallNegative5.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He1(x)` for tiny numbers', function test( t ) { +tape('the function returns a function which accurately computes `He1(x)` for tiny numbers', function test(t) { var expected; var delta; var tol; @@ -269,19 +264,19 @@ tape( 'the function returns a function which accurately computes `He1(x)` for ti x = tiny1.x; expected = tiny1.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He2(x)` for tiny numbers', function test( t ) { +tape('the function returns a function which accurately computes `He2(x)` for tiny numbers', function test(t) { var expected; var delta; var tol; @@ -296,19 +291,19 @@ tape( 'the function returns a function which accurately computes `He2(x)` for ti x = tiny2.x; expected = tiny2.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He5(x)` for tiny numbers', function test( t ) { +tape('the function returns a function which accurately computes `He5(x)` for tiny numbers', function test(t) { var expected; var delta; var tol; @@ -323,19 +318,19 @@ tape( 'the function returns a function which accurately computes `He5(x)` for ti x = tiny5.x; expected = tiny5.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He1(x)` for positive medium numbers', function test( t ) { +tape('the function returns a function which accurately computes `He1(x)` for positive medium numbers', function test(t) { var expected; var delta; var tol; @@ -350,19 +345,19 @@ tape( 'the function returns a function which accurately computes `He1(x)` for po x = mediumPositive1.x; expected = mediumPositive1.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He2(x)` for positive medium numbers', function test( t ) { +tape('the function returns a function which accurately computes `He2(x)` for positive medium numbers', function test(t) { var expected; var delta; var tol; @@ -377,19 +372,19 @@ tape( 'the function returns a function which accurately computes `He2(x)` for po x = mediumPositive2.x; expected = mediumPositive2.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He5(x)` for positive medium numbers', function test( t ) { +tape('the function returns a function which accurately computes `He5(x)` for positive medium numbers', function test(t) { var expected; var delta; var tol; @@ -404,19 +399,19 @@ tape( 'the function returns a function which accurately computes `He5(x)` for po x = mediumPositive5.x; expected = mediumPositive5.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 5.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 5.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He1(x)` for negative medium numbers', function test( t ) { +tape('the function returns a function which accurately computes `He1(x)` for negative medium numbers', function test(t) { var expected; var delta; var tol; @@ -431,19 +426,19 @@ tape( 'the function returns a function which accurately computes `He1(x)` for ne x = mediumNegative1.x; expected = mediumNegative1.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He2(x)` for negative medium numbers', function test( t ) { +tape('the function returns a function which accurately computes `He2(x)` for negative medium numbers', function test(t) { var expected; var delta; var tol; @@ -458,19 +453,19 @@ tape( 'the function returns a function which accurately computes `He2(x)` for ne x = mediumNegative2.x; expected = mediumNegative2.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 1.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 1.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which accurately computes `He5(x)` for negative medium numbers', function test( t ) { +tape('the function returns a function which accurately computes `He5(x)` for negative medium numbers', function test(t) { var expected; var delta; var tol; @@ -485,80 +480,80 @@ tape( 'the function returns a function which accurately computes `He5(x)` for ne x = mediumNegative5.x; expected = mediumNegative5.expected; - f = factory( n ); + f = factory(n); - for ( i = 0; i < x.length; i++ ) { - v = f( x[ i ] ); - e = float64ToFloat32( expected[ i ] ); - delta = abs( v - e ); - tol = 5.0 * EPS * abs( e ); - t.ok( delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' ); + for (i = 0; i < x.length; i++) { + v = f(x[i]); + e = float64ToFloat32(expected[i]); + delta = abs(v - e); + tol = 5.0 * EPS * abs(e); + t.ok(delta <= tol, 'within tolerance. n: ' + n + '. x: ' + x[i] + '. Value: ' + v + '. Expected: ' + e + '. Delta: ' + delta + '. Tolerance: ' + tol + '.'); } t.end(); }); -tape( 'the function returns a function which returns `1.0` whenever `n` is `0`', function test( t ) { +tape('the function returns a function which returns `1.0` whenever `n` is `0`', function test(t) { var f; var y; - f = factory( 0 ); + f = factory(0); - y = f( -1.0 ); - t.strictEqual( y, 1.0, 'returns expected value' ); + y = f(-1.0); + t.strictEqual(y, 1.0, 'returns expected value'); - y = f( 0.0 ); - t.strictEqual( y, 1.0, 'returns expected value' ); + y = f(0.0); + t.strictEqual(y, 1.0, 'returns expected value'); - y = f( 1.0 ); - t.strictEqual( y, 1.0, 'returns expected value' ); + y = f(1.0); + t.strictEqual(y, 1.0, 'returns expected value'); t.end(); }); -tape( 'the function returns a function which returns `NaN` whenever `n` is `NaN`', function test( t ) { +tape('the function returns a function which returns `NaN` whenever `n` is `NaN`', function test(t) { var f; var y; - f = factory( NaN ); + f = factory(NaN); - y = f( 0.0 ); - t.strictEqual( isnanf( y ), true, 'returns expected value' ); + y = f(0.0); + t.strictEqual(isnanf(y), true, 'returns expected value'); t.end(); }); -tape( 'the function returns a function which returns `NaN` when `x` is `NaN`', function test( t ) { +tape('the function returns a function which returns `NaN` when `x` is `NaN`', function test(t) { var f; var y; - f = factory( 1 ); + f = factory(1); - y = f( NaN ); - t.strictEqual( isnanf( y ), true, 'returns expected value' ); + y = f(NaN); + t.strictEqual(isnanf(y), true, 'returns expected value'); t.end(); }); -tape( 'the function returns a function which returns `NaN` when `n` is a negative integer`', function test( t ) { +tape('the function returns a function which returns `NaN` when `n` is a negative integer`', function test(t) { var f; var y; - f = factory( -1 ); + f = factory(-1); - y = f( 0.0 ); - t.strictEqual( isnanf( y ), true, 'returns expected value' ); + y = f(0.0); + t.strictEqual(isnanf(y), true, 'returns expected value'); t.end(); }); -tape( 'the function returns a function which returns `NaN` when `n` is not an integer`', function test( t ) { +tape('the function returns a function which returns `NaN` when `n` is not an integer`', function test(t) { var f; var y; - f = factory( 1.01 ); + f = factory(1.01); - y = f( 0.0 ); - t.strictEqual( isnanf( y ), true, 'returns expected value' ); + y = f(0.0); + t.strictEqual(isnanf(y), true, 'returns expected value'); t.end(); }); From 5407579c6b80ca7cc7ebd2456e4ccd653d051d9d Mon Sep 17 00:00:00 2001 From: marq Date: Sat, 14 Feb 2026 13:53:26 +0530 Subject: [PATCH 3/3] fix lint javascript lint errors --- .../lib/main.js | 86 ++++++++++--------- .../scripts/build.js | 5 +- 2 files changed, 47 insertions(+), 44 deletions(-) diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image/lib/main.js index 7e2fcf6a3ca2..004311bcc531 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-shortcut-reference-image/lib/main.js @@ -20,12 +20,12 @@ // MODULES // -var parseJSDoc = require( 'doctrine' ).parse; -var remark = require( 'remark' ); -var remarkLint = require( 'remark-lint' ); -var remarkPlugin = require( 'remark-lint-no-shortcut-reference-image' ); -var isObject = require( '@stdlib/assert/is-object' ); -var findJSDoc = require( '@stdlib/_tools/eslint/utils/find-jsdoc' ); +var parseJSDoc = require('doctrine').parse; +var remark = require('remark'); +var remarkLint = require('remark-lint'); +var remarkPlugin = require('remark-lint-no-shortcut-reference-image'); +var isObject = require('@stdlib/assert/is-object'); +var findJSDoc = require('@stdlib/_tools/eslint/utils/find-jsdoc'); // VARIABLES // @@ -39,13 +39,33 @@ var rule; // FUNCTIONS // +/** +* Copies AST node location info. +* +* @private +* @param {Object} loc - AST node location +* @returns {Object} copied location info +*/ +function copyLocationInfo(loc) { + return { + 'start': { + 'line': loc.start.line, + 'column': loc.start.column + }, + 'end': { + 'line': loc.end.line, + 'column': loc.end.column + } + }; +} + /** * Rule to prevent shortcut Markdown reference images from being used in JSDoc descriptions. * * @param {Object} context - ESLint context * @returns {Object} validators */ -function main( context ) { +function main(context) { var source; var config; var lint; @@ -53,10 +73,10 @@ function main( context ) { config = { 'plugins': [ remarkLint, - [ remarkPlugin, 'error' ] + [remarkPlugin, 'error'] ] }; - lint = remark().use( config ).processSync; // eslint-disable-line node/no-sync + lint = remark().use(config).processSync; // eslint-disable-line node/no-sync source = context.getSourceCode(); return { @@ -72,18 +92,18 @@ function main( context ) { * @private * @param {ASTNode} node - AST node */ - function validate( node ) { + function validate(node) { var jsdoc; var vfile; var ast; - jsdoc = findJSDoc( source, node ); - if ( isObject( jsdoc ) ) { - ast = parseJSDoc( jsdoc.value, DOPTS ); - if ( ast.description ) { - vfile = lint( ast.description ); - if ( vfile.messages.length ) { - reportErrors( vfile.messages, jsdoc.loc ); + jsdoc = findJSDoc(source, node); + if (isObject(jsdoc)) { + ast = parseJSDoc(jsdoc.value, DOPTS); + if (ast.description) { + vfile = lint(ast.description); + if (vfile.messages.length) { + reportErrors(vfile.messages, jsdoc.loc); } } } @@ -96,41 +116,23 @@ function main( context ) { * @param {ObjectArray} errors - Markdown lint errors * @param {Object} location - JSDoc location information */ - function reportErrors( errors, location ) { + function reportErrors(errors, location) { var err; var msg; var loc; var i; - for ( i = 0; i < errors.length; i++ ) { - err = errors[ i ]; + for (i = 0; i < errors.length; i++) { + err = errors[i]; msg = err.message; - loc = copyLocationInfo( location ); + loc = copyLocationInfo(location); loc.start.line = err.location.start.line + 1; // Note: we assume `/**` is on its own line loc.start.column = err.location.start.column + 1; // Note: we assume that 1 space separates `*` from JSDoc description content (e.g., `* ## Beep`) - report( msg, loc ); + report(msg, loc); } } - /** - * Copies AST node location info. - * - * @private - * @param {Object} loc - AST node location - * @returns {Object} copied location info - */ - function copyLocationInfo( loc ) { - return { - 'start': { - 'line': loc.start.line, - 'column': loc.start.column - }, - 'end': { - 'line': loc.end.line, - 'column': loc.end.column - } - }; - } + /** * Reports an error message. @@ -139,7 +141,7 @@ function main( context ) { * @param {string} msg - error message * @param {Object} loc - error location info */ - function report( msg, loc ) { + function report(msg, loc) { context.report({ 'node': null, 'message': msg, diff --git a/lib/node_modules/@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013/scripts/build.js b/lib/node_modules/@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013/scripts/build.js index afd93538747e..f6a4ef11f05a 100644 --- a/lib/node_modules/@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013/scripts/build.js +++ b/lib/node_modules/@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013/scripts/build.js @@ -24,6 +24,7 @@ var resolve = require( 'path' ).resolve; var readFile = require( '@stdlib/fs/read-file' ).sync; var writeFile = require( '@stdlib/fs/write-file' ).sync; var RE_EOL = require( '@stdlib/regexp/eol' ).REGEXP; +var format = require( '@stdlib/string/format' ); // VARIABLES // @@ -66,7 +67,7 @@ function main() { for ( i = 0; i < data.length; i++ ) { d = data[ i ].split( ',' ); if ( d.length !== fields.length ) { - throw new Error( 'unexpected error. Number of row values ('+d.length+') does not match the expected number of fields ('+fields.length+').' ); + throw new Error( format( 'unexpected error. Number of row values (%u) does not match the expected number of fields (%u).', d.length, fields.length ) ); } for ( j = 1; j < d.length; j++ ) { d[ j ] = parseFloat( d[ j ] ); @@ -86,7 +87,7 @@ function main() { } else if ( d[ 0 ] === 'white' ) { json.white.push( d[ 2 ] ); } else { - throw new Error( 'unexpected error. Unrecognized race: `'+d[2]+'`.' ); + throw new Error( format( 'unexpected error. Unrecognized race: `%s`.', d[ 2 ] ) ); } } if ( json.black.length !== json.white.length ) {