MCPcopy Index your code
hub / github.com/codeaashu/claude-code / convertToHookMatchers

Function convertToHookMatchers

src/utils/hooks/sessionHooks.ts:282–293  ·  view source on GitHub ↗

* Convert session hook matchers to regular hook matchers * @param sessionMatchers The session hook matchers to convert * @returns Regular hook matchers (with optional skillRoot preserved)

(
  sessionMatchers: SessionHookMatcher[],
)

Source from the content-addressed store, hash-verified

280 * @returns Regular hook matchers (with optional skillRoot preserved)
281 */
282function convertToHookMatchers(
283 sessionMatchers: SessionHookMatcher[],
284): SessionDerivedHookMatcher[] {
285 return sessionMatchers.map(sm => ({
286 matcher: sm.matcher,
287 skillRoot: sm.skillRoot,
288 // Filter out function hooks - they can't be persisted to HookMatcher format
289 hooks: sm.hooks
290 .map(h => h.hook)
291 .filter((h): h is HookCommand => h.type !== 'function'),
292 }))
293}
294
295/**
296 * Get all session hooks for a specific event (excluding function hooks)

Callers 1

getSessionHooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected