for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
/**
* Create a new MenuItem
*
* The constructor needs the following keys:
* command: must be command function created by prosemirror-commands or similar
*/
class MenuItem {
constructor(options = {}) {
if (typeof options.command !== 'function') {
throw new Error('command is not a function!');
}
this.command = options.command;
if (!(options.dom instanceof Element)) {
Element
/** global: Element */
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.
throw new Error('dom must be a DOM node!');
this.dom = options.dom;
exports.MenuItem = MenuItem;
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.