Skip to content

Commit 73169db

Browse files
committed
Auto-generated commit
1 parent e93c58c commit 73169db

File tree

29 files changed

+1230
-61
lines changed

29 files changed

+1230
-61
lines changed

.github/.keepalive

-1
This file was deleted.

CHANGELOG.md

+84
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130

131131
##### Features
132132

133+
- [`c1b6794`](https://github.com/stdlib-js/stdlib/commit/c1b6794e36255d7df6795f5f5f4d3e493165f397) - add `isOutputDataTypePolicy` to namespace
133134
- [`e661213`](https://github.com/stdlib-js/stdlib/commit/e66121352ef767cdb87d19e938b1eccf7970fa3a) - update namespace TypeScript declarations [(#4706)](https://github.com/stdlib-js/stdlib/pull/4706)
134135
- [`a94dcea`](https://github.com/stdlib-js/stdlib/commit/a94dceaa9469c774ee4622567e4c15a15e215bcf) - add `isColumnMajorString` to namespace
135136
- [`5e1be08`](https://github.com/stdlib-js/stdlib/commit/5e1be08ff661fb981dc4a91c2e9d37d7396327f5) - add `isRowMajorString` to namespace
@@ -179,6 +180,28 @@
179180

180181
<!-- /.package -->
181182

183+
<section class="package" id="ndarray-base-assert-is-output--unreleased">
184+
185+
#### [@stdlib/ndarray/base/assert/is-output-](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/assert/is-output-)
186+
187+
<details>
188+
189+
<section class="features">
190+
191+
##### Features
192+
193+
- [`9cabe87`](https://github.com/stdlib-js/stdlib/commit/9cabe87a0ce5401967f41d91dc4479a722ba3288) - add `ndarray/base/assert/is-output-data-type-policy`
194+
195+
</section>
196+
197+
<!-- /.features -->
198+
199+
</details>
200+
201+
</section>
202+
203+
<!-- /.package -->
204+
182205
<section class="package" id="ndarray-base-assert-is-row-major-string-unreleased">
183206

184207
#### [@stdlib/ndarray/base/assert/is-row-major-string](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/assert/is-row-major-string)
@@ -550,6 +573,28 @@
550573

551574
<!-- /.package -->
552575

576+
<section class="package" id="ndarray-base-unary-output-dtype-unreleased">
577+
578+
#### [@stdlib/ndarray/base/unary-output-dtype](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/unary-output-dtype)
579+
580+
<details>
581+
582+
<section class="features">
583+
584+
##### Features
585+
586+
- [`f230249`](https://github.com/stdlib-js/stdlib/commit/f23024908c1d43ff5c2a8402a53cad2ff1054366) - add support for `_and_generic` data type policies
587+
588+
</section>
589+
590+
<!-- /.features -->
591+
592+
</details>
593+
594+
</section>
595+
596+
<!-- /.package -->
597+
553598
<section class="package" id="ndarray-filter-unreleased">
554599

555600
#### [@stdlib/ndarray/filter](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/filter)
@@ -717,6 +762,38 @@
717762

718763
<!-- /.package -->
719764

765+
<section class="package" id="ndarray-output-dtype-policies-unreleased">
766+
767+
#### [@stdlib/ndarray/output-dtype-policies](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/output-dtype-policies)
768+
769+
<details>
770+
771+
<section class="features">
772+
773+
##### Features
774+
775+
- [`2b8c0d7`](https://github.com/stdlib-js/stdlib/commit/2b8c0d7579975a2fffdcf8cd8607d93ab8fe5658) - add policies which support returning a \"generic\" data type
776+
777+
</section>
778+
779+
<!-- /.features -->
780+
781+
<section class="bug-fixes">
782+
783+
##### Bug Fixes
784+
785+
- [`ba9b416`](https://github.com/stdlib-js/stdlib/commit/ba9b4160f16f1ae1a7f8603920ae0a9f43e6b29f) - rename `bool` to `boolean` to match data type kind and avoid conflict with `bool` data type
786+
787+
</section>
788+
789+
<!-- /.bug-fixes -->
790+
791+
</details>
792+
793+
</section>
794+
795+
<!-- /.package -->
796+
720797
<section class="package" id="ndarray-reject-unreleased">
721798

722799
#### [@stdlib/ndarray/reject](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/reject)
@@ -821,6 +898,13 @@ A total of 4 people contributed to this release. Thank you to the following cont
821898

822899
<details>
823900

901+
- [`c1b6794`](https://github.com/stdlib-js/stdlib/commit/c1b6794e36255d7df6795f5f5f4d3e493165f397) - **feat:** add `isOutputDataTypePolicy` to namespace _(by Athan Reines)_
902+
- [`9cabe87`](https://github.com/stdlib-js/stdlib/commit/9cabe87a0ce5401967f41d91dc4479a722ba3288) - **feat:** add `ndarray/base/assert/is-output-data-type-policy` _(by Athan Reines)_
903+
- [`2632915`](https://github.com/stdlib-js/stdlib/commit/2632915e58a2949e11840ce39161f5056a700afc) - **test:** fix variable name _(by Athan Reines)_
904+
- [`f230249`](https://github.com/stdlib-js/stdlib/commit/f23024908c1d43ff5c2a8402a53cad2ff1054366) - **feat:** add support for `_and_generic` data type policies _(by Athan Reines)_
905+
- [`c27d672`](https://github.com/stdlib-js/stdlib/commit/c27d672d1d72d49c7331f44b9b00f6324d67f218) - **test:** fix tests due to upstream patches _(by Athan Reines)_
906+
- [`ba9b416`](https://github.com/stdlib-js/stdlib/commit/ba9b4160f16f1ae1a7f8603920ae0a9f43e6b29f) - **fix:** rename `bool` to `boolean` to match data type kind and avoid conflict with `bool` data type _(by Athan Reines)_
907+
- [`2b8c0d7`](https://github.com/stdlib-js/stdlib/commit/2b8c0d7579975a2fffdcf8cd8607d93ab8fe5658) - **feat:** add policies which support returning a \"generic\" data type _(by Athan Reines)_
824908
- [`81e5755`](https://github.com/stdlib-js/stdlib/commit/81e5755a07adae5d75fbbd113f677d57247c94bc) - **refactor:** update path _(by Athan Reines)_
825909
- [`d38fd36`](https://github.com/stdlib-js/stdlib/commit/d38fd36fcf6ac58240b13abe41ceb3046f36a8b2) - **style:** resolve lint errors _(by Athan Reines)_
826910
- [`836170d`](https://github.com/stdlib-js/stdlib/commit/836170decec14309639deb41ae3a3c22256d68af) - **refactor:** update paths _(by Gururaj Gurram)_

CONTRIBUTORS

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ Yaswanth Kosuru <[email protected]>
135135
Yernar Yergaziyev <[email protected]>
136136
Yuvi Mittal <[email protected]>
137137
ekambains <[email protected]>
138+
fadiothman22 <[email protected]>
138139
olenkabilonizhka <[email protected]>
139140
pranav-1720 <[email protected]>
140141

base/assert/is-boolean-data-type/docs/types/test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
* limitations under the License.
1717
*/
1818

19-
import isFloatingPointDataType = require( './index' );
19+
import isBooleanDataType = require( './index' );
2020

2121

2222
// TESTS //
2323

2424
// The function returns a boolean...
2525
{
26-
isFloatingPointDataType( 'binary' ); // $ExpectType boolean
27-
isFloatingPointDataType( 'foo' ); // $ExpectType boolean
26+
isBooleanDataType( 'binary' ); // $ExpectType boolean
27+
isBooleanDataType( 'foo' ); // $ExpectType boolean
2828
}
2929

3030
// The compiler throws an error if the function is provided an unsupported number of arguments...
3131
{
32-
isFloatingPointDataType(); // $ExpectError
33-
isFloatingPointDataType( undefined, 123 ); // $ExpectError
32+
isBooleanDataType(); // $ExpectError
33+
isBooleanDataType( undefined, 123 ); // $ExpectError
3434
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
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+
# isOutputDataTypePolicy
22+
23+
> Test if an input value is a supported ndarray output data type [policy][@stdlib/ndarray/output-dtype-policies].
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 isOutputDataTypePolicy = require( '@stdlib/ndarray/base/assert/is-output-data-type-policy' );
41+
```
42+
43+
#### isOutputDataTypePolicy( value )
44+
45+
Tests if an input `value` is a supported ndarray output data type [policy][@stdlib/ndarray/output-dtype-policies].
46+
47+
```javascript
48+
var bool = isOutputDataTypePolicy( 'numeric' );
49+
// returns true
50+
51+
bool = isOutputDataTypePolicy( 'foo' );
52+
// returns false
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 isOutputDataTypePolicy = require( '@stdlib/ndarray/base/assert/is-output-data-type-policy' );
77+
78+
var bool = isOutputDataTypePolicy( 'boolean' );
79+
// returns true
80+
81+
bool = isOutputDataTypePolicy( 'real' );
82+
// returns true
83+
84+
bool = isOutputDataTypePolicy( 'numeric' );
85+
// returns true
86+
87+
bool = isOutputDataTypePolicy( '' );
88+
// returns false
89+
90+
bool = isOutputDataTypePolicy( 'foo' );
91+
// returns false
92+
```
93+
94+
</section>
95+
96+
<!-- /.examples -->
97+
98+
<!-- 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. -->
99+
100+
<section class="references">
101+
102+
</section>
103+
104+
<!-- /.references -->
105+
106+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
107+
108+
<section class="related">
109+
110+
</section>
111+
112+
<!-- /.related -->
113+
114+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
115+
116+
<section class="links">
117+
118+
[@stdlib/ndarray/output-dtype-policies]: https://github.com/stdlib-js/ndarray/tree/main/output-dtype-policies
119+
120+
</section>
121+
122+
<!-- /.links -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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 isOutputDataTypePolicy = 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+
'boolean',
39+
'floating_point',
40+
'real',
41+
'numeric',
42+
'boolean_and_generic',
43+
'foo',
44+
'bar',
45+
'',
46+
'beep',
47+
'boop'
48+
];
49+
50+
b.tic();
51+
for ( i = 0; i < b.iterations; i++ ) {
52+
v = values[ i%values.length ];
53+
out = isOutputDataTypePolicy( v );
54+
if ( typeof out !== 'boolean' ) {
55+
b.fail( 'should return a boolean' );
56+
}
57+
}
58+
b.toc();
59+
if ( !isBoolean( out ) ) {
60+
b.fail( 'should return a boolean' );
61+
}
62+
b.pass( 'benchmark finished' );
63+
b.end();
64+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
{{alias}}( value )
3+
Tests if an input value is a supported ndarray output data type policy.
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 ndarray output data
14+
type policy.
15+
16+
Examples
17+
--------
18+
> var bool = {{alias}}( 'boolean' )
19+
true
20+
> bool = {{alias}}( 'real' )
21+
true
22+
> bool = {{alias}}( 'numeric' )
23+
true
24+
> bool = {{alias}}( '' )
25+
false
26+
> bool = {{alias}}( 'beep' )
27+
false
28+
29+
See Also
30+
--------
31+

0 commit comments

Comments
 (0)