Changes the class of a given instance and returns the new object.
class Model1 { id: number = 0; } class Model2 { id: number = 0; } const model1 = new Model1(); const model2 = changeClass(model1, Model2); model2 instanceof Model2; //true
Generated using TypeDoc
Changes the class of a given instance and returns the new object.
Example