esfunctional
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -80,3 +80,9 @@ 'use strict'; | ||
Object.prototype[global.all] = function() { | ||
return Promise.all(this); | ||
if (!(this instanceof Array)) { | ||
let mapping = this [map]((v, k) => ({key: k, value: v})); | ||
let promise = Promise.all(mapping.map(item => item.value)); | ||
return promise.then((results) => results [mapKeys]((v, k) => mapping[k].key)); | ||
} else { | ||
return Promise.all(this); | ||
} | ||
}; | ||
@@ -83,0 +89,0 @@ |
{ | ||
"name": "esfunctional", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "Next Generation EcmaScript Functional Helpers", | ||
@@ -5,0 +5,0 @@ "main": "lib/v1/index.js", |
20020
512