Skip to content

Commit

Permalink
Adjust js doc message, fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
Cbodfield authored May 6, 2024
1 parent e9dbc5b commit eaf4842
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hotkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit eaf4842

Please sign in to comment.