MCPcopy
hub / github.com/affaan-m/ECC / getHookCommandById

Function getHookCommandById

tests/integration/hooks.test.js:268–274  ·  view source on GitHub ↗
(hooks, lifecycle, hookId)

Source from the content-addressed store, hash-verified

266}
267
268function getHookCommandById(hooks, lifecycle, hookId) {
269 const hookGroup = hooks.hooks[lifecycle]?.find(entry => entry.id === hookId);
270
271 assert.ok(hookGroup, `Expected ${lifecycle} hook with id "${hookId}"`);
272 assert.ok(hookGroup.hooks?.[0]?.command, `Expected ${lifecycle} hook command for id "${hookId}"`);
273 return hookGroup.hooks[0].command;
274}
275
276// Test suite
277async function runTests() {

Callers 1

runTestsFunction · 0.85

Calls 1

okMethod · 0.80

Tested by

no test coverage detected