@lobehub/editor
Version:
A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.
9 lines • 368 B
JavaScript
import { isModifierMatch } from 'lexical';
import { mapCode, parseHotkey } from "./parseHotkeys";
export var isHotkeyMatch = function isHotkeyMatch(event, hotkey) {
var keys = parseHotkey(hotkey);
var modifierMatch = isModifierMatch(event, keys.modifiers);
if (!modifierMatch) return false;
if (mapCode(event.code) !== keys.key) return false;
return true;
};