Function changeClass

  • Changes the class of a given instance and returns the new object.

    Example


    class Model1 {
    id: number = 0;
    }

    class Model2 {
    id: number = 0;
    }

    const model1 = new Model1();
    const model2 = changeClass(model1, Model2);
    model2 instanceof Model2; //true

    Type Parameters

    • T

    Parameters

    Returns T

Generated using TypeDoc