MCPcopy
hub / github.com/sindresorhus/execa / getMessage

Function getMessage

lib/ipc/get-one.js:48–59  ·  view source on GitHub ↗
(ipcEmitter, filter, {signal})

Source from the content-addressed store, hash-verified

46};
47
48const getMessage = async (ipcEmitter, filter, {signal}) => {
49 if (filter === undefined) {
50 const [message] = await once(ipcEmitter, 'message', {signal});
51 return message;
52 }
53
54 for await (const [message] of on(ipcEmitter, 'message', {signal})) {
55 if (filter(message)) {
56 return message;
57 }
58 }
59};
60
61const throwOnDisconnect = async (ipcEmitter, isSubprocess, {signal}) => {
62 await once(ipcEmitter, 'disconnect', {signal});

Callers 1

getOneMessageAsyncFunction · 0.70

Calls 1

filterFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…