UNPKG

auspice

Version:

Web app for visualizing pathogen evolution

13 lines (10 loc) 257 B
'use strict'; const pReduce = require('p-reduce'); module.exports = (iterable, iterator) => { const ret = []; return pReduce(iterable, (a, b, i) => { return Promise.resolve(iterator(b, i)).then(val => { ret.push(val); }); }).then(() => ret); };