diff --git a/lib/node_modules/@stdlib/_tools/makie/plugins/makie-test-cov/lib/main.js b/lib/node_modules/@stdlib/_tools/makie/plugins/makie-test-cov/lib/main.js index e0773cf2f770..7d1258ea0ea9 100644 --- a/lib/node_modules/@stdlib/_tools/makie/plugins/makie-test-cov/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/makie/plugins/makie-test-cov/lib/main.js @@ -89,15 +89,13 @@ function plugin( dir, cwd, subpath ) { opts = {}; opts.cwd = dir; - args = []; + args = [ 'test-cov' ]; // Environment variables: if ( subpath ) { subpath = subpath.replace( 'lib/node_modules/', '' ); - args.push( 'TESTS_FILTER=.*/'+subpath+'/.*' ); + args.unshift( 'TESTS_FILTER=.*/' + subpath + '/.*' ); } - // Target: - args.push( 'test-cov' ); proc = spawn( 'make', args, opts ); proc.on( 'error', onError ); diff --git a/lib/node_modules/@stdlib/_tools/makie/plugins/makie-view-cov/lib/main.js b/lib/node_modules/@stdlib/_tools/makie/plugins/makie-view-cov/lib/main.js index 2e633ddb5c3f..e29e38e9cf3a 100644 --- a/lib/node_modules/@stdlib/_tools/makie/plugins/makie-view-cov/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/makie/plugins/makie-view-cov/lib/main.js @@ -88,9 +88,9 @@ function plugin( dir ) { opts = {}; opts.cwd = dir; - - // Target: - args = [ 'view-cov' ]; +// target + args = []; + args.push('view-cov'); proc = spawn( 'make', args, opts ); proc.on( 'error', onError ); diff --git a/lib/node_modules/@stdlib/bigint/ctor/examples/index.js b/lib/node_modules/@stdlib/bigint/ctor/examples/index.js index c7a6dfcfeedf..59949f0c01b6 100644 --- a/lib/node_modules/@stdlib/bigint/ctor/examples/index.js +++ b/lib/node_modules/@stdlib/bigint/ctor/examples/index.js @@ -19,12 +19,12 @@ 'use strict'; var hasBigIntSupport = require( '@stdlib/assert/has-bigint-support' ); -var BigInt = require( './../lib' ); +var stdlibBigInt = require( './../lib' ); var v; if ( hasBigIntSupport() ) { - v = BigInt( '1' ); + v = stdlibBigInt( '1' ); // Print the value type: console.log( typeof v ); diff --git a/lib/node_modules/@stdlib/blas/base/isamax/test/test.isamax.native.js b/lib/node_modules/@stdlib/blas/base/isamax/test/test.isamax.native.js index a74c00f9215f..31d62e794a6d 100644 --- a/lib/node_modules/@stdlib/blas/base/isamax/test/test.isamax.native.js +++ b/lib/node_modules/@stdlib/blas/base/isamax/test/test.isamax.native.js @@ -99,25 +99,19 @@ tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', o t.end(); }); -tape( 'the function supports specifying a stride', opts, function test( t ) { - var expected; +tape( 'the function supports specifying a negative stride', opts, function test( t ) { var idx; var x; - x = new Float32Array([ - 0.1, // 1 - 4.0, - -0.3, // 2 - 6.0, - -0.5, // 3 - 7.0, - -0.1, // 4 - 3.0 - ]); - expected = 2; + x = new Float32Array([ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ]); + + idx = isamax( x.length, x, -1 ); + t.strictEqual( idx, 2, 'returns expected value' ); + + x = new Float32Array([ 3.0, 999.9, 999.9, -4.0, 999.9, 999.9, 1.0, 999.9, 999.9, 15.0, 999.9, 999.9, 4.0, 999.9, 999.9, 3.0 ]); + idx = isamax( 6, x, -3 ); + t.strictEqual( idx, 2, 'returns expected value' ); - idx = isamax( 4, x, 2 ); - t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); @@ -125,7 +119,7 @@ tape( 'the function supports specifying a negative stride', opts, function test( var idx; var x; - x = new Float32Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); + x = new Float32Array([ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ]); idx = isamax( x.length, x, -1 ); t.strictEqual( idx, 2, 'returns expected value' ); diff --git a/lib/node_modules/@stdlib/stats/kstest/test/test.marsaglia.js b/lib/node_modules/@stdlib/stats/kstest/test/test.marsaglia.js index 7cbea7f21d0a..b0a86f25245c 100644 --- a/lib/node_modules/@stdlib/stats/kstest/test/test.marsaglia.js +++ b/lib/node_modules/@stdlib/stats/kstest/test/test.marsaglia.js @@ -43,12 +43,44 @@ tape( 'the function correctly evaluates the CDF of D_n', function test( t ) { var n; var i; - d = [ 0.3, -0.1, 1.5, 0.5, 0.1, 0.1, 0.05, 0.05, 0.8, 0.274 ]; // eslint-disable-line array-element-newline - n = [ 10.0, 10.0, 10.0, 20.0, 10.0, 20.0, 300.0, 80.0, 1.0, 10.0 ]; // eslint-disable-line array-element-newline - expected = [ - 0.7294644, 0.0, 1.0, 0.9999621, 0.0003629, - 0.0237449, 0.5725584, 0.0175789, 0.6, 0.6284796 - ]; + d = [ + 0.3, + -0.1, + 1.5, + 0.5, + 0.1, + 0.1, + 0.05, + 0.05, + 0.8, + 0.274 +]; + +n = [ + 10.0, + 10.0, + 10.0, + 20.0, + 10.0, + 20.0, + 300.0, + 80.0, + 1.0, + 10.0 +]; + +expected = [ + 0.7294644, + 0.0, + 1.0, + 0.9999621, + 0.0003629, + 0.0237449, + 0.5725584, + 0.0175789, + 0.6, + 0.6284796 +]; for ( i = 0; i < expected.length; i++ ) { actual = pKolmogorov( d[ i ], n[ i ] ).toFixed( 7 ); delta = abs( actual - expected[ i ] ); diff --git a/lib/node_modules/@stdlib/utils/memoize/lib/main.js b/lib/node_modules/@stdlib/utils/memoize/lib/main.js index 6eef9a4af85b..27c4e4a86bd1 100644 --- a/lib/node_modules/@stdlib/utils/memoize/lib/main.js +++ b/lib/node_modules/@stdlib/utils/memoize/lib/main.js @@ -87,10 +87,8 @@ function memoize( fcn, hashFunction ) { var out; var key; var i; - args = new Array( arguments.length ); - for ( i = 0; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } + args = Array.from(arguments); + key = toKey( args ).toString(); if ( hasOwnProp( cache, key ) ) { return cache[ key ]; diff --git a/lib/node_modules/@stdlib/utils/pluck/benchmark/benchmark.js b/lib/node_modules/@stdlib/utils/pluck/benchmark/benchmark.js index 13c6b9a9e374..fe889b17bdd8 100644 --- a/lib/node_modules/@stdlib/utils/pluck/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/utils/pluck/benchmark/benchmark.js @@ -37,14 +37,14 @@ bench( pkg, function benchmark( b ) { var i; var j; - arr = new Array( 100 ); - for ( i = 0; i < arr.length; i++ ) { - tmp = new Array( 5 ); - for ( j = 0; j < tmp.length; j++ ) { - tmp[ j ] = round( randu()*100.0*(j+1.0) ); - } - arr[ i ] = tmp; + arr = []; +for ( i = 0; i < 100; i++ ) { + tmp = []; + for ( j = 0; j < 5; j++ ) { + tmp.push( round( randu()*100.0*( j+1.0 ) ) ); } + arr.push( tmp ); +} b.tic(); for ( i = 0; i < b.iterations; i++ ) { arr[ i % arr.length ][ i % 5 ] = randu(); diff --git a/lib/node_modules/@stdlib/utils/tabulate-by/examples/index.js b/lib/node_modules/@stdlib/utils/tabulate-by/examples/index.js index 70d2eb28c996..d51381ddfdb2 100644 --- a/lib/node_modules/@stdlib/utils/tabulate-by/examples/index.js +++ b/lib/node_modules/@stdlib/utils/tabulate-by/examples/index.js @@ -18,6 +18,7 @@ 'use strict'; + var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var take = require( '@stdlib/array/take' ); var tabulateBy = require( './../lib' ); @@ -32,8 +33,11 @@ function indicator( value ) { vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ]; -// Generate a random collection... -arr = take( vals, discreteUniform( 100, 0, vals.length - 1 ) ); +// Generate random indices: +var idx = discreteUniform( 100, 0, vals.length-1 ); + +// Select values: +arr = take( vals, idx ); // Generate a frequency table: out = tabulateBy( arr, indicator );