MCPcopy Create free account
hub / github.com/anomalyco/opencode / dropUnknownKeybinds

Function dropUnknownKeybinds

packages/opencode/src/config/tui.ts:71–81  ·  view source on GitHub ↗
(input: Record<string, unknown>)

Source from the content-addressed store, hash-verified

69}
70
71function dropUnknownKeybinds(input: Record<string, unknown>) {
72 if (!isRecord(input.keybinds)) return input
73
74 const invalid = TuiKeybind.unknownKeys(input.keybinds)
75 if (!invalid.length) return input
76
77 return {
78 ...input,
79 keybinds: Object.fromEntries(Object.entries(input.keybinds).filter(([key]) => !invalid.includes(key))),
80 }
81}
82
83const loadState = Effect.fn("TuiConfig.loadState")(function* (ctx: { directory: string }) {
84 const afs = yield* FSUtil.Service

Callers 1

loadFunction · 0.85

Calls 1

isRecordFunction · 0.90

Tested by

no test coverage detected