UNPKG

@davidcal/fec-raptorq

Version:

Node.js wrapper for RaptorQ forward error correction

14 lines (12 loc) 258 B
/** * Maps an iterable. * * The first argument is the iterable and the second argument is the mapper function. */ export const iter_map = function* (iterable, mapper) { let i = 0; for (const item of iterable) { yield mapper(item, i); i++; } };