Odoo18-Base/addons/html_editor/static/tests/_helpers/userCommands.js

8 lines
252 B
JavaScript
Raw Permalink Normal View History

2025-01-06 10:57:38 +07:00
export function execCommand(editor, commandId, params) {
const command = editor.shared.userCommand.getCommand(commandId);
if (!command) {
throw new Error(`Unknown user command id: ${commandId}`);
}
return command.run(params);
}