mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 01:17:23 +08:00
18 lines
370 B
JavaScript
18 lines
370 B
JavaScript
'use strict';
|
|
|
|
const pMapSeries = async (iterable, mapper) => {
|
|
const result = [];
|
|
let index = 0;
|
|
|
|
for (const value of iterable) {
|
|
// eslint-disable-next-line no-await-in-loop
|
|
result.push(await mapper(await value, index++));
|
|
}
|
|
|
|
return result;
|
|
};
|
|
|
|
module.exports = pMapSeries;
|
|
// TODO: Remove this for the next major release
|
|
module.exports.default = pMapSeries;
|