Skip to content

Commit 70dda4f

Browse files
committed
feat: add support for non-string data types
--- 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: na - task: lint_javascript_src status: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 97f4bb8 commit 70dda4f

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

lib/node_modules/@stdlib/ndarray/base/assert/is-complex-floating-point-data-type/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var isComplexFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-co
4444

4545
#### isComplexFloatingPointDataType( value )
4646

47-
Tests if an input `value` is a supported ndarray complex-valued floating-point data type.
47+
Tests if an input value is a supported ndarray complex-valued floating-point data type.
4848

4949
<!-- eslint-disable id-length -->
5050

lib/node_modules/@stdlib/ndarray/base/assert/is-complex-floating-point-data-type/lib/main.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ var contains = require( '@stdlib/array/base/assert/contains' ).factory;
2424
var dtypes = require( '@stdlib/ndarray/dtypes' );
2525

2626

27+
// VARIABLES //
28+
29+
var isDataType = contains( dtypes( 'complex_floating_point' ) );
30+
31+
2732
// MAIN //
2833

2934
/**
@@ -77,7 +82,9 @@ var dtypes = require( '@stdlib/ndarray/dtypes' );
7782
* bool = isComplexFloatingPointDataType( 'foo' );
7883
* // returns false
7984
*/
80-
var isComplexFloatingPointDataType = contains( dtypes( 'complex_floating_point' ) ); // eslint-disable-line id-length
85+
function isComplexFloatingPointDataType( v ) { // eslint-disable-line id-length
86+
return isDataType( String( v ) );
87+
}
8188

8289

8390
// EXPORTS //

lib/node_modules/@stdlib/ndarray/base/assert/is-complex-floating-point-data-type/test/test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24+
var DataType = require( '@stdlib/ndarray/dtype-ctor' );
2425
var isComplexFloatingPointDataType = require( './../lib' ); // eslint-disable-line id-length
2526

2627

@@ -39,7 +40,9 @@ tape( 'the function returns `true` if provided a supported ndarray complex-value
3940

4041
values = [
4142
'complex64',
42-
'complex128'
43+
'complex128',
44+
new DataType( 'complex64' ),
45+
new DataType( 'complex128' )
4346
];
4447
for ( i = 0; i < values.length; i++ ) {
4548
bool = isComplexFloatingPointDataType( values[ i ] );
@@ -67,6 +70,8 @@ tape( 'the function returns `false` if not provided a supported ndarray complex-
6770
'int8',
6871
'generic',
6972

73+
new DataType( 'generic' ),
74+
7075
// Unsupported dtypes:
7176
'float',
7277
'int',

0 commit comments

Comments
 (0)