(shortcut: string)
| 80 | }; |
| 81 | |
| 82 | export const getShortcutKey = (shortcut: string): string => { |
| 83 | shortcut = shortcut |
| 84 | .replace(/\bAlt\b/i, "Alt") |
| 85 | .replace(/\bShift\b/i, "Shift") |
| 86 | .replace(/\b(Enter|Return)\b/i, "Enter"); |
| 87 | if (IS_APPLE || IS_MAC) { |
| 88 | return shortcut |
| 89 | .replace(/\bCtrlOrCmd\b/gi, "Cmd") |
| 90 | .replace(/\bAlt\b/i, "Option"); |
| 91 | } |
| 92 | return shortcut.replace(/\bCtrlOrCmd\b/gi, "Ctrl"); |
| 93 | }; |
no outgoing calls
no test coverage detected