bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-12-07 23:49:13 +03:00
parent 80eb1aa31e
commit 2ec383c0ee
2 changed files with 9 additions and 6 deletions

View File

@ -157,13 +157,16 @@ object.Constructor('IterablePromise', Promise, {
return this.__handle(list.__packed, handler, onerror) }
// handle promise / async-iterator...
// XXX ITER do we unwind the iterator here or wait to unwind later???
if(list instanceof Promise
|| (typeof(list) == 'object'
&& Symbol.asyncIterator in list)){
if(typeof(list) == 'object'
&& Symbol.asyncIterator in list){
return list
.iter(handler, onerror)
.then(function(list){
return that.__pack(list) }) }
return that.__pack(list) })
} else if(list instanceof Promise){
return list
.then(function(list){
return that.__pack(list, handler, onerror) }) }
// do the work...
// NOTE: packing and handling are mixed here because it's faster
// to do them both on a single list traverse...

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "ig-types",
"version": "6.24.5",
"version": "6.24.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ig-types",
"version": "6.24.5",
"version": "6.24.8",
"license": "BSD-3-Clause",
"dependencies": {
"ig-object": "^6.0.0",