summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/editor/extensions/editor_lite_extension_base.js
blob: 8d35006897392716a1e9e01129e01dc589bb7bdf (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);
    }
  }
}