summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/editor/editor_lite_extension_base.js
blob: b8d87fa4969ae83c54758dd340b7dd141a70e43c (plain)
1
2
3
4
5
6
7
8
9
10
11
import { ERROR_INSTANCE_REQUIRED_FOR_EXTENSION } from './constants';

export class EditorLiteExtension {
  constructor({ instance, ...options } = {}) {
    if (instance) {
      Object.assign(instance, options);
    } else if (Object.entries(options).length) {
      throw new Error(ERROR_INSTANCE_REQUIRED_FOR_EXTENSION);
    }
  }
}