UNPKG

slate-edit-code

Version:

A Slate plugin to handle code blocks editing.

12 lines (10 loc) 293 B
// @flow import { parseHotkey } from 'is-hotkey'; // Returns a fake Event object for the given hotkey export default function simulateKey(hotkey: string): Event { return { preventDefault() {}, stopPropagation() {}, ...parseHotkey(hotkey, { byKey: true }) }; }