MCPcopy Create free account
hub / github.com/anus-dev/ANUS / matchCommand

Function matchCommand

packages/cli/src/ui/keyMatchers.ts:64–71  ·  view source on GitHub ↗

* Checks if a key matches any of the bindings for a command

(
  command: Command,
  key: Key,
  config: KeyBindingConfig = defaultKeyBindings,
)

Source from the content-addressed store, hash-verified

62 * Checks if a key matches any of the bindings for a command
63 */
64function matchCommand(
65 command: Command,
66 key: Key,
67 config: KeyBindingConfig = defaultKeyBindings,
68): boolean {
69 const bindings = config[command];
70 return bindings.some((binding) => matchKeyBinding(binding, key));
71}
72
73/**
74 * Key matcher function type

Callers 1

createKeyMatchersFunction · 0.85

Calls 1

matchKeyBindingFunction · 0.85

Tested by

no test coverage detected