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

Function getHooksForMatcher

src/utils/hooks/hooksConfigManager.ts:380–392  ·  view source on GitHub ↗
(
  hooksByEventAndMatcher: Record<
    HookEvent,
    Record<string, IndividualHookConfig[]>
  >,
  event: HookEvent,
  matcher: string | null,
)

Source from the content-addressed store, hash-verified

378
379// Get hooks for a specific event and matcher
380export function getHooksForMatcher(
381 hooksByEventAndMatcher: Record<
382 HookEvent,
383 Record<string, IndividualHookConfig[]>
384 >,
385 event: HookEvent,
386 matcher: string | null,
387): IndividualHookConfig[] {
388 // For events without matchers, hooks are stored with empty string as key
389 // because the record keys must be strings.
390 const matcherKey = matcher ?? ''
391 return hooksByEventAndMatcher[event]?.[matcherKey] ?? []
392}
393
394// Get metadata for a specific event's matcher
395export function getMatcherMetadata(

Callers 1

HooksConfigMenuFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected