Skip to content

Commit fa8d23d

Browse files
committed
chore: clean-up
--- 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: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - 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: passed - task: lint_license_headers status: passed ---
1 parent 93e8d5a commit fa8d23d

File tree

9 files changed

+33
-70
lines changed

9 files changed

+33
-70
lines changed

lib/node_modules/@stdlib/assert/is-float16array/README.md

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,10 @@ var isFloat16Array = require( '@stdlib/assert/is-float16array' );
3434

3535
Tests if a value is a [`Float16Array`][mdn-float16array].
3636

37-
```javascript
38-
var Float16Array = require( '@stdlib/array/float16' );
39-
40-
var bool = isFloat16Array( new Float16Array( 10 ) );
41-
// returns true
37+
<!-- TODO: update example once `array/float16` is added -->
4238

43-
bool = isFloat16Array( [] );
39+
```javascript
40+
var bool = isFloat16Array( [] );
4441
// returns false
4542
```
4643

@@ -64,13 +61,9 @@ var Int32Array = require( '@stdlib/array/int32' );
6461
var Uint32Array = require( '@stdlib/array/uint32' );
6562
var Float32Array = require( '@stdlib/array/float32' );
6663
var Float64Array = require( '@stdlib/array/float64' );
67-
var Float16Array = require( '@stdlib/array/float16' );
6864
var isFloat16Array = require( '@stdlib/assert/is-float16array' );
6965

70-
var bool = isFloat16Array( new Float16Array( 10 ) );
71-
// returns true
72-
73-
bool = isFloat16Array( new Int8Array( 10 ) );
66+
var bool = isFloat16Array( new Int8Array( 10 ) );
7467
// returns false
7568

7669
bool = isFloat16Array( new Uint8Array( 10 ) );
@@ -97,7 +90,7 @@ bool = isFloat16Array( new Float32Array( 10 ) );
9790
bool = isFloat16Array( new Float64Array( 10 ) );
9891
// returns false
9992

100-
bool = isFloat16Array( new Array( 10 ) );
93+
bool = isFloat16Array( [] );
10194
// returns false
10295

10396
bool = isFloat16Array( {} );
@@ -115,13 +108,6 @@ bool = isFloat16Array( null );
115108

116109
<section class="related">
117110

118-
* * *
119-
120-
## See Also
121-
122-
- <span class="package-name">[`@stdlib/assert/is-float64array`][@stdlib/assert/is-float64array]</span><span class="delimiter">: </span><span class="description">test if a value is a Float64Array.</span>
123-
- <span class="package-name">[`@stdlib/assert/is-float32array`][@stdlib/assert/is-float32array]</span><span class="delimiter">: </span><span class="description">test if a value is a Float32Array.</span>
124-
125111
</section>
126112

127113
<!-- /.related -->
@@ -132,13 +118,6 @@ bool = isFloat16Array( null );
132118

133119
[mdn-float16array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float16Array
134120

135-
<!-- <related-links> -->
136-
137-
[@stdlib/assert/is-float64array]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-float64array
138-
[@stdlib/assert/is-float32array]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-float32array
139-
140-
<!-- </related-links> -->
141-
142121
</section>
143122

144123
<!-- /.links -->

lib/node_modules/@stdlib/assert/is-float16array/benchmark/benchmark.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ var Float64Array = require( '@stdlib/array/float64' );
3333
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
3434
var pkg = require( './../package.json' ).name;
3535
var isFloat16Array = require( './../lib' );
36-
var Float16Array = globalThis[ Symbol.for( '@@stdlib/array/float16' ) ];
3736

3837

3938
// VARIABLES //
4039

40+
// TODO: remove once `array/float16` is added
41+
var Float16Array = ( typeof Float16Array === 'function' ) ? Float16Array : null; // eslint-disable-line no-use-before-define
4142
var opts = {
42-
skip: ( typeof Float16Array !== 'function' )
43+
'skip': ( Float16Array === null )
4344
};
4445

4546

4647
// MAIN //
4748

48-
bench( pkg, opts, function benchmark( b ) {
49+
bench( pkg, function benchmark( b ) {
4950
var values;
5051
var bool;
5152
var i;
5253

5354
values = [
5455
new Float64Array( 10 ),
55-
new Float16Array( 10 ),
5656
new Float32Array( 10 ),
5757
new Int32Array( 10 ),
5858
new Uint32Array( 10 ),
@@ -103,7 +103,7 @@ bench( pkg+'::true', opts, function benchmark( b ) {
103103
b.end();
104104
});
105105

106-
bench( pkg+'::false', opts, function benchmark( b ) {
106+
bench( pkg+'::false', function benchmark( b ) {
107107
var values;
108108
var bool;
109109
var i;

lib/node_modules/@stdlib/assert/is-float16array/docs/repl.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414

1515
Examples
1616
--------
17-
> var bool = {{alias}}( new {{alias:@stdlib/array/float16}}( 10 ) )
18-
true
17+
// TODO: update to use `array/float16` once added
18+
> var bool = {{alias}}( new {{alias:@stdlib/array/float32}}( 10 ) )
19+
false
1920
> bool = {{alias}}( [] )
2021
false
2122

lib/node_modules/@stdlib/assert/is-float16array/docs/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@
1818

1919
// TypeScript Version: 4.1
2020

21-
import Float16Array = require( '@stdlib/array/float16' );
22-
2321
/**
2422
* Tests if a value is a Float16Array.
2523
*
2624
* @param value - value to test
2725
* @returns boolean indicating whether value is a Float16Array
2826
*
2927
* @example
28+
* var Float16Array = require( '@stdlib/array/float16' );
3029
*
3130
* var bool = isFloat16Array( new Float16Array( 10 ) );
3231
* // returns true
@@ -35,7 +34,8 @@ import Float16Array = require( '@stdlib/array/float16' );
3534
* var bool = isFloat16Array( [] );
3635
* // returns false
3736
*/
38-
declare function isFloat16Array( value: any ): value is Float16Array;
37+
declare function isFloat16Array( value: any ): boolean; // TODO: replace with `value is Float16Array` once `array/float16` added
38+
3939

4040
// EXPORTS //
4141

lib/node_modules/@stdlib/assert/is-float16array/docs/types/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ import isFloat16Array = require( './index' );
2323

2424
// The function returns a boolean...
2525
{
26-
isFloat16Array( new Float16Array( 10 ) ); // $ExpectType boolean
2726
isFloat16Array( [] ); // $ExpectType boolean
2827
}
2928

3029
// The compiler throws an error if the function is provided an unsupported number of arguments...
3130
{
3231
isFloat16Array(); // $ExpectError
33-
isFloat16Array( new Float16Array( 10 ), 123 ); // $ExpectError
32+
isFloat16Array( [], 123 ); // $ExpectError
3433
}

lib/node_modules/@stdlib/assert/is-float16array/examples/index.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,11 @@ var Int32Array = require( '@stdlib/array/int32' );
2727
var Uint32Array = require( '@stdlib/array/uint32' );
2828
var Float32Array = require( '@stdlib/array/float32' );
2929
var Float64Array = require( '@stdlib/array/float64' );
30-
var Float16Array;
3130
var isFloat16Array = require( './../lib' );
3231

32+
// TODO: add example with Float16Array once `array/float16` is added
3333

34-
try {
35-
Float16Array = require( '@stdlib/array/float16' );
36-
} catch (err) {
37-
console.log( 'Float16Array is not available in this environment. Skipping all tests.' );
38-
process.exit(0);
39-
}
40-
41-
var bool = isFloat16Array( new Float16Array( 10 ) );
42-
console.log( bool );
43-
// => true
44-
45-
bool = isFloat16Array( new Int8Array( 10 ) );
34+
var bool = isFloat16Array( new Int8Array( 10 ) );
4635
console.log( bool );
4736
// => false
4837

@@ -78,7 +67,7 @@ bool = isFloat16Array( new Float64Array( 10 ) );
7867
console.log( bool );
7968
// => false
8069

81-
bool = isFloat16Array( new Array( 10 ) );
70+
bool = isFloat16Array( [] );
8271
console.log( bool );
8372
// => false
8473

lib/node_modules/@stdlib/assert/is-float16array/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
* @module @stdlib/assert/is-float16array
2525
*
2626
* @example
27+
* var Float16Array = require( '@stdlib/array/float16' );
2728
* var isFloat16Array = require( '@stdlib/assert/is-float16array' );
2829
*
29-
* var value = new Float16rray( 2 );
30-
* var bool = isFloat16Array( value );
30+
* var bool = isFloat16Array( new Float16Array( 10 ) );
3131
* // returns true
3232
*
3333
* bool = isFloat16Array( [] );

lib/node_modules/@stdlib/assert/is-float16array/lib/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19+
/* eslint-disable no-undef, stdlib/jsdoc-doctest */ // TODO: remove once `array/float16` added; consider refactoring similar to `assert/is-complex128array`
20+
1921
'use strict';
2022

2123
// MODULES //
@@ -38,12 +40,12 @@ var hasFloat16Array = ( typeof Float16Array === 'function' );
3840
*
3941
* @example
4042
* var Float16Array = require( '@stdlib/array/float16' );
41-
* var isFloat16Array = require( '@stdlib/assert/is-float16array' );
4243
*
4344
* var bool = isFloat16Array( new Float16Array( 10 ) );
4445
* // returns true
4546
*
46-
* bool = isFloat16Array( [] );
47+
* @example
48+
* var bool = isFloat16Array( [] );
4749
* // returns false
4850
*/
4951
function isFloat16Array( value ) {

lib/node_modules/@stdlib/assert/is-float16array/test/test.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ var Float64Array = require( '@stdlib/array/float64' );
3333
var isFloat16Array = require( './../lib' );
3434

3535

36-
// OPTIONS //
37-
38-
var opts = {
39-
'skip': ( typeof Float16Array === 'undefined' )
40-
};
41-
42-
4336
// TESTS //
4437

4538
tape( 'main export is a function', function test( t ) {
@@ -48,13 +41,13 @@ tape( 'main export is a function', function test( t ) {
4841
t.end();
4942
});
5043

51-
tape( 'the function returns `true` if provided a Float16Array', opts, function test( t ) {
52-
t.strictEqual( isFloat16Array( new Float16Array( 10 ) ), true, 'returns true' );
53-
t.end();
54-
});
44+
// TODO: add positive assertion test once `array/float16` is added
5545

5646
tape( 'the function returns `false` if not provided a Float16Array', function test( t ) {
57-
var values = [
47+
var values;
48+
var i;
49+
50+
values = [
5851
'5',
5952
5,
6053
NaN,
@@ -64,7 +57,7 @@ tape( 'the function returns `false` if not provided a Float16Array', function te
6457
[],
6558
{},
6659
function noop() {},
67-
new Array( 10 ),
60+
[],
6861
new Float64Array( 10 ),
6962
new Uint32Array( 10 ),
7063
new Int32Array( 10 ),
@@ -76,7 +69,7 @@ tape( 'the function returns `false` if not provided a Float16Array', function te
7669
new Float32Array( 10 )
7770
];
7871

79-
for ( var i = 0; i < values.length; i++ ) {
72+
for ( i = 0; i < values.length; i++ ) {
8073
t.strictEqual( isFloat16Array( values[i] ), false, 'returns false when provided ' + values[i] );
8174
}
8275
t.end();

0 commit comments

Comments
 (0)