You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting a type error within the parseHotkey function in my TypeScript project:
TypeError: hotkey.replace is not a function. (In 'hotkey.replace('++', '+add')', 'hotkey.replace' is undefined)
at:
125 | var ret = {};
126 |
127 | // Special case to handle the `+` key since we use it as a separator.
> 128 | hotkey = hotkey.replace('++', '+add');
129 | var values = hotkey.split('+');
130 | var length = values.length;
I've imported this using this typescript declaration file:
declare module 'is-hotkey' {
function isHotkey(event: any)
function isHotkey(hotkey: (string | string[]), event: any)
function isHotkey(hotkey: (string | string[]), options: any, event: any)
function parseHotkey(hotkey: string, options: any)
function compareHotkey(object: any, event: any)
}
How do I fix this? Or get the compiler to stop complaining.
The text was updated successfully, but these errors were encountered:
I'm getting a type error within the
parseHotkey
function in my TypeScript project:at:
I've imported this using this typescript declaration file:
How do I fix this? Or get the compiler to stop complaining.
The text was updated successfully, but these errors were encountered: