UNPKG

iter-tools-es

Version:
15 lines (12 loc) 338 B
const { asyncIterableCurry } = require('../../internal/async-iterable.js'); async function* __asyncMap(source, func) { let c = 0; for await (const value of source) { yield await func(value, c++); } } exports.__asyncMap = __asyncMap; const asyncMap = /*#__PURE__*/asyncIterableCurry(__asyncMap); exports.asyncMap = asyncMap;