Merge branch 'master' of github.com:flynx/types.js

This commit is contained in:
Alex A. Naanou 2023-01-10 16:00:59 +03:00
commit 8b008d24f2

View File

@ -199,8 +199,8 @@ function(list){
return list.flat() }
//
// onResolveItem(<list>, <onupdate>[, <ondone>])
// onResolveItem(<list>, <options>)
// itemResolved(<list>, <onupdate>[, <ondone>])
// itemResolved(<list>, <options>)
// -> <list>
//
// <onupdate>(<elem>, <index>, <list>)
@ -216,8 +216,8 @@ function(list){
// }
//
// XXX rename to Promise.each(..) or Promise.eachPromise(..) ???
var onResolveItem =
module.onResolveItem =
var itemResolved =
module.itemResolved =
function(list, onupdate, ondone){
if(typeof(onupdate) != 'function'){
var {onupdate, ondone} = onupdate }
@ -230,7 +230,7 @@ function(list, onupdate, ondone){
onupdate(elem, i, list) }) } }
return list }
// Like onResolveItem(..) but both onupdate and ondone are optional...
// Like itemResolved(..) but both onupdate and ondone are optional...
//
// XXX do not modify the array after this is called and until ondone(..) is called...
// XXX should this know how to expand things???
@ -240,7 +240,7 @@ function(list, onupdate, ondone){
if(onupdate
&& typeof(onupdate) != 'function'){
var {onupdate, ondone} = onupdate }
return onResolveItem(list,
return itemResolved(list,
function(elem, i, list){
list[i] = elem
typeof(onupdate) == 'function'