junkurihara/cascade

View on GitHub
src/suite.js

Summary

Maintainability
A
40 mins
Test Coverage
/**
 * suite.js
 */

export class Suite {
  constructor() {
    if (new.target === Suite) {
      throw new TypeError('SuiteClassCannotBeInstantiatedDirectly');
    }
    if (
      this.constructor.generateKey === undefined ||
      this.constructor.encrypt === undefined ||
      this.constructor.decrypt === undefined ||
      this.constructor.sign === undefined ||
      this.constructor.verify === undefined ||
      this.constructor.importKey === undefined
    ) {
      throw new TypeError('MustOverrideAllMethods');
    }
  }
}