Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public keys() {
const { selectParentNodeOnEscape, undoInputRuleOnBackspace } = this.options;
const backspaceRule: KeyboardBindings = undoInputRuleOnBackspace
? { Backspace: chainCommands(undoInputRule, baseKeymap.Backspace) }
: {};
const escapeRule: KeyboardBindings = selectParentNodeOnEscape ? { Escape: selectParentNode } : {};
return { ...baseKeymap, ...backspaceRule, ...escapeRule };
}
}
public keys() {
const { selectParentNodeOnEscape, undoInputRuleOnBackspace } = this.options;
const backspaceRule: KeyboardBindings = undoInputRuleOnBackspace
? { Backspace: chainCommands(undoInputRule, baseKeymap.Backspace) }
: {};
const escapeRule: KeyboardBindings = selectParentNodeOnEscape ? { Escape: selectParentNode } : {};
return { ...baseKeymap, ...backspaceRule, ...escapeRule };
}
}