diff --git a/src/hotkey.ts b/src/hotkey.ts index 91a9a0f..3ca6e3d 100644 --- a/src/hotkey.ts +++ b/src/hotkey.ts @@ -76,7 +76,7 @@ const modifierKeyNames: string[] = ['Control', 'Alt', 'Meta', 'Shift'] * platforms. * - Ensures modifiers are sorted in a consistent order * @param hotkey a hotkey string - * @param platform NOTE: this param is only intended to be used to mock `navigator.platform` in tests + * @param platform NOTE: this param is only intended to be used to mock `navigator.platform` in tests. `window.navigator.platform` is used by default. * @returns {string} normalized representation of the given hotkey string */ export function normalizeHotkey(hotkey: string, platform?: string | undefined): NormalizedHotkeyString { @@ -88,7 +88,7 @@ export function normalizeHotkey(hotkey: string, platform?: string | undefined): const matchApplePlatform = /Mac|iPod|iPhone|iPad/i -function localizeMod(hotkey: string, platform?: string): string { +function localizeMod(hotkey: string, platform: string): string { const ssrSafeWindow = typeof window === "undefined" ? undefined : window const safePlatform = ssrSafeWindow ? ssrSafeWindow.navigator.platform