type Constructor < T > = { new ( ... args ) : T ; } ; export function toModel < T > ( className , data ) { if ( data === null || data === undefined ) { return null ; } return Object . assign ( new className ( ) , data ) ; }