import { IModel , Model } from '../model.model' ; /**
 * Manage to and from data / models
 */ export class ModelFactory { static toModels < T1 extends IModel , T2 extends Model < T1 > > ( data , obj ) { return data . map ( ( item ) : T2 => new obj ( item ) ) ; } param models static fromModels < T1 extends Model < T2 > , T2 extends IModel > ( models ) { return models . map ( ( model ) : T2 => model . toData ( ) ) ; } }