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

Function isKeybindingBlock

src/keybindings/loadUserBindings.ts:95–103  ·  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

93 * Type guard to check if an object is a valid KeybindingBlock.
94 */
95function isKeybindingBlock(obj: unknown): obj is KeybindingBlock {
96 if (typeof obj !== 'object' || obj === null) return false
97 const b = obj as Record<string, unknown>
98 return (
99 typeof b.context === 'string' &&
100 typeof b.bindings === 'object' &&
101 b.bindings !== null
102 )
103}
104
105/**
106 * 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