MCPcopy Create free account
hub / github.com/freecodexyz/free-code / isKeybindingBlock

Function isKeybindingBlock

src/keybindings/validate.ts:39–47  ·  view source on GitHub ↗

* Type guard to check if an object is a valid KeybindingBlock.

(obj: unknown)

Source from the content-addressed store, hash-verified

37 * Type guard to check if an object is a valid KeybindingBlock.
38 */
39function isKeybindingBlock(obj: unknown): obj is KeybindingBlock {
40 if (typeof obj !== 'object' || obj === null) return false
41 const b = obj as Record<string, unknown>
42 return (
43 typeof b.context === 'string' &&
44 typeof b.bindings === 'object' &&
45 b.bindings !== null
46 )
47}
48
49/**
50 * Type guard to check if an array contains only valid KeybindingBlocks.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected