The module create new class as a clone from your defined ES2015 class. It's very rare production case, but in some test case it can help where you want to isolate your tests.
npm i create-clone-class --save
You have some common class. For example:
import createCloneClass from 'create-clone-class';
class A {
constructor(variable) {
this.variable = variable;
}
method() {
return this.variable;
}
}
// create clone
const CloneA = createCloneClass(A);
// modify original
A.prototype.method = () => 'override original';
const clone = new CloneA('clone');
const original = new A('original');
clone.method(); // returns 'clone';
original.method(); // returns 'override original';