Skip to content

Commit cead3b5

Browse files
committed
Auto-generated commit
1 parent 12c8ee8 commit cead3b5

File tree

27 files changed

+853
-13
lines changed

27 files changed

+853
-13
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-06-26)
7+
## Unreleased (2025-06-28)
88

99
<section class="features">
1010

1111
### Features
1212

13+
- [`aa50d4a`](https://github.com/stdlib-js/stdlib/commit/aa50d4a9df711679416201559c4a0513281b874e) - add 16-bit data types
14+
- [`787d8da`](https://github.com/stdlib-js/stdlib/commit/787d8da9caf55181afa9e7d198f7622660397b7d) - add half-precision data types
15+
- [`9a4ffa0`](https://github.com/stdlib-js/stdlib/commit/9a4ffa071ed1a891b0520088ff8e6b5815142f20) - add half-precision complex data type
16+
- [`6540f29`](https://github.com/stdlib-js/stdlib/commit/6540f29cc83ec1fb172986f87e14730b5973e94f) - add support for 16-bit data types
17+
- [`1390cf3`](https://github.com/stdlib-js/stdlib/commit/1390cf3c36b931394e470c7ba4950399b249c5f9) - add `isDataTypeString` to namespace
18+
- [`0ef0986`](https://github.com/stdlib-js/stdlib/commit/0ef098649fc4c4d64d8b5c06316e0793d8974651) - add `ndarray/base/assert/is-data-type-string`
1319
- [`4115e86`](https://github.com/stdlib-js/stdlib/commit/4115e8662062db0f878fe9cf33293fbf308d352f) - rename alias from `unaryReduceStrided1dToStruct` to `unaryReduceStrided1dAssignStruct`
1420
- [`03299d1`](https://github.com/stdlib-js/stdlib/commit/03299d15a76284c8e22e357794686a837faefb7e) - add `ndarray/base/unary-reduce-strided1d-assign-struct`
1521
- [`636e9ba`](https://github.com/stdlib-js/stdlib/commit/636e9ba626fb59ebd2abe0fb5562fd34bca253d3) - add `unaryReduceStrided1dToStruct` to namespace
@@ -471,6 +477,13 @@ A total of 20 issues were closed in this release:
471477

472478
<details>
473479

480+
- [`3045045`](https://github.com/stdlib-js/stdlib/commit/30450455fd87ca90d4c020faadfdb42234ff5eec) - **docs:** update dtype list _(by Athan Reines)_
481+
- [`aa50d4a`](https://github.com/stdlib-js/stdlib/commit/aa50d4a9df711679416201559c4a0513281b874e) - **feat:** add 16-bit data types _(by Athan Reines)_
482+
- [`787d8da`](https://github.com/stdlib-js/stdlib/commit/787d8da9caf55181afa9e7d198f7622660397b7d) - **feat:** add half-precision data types _(by Athan Reines)_
483+
- [`9a4ffa0`](https://github.com/stdlib-js/stdlib/commit/9a4ffa071ed1a891b0520088ff8e6b5815142f20) - **feat:** add half-precision complex data type _(by Athan Reines)_
484+
- [`6540f29`](https://github.com/stdlib-js/stdlib/commit/6540f29cc83ec1fb172986f87e14730b5973e94f) - **feat:** add support for 16-bit data types _(by Athan Reines)_
485+
- [`1390cf3`](https://github.com/stdlib-js/stdlib/commit/1390cf3c36b931394e470c7ba4950399b249c5f9) - **feat:** add `isDataTypeString` to namespace _(by Athan Reines)_
486+
- [`0ef0986`](https://github.com/stdlib-js/stdlib/commit/0ef098649fc4c4d64d8b5c06316e0793d8974651) - **feat:** add `ndarray/base/assert/is-data-type-string` _(by Athan Reines)_
474487
- [`da1761d`](https://github.com/stdlib-js/stdlib/commit/da1761d4f0a218f85d7db082086709662a09df44) - **docs:** update namespace table of contents [(#7491)](https://github.com/stdlib-js/stdlib/pull/7491) _(by stdlib-bot)_
475488
- [`97834dd`](https://github.com/stdlib-js/stdlib/commit/97834ddd6f863bd8e9b30ce10966f5db8a1f48b2) - **remove:** remove `ndarray/base/unary-reduce-strided1d-struct` _(by Athan Reines)_
476489
- [`4115e86`](https://github.com/stdlib-js/stdlib/commit/4115e8662062db0f878fe9cf33293fbf308d352f) - **feat:** rename alias from `unaryReduceStrided1dToStruct` to `unaryReduceStrided1dAssignStruct` _(by Athan Reines)_
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# isDataTypeString
22+
23+
> Test if an input value is a supported built-in ndarray [data type][@stdlib/ndarray/dtypes] string.
24+
25+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
26+
27+
<section class="intro">
28+
29+
</section>
30+
31+
<!-- /.intro -->
32+
33+
<!-- Package usage documentation. -->
34+
35+
<section class="usage">
36+
37+
## Usage
38+
39+
```javascript
40+
var isDataTypeString = require( '@stdlib/ndarray/base/assert/is-data-type-string' );
41+
```
42+
43+
#### isDataTypeString( value )
44+
45+
Tests if an input value is a supported built-in ndarray [data type][@stdlib/ndarray/dtypes] string.
46+
47+
```javascript
48+
var bool = isDataTypeString( 'float32' );
49+
// returns true
50+
51+
bool = isDataTypeString( 'int32' );
52+
// returns true
53+
```
54+
55+
</section>
56+
57+
<!-- /.usage -->
58+
59+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
60+
61+
<section class="notes">
62+
63+
</section>
64+
65+
<!-- /.notes -->
66+
67+
<!-- Package usage examples. -->
68+
69+
<section class="examples">
70+
71+
## Examples
72+
73+
<!-- eslint no-undef: "error" -->
74+
75+
```javascript
76+
var isDataTypeString = require( '@stdlib/ndarray/base/assert/is-data-type-string' );
77+
78+
var bool = isDataTypeString( 'binary' );
79+
// returns true
80+
81+
bool = isDataTypeString( 'float32' );
82+
// returns true
83+
84+
bool = isDataTypeString( 'float64' );
85+
// returns true
86+
87+
bool = isDataTypeString( 'generic' );
88+
// returns true
89+
90+
bool = isDataTypeString( 'int16' );
91+
// returns true
92+
93+
bool = isDataTypeString( 'int32' );
94+
// returns true
95+
96+
bool = isDataTypeString( 'int8' );
97+
// returns true
98+
99+
bool = isDataTypeString( 'uint16' );
100+
// returns true
101+
102+
bool = isDataTypeString( 'uint32' );
103+
// returns true
104+
105+
bool = isDataTypeString( 'uint8' );
106+
// returns true
107+
108+
bool = isDataTypeString( 'uint8c' );
109+
// returns true
110+
111+
bool = isDataTypeString( '' );
112+
// returns false
113+
114+
bool = isDataTypeString( 'foo' );
115+
// returns false
116+
```
117+
118+
</section>
119+
120+
<!-- /.examples -->
121+
122+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
123+
124+
<section class="references">
125+
126+
</section>
127+
128+
<!-- /.references -->
129+
130+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
131+
132+
<section class="related">
133+
134+
</section>
135+
136+
<!-- /.related -->
137+
138+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
139+
140+
<section class="links">
141+
142+
[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/ndarray/tree/main/dtypes
143+
144+
</section>
145+
146+
<!-- /.links -->
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var bench = require( '@stdlib/bench' );
24+
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
25+
var pkg = require( './../package.json' ).name;
26+
var isDataTypeString = require( './../lib' );
27+
28+
29+
// MAIN //
30+
31+
bench( pkg, function benchmark( b ) {
32+
var values;
33+
var out;
34+
var v;
35+
var i;
36+
37+
values = [
38+
'binary',
39+
'float32',
40+
'float64',
41+
'generic',
42+
'int16',
43+
'int32',
44+
'int8',
45+
'uint16',
46+
'uint32',
47+
'uint8',
48+
'uint8c',
49+
'foo',
50+
'bar',
51+
'',
52+
'beep',
53+
'boop'
54+
];
55+
56+
b.tic();
57+
for ( i = 0; i < b.iterations; i++ ) {
58+
v = values[ i%values.length ];
59+
out = isDataTypeString( v );
60+
if ( typeof out !== 'boolean' ) {
61+
b.fail( 'should return a boolean' );
62+
}
63+
}
64+
b.toc();
65+
if ( !isBoolean( out ) ) {
66+
b.fail( 'should return a boolean' );
67+
}
68+
b.pass( 'benchmark finished' );
69+
b.end();
70+
});
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
{{alias}}( value )
3+
Tests if an input value is a supported built-in ndarray data type string.
4+
5+
Parameters
6+
----------
7+
value: any
8+
Value to test.
9+
10+
Returns
11+
-------
12+
bool: boolean
13+
Boolean indicating if an input value is a supported built-in ndarray
14+
data type.
15+
16+
Examples
17+
--------
18+
> var bool = {{alias}}( 'binary' )
19+
true
20+
> bool = {{alias}}( 'float32' )
21+
true
22+
> bool = {{alias}}( 'float64' )
23+
true
24+
> bool = {{alias}}( 'int16' )
25+
true
26+
> bool = {{alias}}( 'int32' )
27+
true
28+
> bool = {{alias}}( 'int8' )
29+
true
30+
> bool = {{alias}}( 'uint16' )
31+
true
32+
> bool = {{alias}}( 'uint32' )
33+
true
34+
> bool = {{alias}}( 'uint8' )
35+
true
36+
> bool = {{alias}}( 'uint8c' )
37+
true
38+
> bool = {{alias}}( '' )
39+
false
40+
> bool = {{alias}}( 'beep' )
41+
false
42+
43+
See Also
44+
--------
45+
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// TypeScript Version: 4.1
20+
21+
/**
22+
* Tests whether an input value is a supported built-in ndarray data type string.
23+
*
24+
* @param v - value to test
25+
* @returns boolean indicating whether an input value is a supported built-in ndarray data type string
26+
*
27+
* @example
28+
* var bool = isDataTypeString( 'binary' );
29+
* // returns true
30+
*
31+
* bool = isDataTypeString( 'float32' );
32+
* // returns true
33+
*
34+
* bool = isDataTypeString( 'float64' );
35+
* // returns true
36+
*
37+
* bool = isDataTypeString( 'generic' );
38+
* // returns true
39+
*
40+
* bool = isDataTypeString( 'int16' );
41+
* // returns true
42+
*
43+
* bool = isDataTypeString( 'int32' );
44+
* // returns true
45+
*
46+
* bool = isDataTypeString( 'int8' );
47+
* // returns true
48+
*
49+
* bool = isDataTypeString( 'uint16' );
50+
* // returns true
51+
*
52+
* bool = isDataTypeString( 'uint32' );
53+
* // returns true
54+
*
55+
* bool = isDataTypeString( 'uint8' );
56+
* // returns true
57+
*
58+
* bool = isDataTypeString( 'uint8c' );
59+
* // returns true
60+
*
61+
* bool = isDataTypeString( 'foo' );
62+
* // returns false
63+
*/
64+
declare function isDataTypeString( v: any ): boolean;
65+
66+
67+
// EXPORTS //
68+
69+
export = isDataTypeString;

0 commit comments

Comments
 (0)