Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-11-02 04:43:21 +03:00
parent 965acefe61
commit c3c611c0bc
2 changed files with 8 additions and 8 deletions

View File

@ -227,17 +227,17 @@ var makeChunkIter = function(iter, wrapper){
func = args.shift()
;[func, postChunk] = func instanceof Array ? func : [func]
rest = args
var res = []
var _wrapper = wrapper.bind(this, res, func, this)
// special case...
// no need to setTimeout(..) if smaller than size...
if(this.length <= size){
var res = this[iter](_wrapper, ...rest)
return Promise.all(
postChunk ?
postChunk.call(this, this, res, 0)
: res) }
var res = this[iter](func, ...rest)
postChunk
&& postChunk.call(this, this, res, 0)
return Promise.all(res) }
var res = []
var _wrapper = wrapper.bind(this, res, func, this)
return new Promise(function(resolve, reject){
var next = function(chunks){

View File

@ -1,6 +1,6 @@
{
"name": "ig-types",
"version": "2.0.20",
"version": "2.0.21",
"description": "Generic JavaScript types and type extensions...",
"main": "main.js",
"scripts": {