This commit is contained in:
Ahmed Bouhuolia
2020-03-19 17:02:37 +02:00
parent 73711384f6
commit ab81f4be40
57 changed files with 3734 additions and 515 deletions

View File

@@ -66,6 +66,12 @@ const mapValuesDeep = (v, callback) => (
? _.mapValues(v, v => mapValuesDeep(v, callback))
: callback(v));
const promiseSerial = (funcs) => {
return funcs.reduce((promise, func) => promise.then((result) => func().then(Array.prototype.concat.bind(result))),
Promise.resolve([]));
}
export {
hashPassword,
origin,
@@ -73,4 +79,5 @@ export {
dateRangeFormat,
mapValuesDeep,
mapKeysDeep,
promiseSerial,
};