From 05fd0a26d7e7122c7c788509689f65bb2a2baaa8 Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Mon, 29 Jun 2020 15:43:24 +0100 Subject: [PATCH] Tighten key bind types to string -> string --- src/lib/keyseq.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/keyseq.ts b/src/lib/keyseq.ts index 14cc8cbb..db1493ad 100644 --- a/src/lib/keyseq.ts +++ b/src/lib/keyseq.ts @@ -374,14 +374,14 @@ export function translateKeysInPlace(keys, conf): void { export function keyMap(conf): KeyMap { if (KEYMAP_CACHE[conf]) return KEYMAP_CACHE[conf] - let maps: any = config.get(conf) - if (maps === undefined) + const mapobj: {[keyseq: string]: string} = config.get(conf) + if (mapobj === undefined) throw new Error( "No binds defined for this mode. Reload page with and add binds, e.g. :bind --mode=[mode] mode normal", ) // Convert to KeyMap - maps = new Map(Object.entries(maps)) + const maps = new Map(Object.entries(mapobj)) KEYMAP_CACHE[conf] = mapstrMapToKeyMap(maps) return KEYMAP_CACHE[conf] }