Skip to content

Commit 5af409d

Browse files
committed
Auto-generated commit
1 parent b81b139 commit 5af409d

File tree

5 files changed

+29
-39
lines changed

5 files changed

+29
-39
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122

123123
### Bug Fixes
124124

125+
- [`c54d1e0`](https://github.com/stdlib-js/stdlib/commit/c54d1e095143ad68529927fe76e8ddc435592a19) - revert iterator type change
125126
- [`09ff0ce`](https://github.com/stdlib-js/stdlib/commit/09ff0ce53ae1c659591a4106c7f44b9df29bcdfd) - add missing index normalization and add associated tests
126127
- [`165c7fb`](https://github.com/stdlib-js/stdlib/commit/165c7fb75861f4c1ee28940aadbe44ba4f6e8268) - use the correct TypeScript callback signature and update docs for `array/base/for-each` [(#5448)](https://github.com/stdlib-js/stdlib/pull/5448)
127128
- [`78087d9`](https://github.com/stdlib-js/stdlib/commit/78087d9a551783d642d885fb42b89b4e23acd671) - provide missing argument to function
@@ -176,6 +177,8 @@ A total of 31 issues were closed in this release:
176177

177178
<details>
178179

180+
- [`f633319`](https://github.com/stdlib-js/stdlib/commit/f63331919c71fc22a6022ef6df2151d0d2ef3aab) - **docs:** update examples _(by Athan Reines)_
181+
- [`c54d1e0`](https://github.com/stdlib-js/stdlib/commit/c54d1e095143ad68529927fe76e8ddc435592a19) - **fix:** revert iterator type change _(by Athan Reines)_
179182
- [`b6df817`](https://github.com/stdlib-js/stdlib/commit/b6df81722b97af36092f9c6850f33e6d4795aaa4) - **docs:** fix types _(by Athan Reines)_
180183
- [`c29e97b`](https://github.com/stdlib-js/stdlib/commit/c29e97b6388cecff97906f3613880765b601da2a) - **docs:** update namespace table of contents [(#6948)](https://github.com/stdlib-js/stdlib/pull/6948) _(by stdlib-bot, Athan Reines)_
181184
- [`0f6d4e7`](https://github.com/stdlib-js/stdlib/commit/0f6d4e7694d458f76dc077d5b618e405f6cfed37) - **feat:** add `anyIsEntry` to namespace _(by Athan Reines)_

promotion-rules/README.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,28 +94,23 @@ var out = promotionRules( 'foo', 'generic' );
9494
<!-- eslint no-undef: "error" -->
9595

9696
```javascript
97+
var cartesianProduct = require( '@stdlib/array/cartesian-product' );
9798
var dtypes = require( '@stdlib/array/dtypes' );
99+
var unzip = require( '@stdlib/utils/unzip' );
100+
var logEachMap = require( '@stdlib/console/log-each-map' );
98101
var promotionRules = require( '@stdlib/array/promotion-rules' );
99102

100-
var DTYPES;
101-
var dt1;
102-
var dt2;
103-
var dt;
104-
var i;
105-
var j;
106-
107103
// Get the list of supported array data types:
108-
DTYPES = dtypes();
109-
110-
// Print the promotion rule for each pair of array data types...
111-
for ( i = 0; i < DTYPES.length; i++ ) {
112-
dt1 = DTYPES[ i ];
113-
for ( j = 0; j < DTYPES.length; j++ ) {
114-
dt2 = DTYPES[ j ];
115-
dt = promotionRules( dt1, dt2 );
116-
console.log( '(%s, %s) => %s', dt1, dt2, dt );
117-
}
118-
}
104+
var dt = dtypes();
105+
106+
// Generate a list of data type pairs:
107+
var pairs = cartesianProduct( dt, dt );
108+
109+
// Split the pairs into separate arrays:
110+
var args = unzip( pairs );
111+
112+
// Print the promotion rule for each pair of array data types:
113+
logEachMap( '(%s, %s) => %s', args[ 0 ], args[ 1 ], promotionRules );
119114
```
120115

121116
</section>

promotion-rules/examples/index.js

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,20 @@
1818

1919
'use strict';
2020

21+
var cartesianProduct = require( './../../cartesian-product' );
2122
var dtypes = require( './../../dtypes' );
23+
var unzip = require( '@stdlib/utils/unzip' );
24+
var logEachMap = require( '@stdlib/console/log-each-map' );
2225
var promotionRules = require( './../lib' );
2326

24-
var DTYPES;
25-
var dt1;
26-
var dt2;
27-
var dt;
28-
var i;
29-
var j;
30-
3127
// Get the list of supported array data types:
32-
DTYPES = dtypes();
28+
var dt = dtypes();
29+
30+
// Generate a list of data type pairs:
31+
var pairs = cartesianProduct( dt, dt );
32+
33+
// Split the pairs into separate arrays:
34+
var args = unzip( pairs );
3335

34-
// Print the promotion rule for each pair of array data types...
35-
for ( i = 0; i < DTYPES.length; i++ ) {
36-
dt1 = DTYPES[ i ];
37-
for ( j = 0; j < DTYPES.length; j++ ) {
38-
dt2 = DTYPES[ j ];
39-
dt = promotionRules( dt1, dt2 );
40-
console.log( '(%s, %s) => %s', dt1, dt2, dt );
41-
}
42-
}
36+
// Print the promotion rule for each pair of array data types:
37+
logEachMap( '(%s, %s) => %s', args[ 0 ], args[ 1 ], promotionRules );

typed/docs/types/index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
/// <reference types="@stdlib/types"/>
2424

2525
import { RealOrComplexTypedArray, TypedDataTypeMap, Collection } from '@stdlib/types/array';
26-
import { Iterator } from '@stdlib/types/iter';
2726
import ArrayBuffer = require( './../../../buffer' );
2827

2928
/**
@@ -101,7 +100,7 @@ declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( typed
101100
* var arr = typedarray( [ 5, -3 ], 'int32' );
102101
* // returns <Int32Array>[ 5, -3 ]
103102
*/
104-
declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( obj: Collection<unknown> | Iterator, dtype?: T ): TypedDataTypeMap[T];
103+
declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( obj: Collection<unknown> | Iterable<unknown>, dtype?: T ): TypedDataTypeMap[T];
105104

106105
/**
107106
* Creates a typed array.

typed/docs/types/test.ts

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

19-
import array2iterator = require( './../../../to-iterator' );
2019
import ArrayBuffer = require( './../../../buffer' );
2120
import typedarray = require( './index' );
2221

@@ -27,7 +26,6 @@ import typedarray = require( './index' );
2726
{
2827
typedarray(); // $ExpectType Float64Array
2928
typedarray( [ 1, 2, 3 ] ); // $ExpectType Float64Array
30-
typedarray( array2iterator( [ 1, 2, 3 ] ) ); // $ExpectType Float64Array
3129
typedarray( new ArrayBuffer( 10 ) ); // $ExpectType Float64Array
3230

3331
typedarray( 'float32' ); // $ExpectType Float32Array

0 commit comments

Comments
 (0)