Home > @poq/transform > Transformer > toType
Method transforms plain javascript objects into array of typed instances defined by constructor of class.
Signature:
static toType<T>(plainObjs: PlainObj[], ctor: Ctor<T>, options?: TransformOptions): T[];
Parameter | Type | Description |
---|---|---|
plainObjs | PlainObj[] | Defines javascript object to transform into instance of specific type. |
ctor | Ctor<T> | Defines class/type constructor. |
options | TransformOptions | (Optional) |
Returns:
T[]
Array of instance of class/type.