Function
normalize
(raw: Record<string, unknown>)
Source from the content-addressed store, hash-verified
| 53 | } |
| 54 | |
| 55 | function normalize(raw: Record<string, unknown>) { |
| 56 | const data = { ...raw } |
| 57 | if (!("tui" in data)) return data |
| 58 | if (!isRecord(data.tui)) { |
| 59 | delete data.tui |
| 60 | return data |
| 61 | } |
| 62 | |
| 63 | const tui = data.tui |
| 64 | delete data.tui |
| 65 | return { |
| 66 | ...tui, |
| 67 | ...data, |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | function dropUnknownKeybinds(input: Record<string, unknown>) { |
| 72 | if (!isRecord(input.keybinds)) return input |
Tested by
no test coverage detected