MCPcopy
hub / github.com/socketio/socket.io / map

Function map

packages/engine.io/lib/parser-v3/index.ts:255–267  ·  view source on GitHub ↗

* Async array map using after

(ary, each, done)

Source from the content-addressed store, hash-verified

253 */
254
255function map(ary, each, done) {
256 const results = new Array(ary.length);
257 let count = 0;
258
259 for (let i = 0; i < ary.length; i++) {
260 each(ary[i], (error, msg) => {
261 results[i] = msg;
262 if (++count === ary.length) {
263 done(null, results);
264 }
265 });
266 }
267}
268
269/*
270 * Decodes data when a payload is maybe expected. Possible binary contents are

Callers 2

encodePayloadFunction · 0.85
encodePayloadAsBinaryFunction · 0.85

Calls 1

doneFunction · 0.85

Tested by

no test coverage detected