MCPcopy
hub / github.com/sindresorhus/p-queue / mapper

Function mapper

test/basic.ts:47–50  ·  view source on GitHub ↗
([value, ms]: readonly number[])

Source from the content-addressed store, hash-verified

45 const queue = new PQueue({concurrency: 1});
46
47 const mapper = async ([value, ms]: readonly number[]) => queue.add(async () => {
48 await delay(ms!);
49 return value!;
50 });
51
52 // eslint-disable-next-line unicorn/no-array-callback-reference
53 assert.deepEqual(await Promise.all(input.map(mapper)), [10, 20, 30]);

Callers

nothing calls this directly

Calls 1

addMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…