Closed ghost closed 7 years ago
I think the type parameter T of deserialize
T
deserialize
function deserialize<T>(modelschema: ClazzOrModelSchema<T>, jsonArray: any[], ...): T[];
would be more straightforward if it takes the type of the array itself, instead of its element, i.e.
function deserialize<T extends any[]>(modelschema: ClazzOrModelSchema<T[0]>, jsonArray: any[], ...): T;
and call it like:
deserialize<Model[]>(Model, array, ...);
I think the type parameter
T
ofdeserialize
would be more straightforward if it takes the type of the array itself, instead of its element, i.e.
and call it like: