MCPcopy Create free account
hub / github.com/Noumena-Network/code / getHooksForMatcher

Function getHooksForMatcher

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

Source from the content-addressed store, hash-verified

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

Callers 1

HooksConfigMenuFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected