import { TObjectProto } from "../_.spec" ; export function dataStructDeserializer ( Constructor , data ) { if ( typeof data != 'object' ) { throw new Error ( `Cannot default-deserialize ${ Constructor . name }, because the data is of type ${ typeof data }!` ) ; } const obj = new Constructor ( ) ; for ( const kv of Object . entries ( data as Object ) ) { obj [ kv [ 0 ] ] = kv [ 1 ] ; } return obj ; } export function dataStructSerializer ( component ) { return component ; }