ig-types 6.17.0 → 6.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/Promise.js +9 -0
  2. package/README.md +8 -0
  3. package/package.json +1 -1
package/Promise.js CHANGED
@@ -249,6 +249,15 @@ object.Constructor('IterablePromise', Promise, {
249
249
  : (await Promise.all(list))
250
250
  .flat() },
251
251
 
252
+ [Symbol.asyncIterator]: async function*(){
253
+ var list = this.__packed
254
+ if(list instanceof Promise){
255
+ yield this.__unpack(await list)
256
+ return }
257
+ for await(var elem of list){
258
+ yield* elem instanceof Array ?
259
+ elem
260
+ : [elem] } },
252
261
 
253
262
  // iterator methods...
254
263
  //
package/README.md CHANGED
@@ -1580,6 +1580,14 @@ in how they process values:
1580
1580
  appropriate method on the result.
1581
1581
  <!-- XXX list + mark definitions as "(proxy)" -->
1582
1582
 
1583
+ Promise iterators directly support _for-await-of_ iteration:
1584
+
1585
+ ```javascript
1586
+ for await (var elem of Promise.iter(/* ... */)){
1587
+ // ...
1588
+ }
1589
+ ```
1590
+
1583
1591
  <!--
1584
1592
  XXX should we support generators as input?
1585
1593
  ...not sure about the control flow direction here, on one hand the generator
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ig-types",
3
- "version": "6.17.0",
3
+ "version": "6.18.0",
4
4
  "description": "Generic JavaScript types and type extensions...",
5
5
  "main": "main.js",
6
6
  "scripts": {