mgm
Version:
My generic modules
17 lines (13 loc) • 472 B
JavaScript
require('../core');
module.exports = class BaseConverter {
constructor() {}
getName() {
return this.constructor.name.uncapitalize();
}
convertToObject(stringValue) {
throw new Error(`The class ${this.constructor.name} must overwrite the method 'convertToObject'`);
}
convertToString(objectValue) {
throw new Error(`The class ${this.constructor.name} must overwrite the method 'convertToString'`);
}
}