MCPcopy
hub / github.com/di-sukharev/opencommit / deleteMockDispatch

Function deleteMockDispatch

out/cli.cjs:57270–57280  ·  view source on GitHub ↗
(mockDispatches, key)

Source from the content-addressed store, hash-verified

57268 }
57269 function addMockDispatch(mockDispatches, key, data) {
57270 const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false };
57271 const replyData = typeof data === "function" ? { callback: data } : { ...data };
57272 const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } };
57273 mockDispatches.push(newMockDispatch);
57274 return newMockDispatch;
57275 }
57276 function deleteMockDispatch(mockDispatches, key) {
57277 const index = mockDispatches.findIndex((dispatch) => {
57278 if (!dispatch.consumed) {
57279 return false;
57280 }
57281 return matchKey(dispatch, key);
57282 });
57283 if (index !== -1) {

Callers 2

mockDispatchFunction · 0.85
handleReplyFunction · 0.85

Calls 1

matchKeyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…