Skip to content

Commit ca7aef2

Browse files
committed
fix: replace new Array with filled in aversin-by tests
This commit fixes lint errors by replacing `new Array(5)` with `filled(void 0, 5)` from `@stdlib/array/base/filled` in the aversin-by test files. The `stdlib/no-new-array` rule prohibits using the `new Array()` constructor. The `filled` utility provides the same functionality for creating arrays filled with undefined values to test accessor behavior with missing values. Ref: #8759 --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent e0b1c03 commit ca7aef2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/node_modules/@stdlib/math/strided/special/aversin-by/test/test.main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var tape = require( 'tape' );
2424
var aversin = require( '@stdlib/math/base/special/aversin' );
2525
var uniform = require( '@stdlib/random/base/uniform' ).factory;
26+
var filled = require( '@stdlib/array/base/filled' );
2627
var Float64Array = require( '@stdlib/array/float64' );
2728
var aversinBy = require( './../lib/main.js' );
2829

@@ -74,15 +75,15 @@ tape( 'the function computes the inverse versed sine via a callback function', f
7475
aversinBy( x.length, x, 1, y, 1, accessor );
7576
t.deepEqual( y, expected, 'deep equal' );
7677

77-
x = new Array( 5 ); // eslint-disable-line stdlib/no-new-array
78+
x = filled( void 0, 5 );
7879
y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
7980

8081
expected = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
8182

8283
aversinBy( x.length, x, 1, y, 1, accessor );
8384
t.deepEqual( y, expected, 'deep equal' );
8485

85-
x = new Array( 5 ); // eslint-disable-line stdlib/no-new-array
86+
x = filled( void 0, 5 );
8687
x[ 2 ] = rand();
8788
y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
8889

lib/node_modules/@stdlib/math/strided/special/aversin-by/test/test.ndarray.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var tape = require( 'tape' );
2424
var aversin = require( '@stdlib/math/base/special/aversin' );
2525
var uniform = require( '@stdlib/random/base/uniform' ).factory;
26+
var filled = require( '@stdlib/array/base/filled' );
2627
var aversinBy = require( './../lib/ndarray.js' );
2728

2829

@@ -73,15 +74,15 @@ tape( 'the function computes the inverse versed sine via a callback function', f
7374
aversinBy( x.length, x, 1, 0, y, 1, 0, accessor );
7475
t.deepEqual( y, expected, 'deep equal' );
7576

76-
x = new Array( 5 ); // sparse array
77+
x = filled( void 0, 5 );
7778
y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
7879

7980
expected = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
8081

8182
aversinBy( x.length, x, 1, 0, y, 1, 0, accessor );
8283
t.deepEqual( y, expected, 'deep equal' );
8384

84-
x = new Array( 5 ); // sparse array
85+
x = filled( void 0, 5 );
8586
x[ 2 ] = rand();
8687
y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
8788

0 commit comments

Comments
 (0)