import { Type } from '@angular/core'; export function deserialize(json: any, cls: Type): T { const inst = new cls(); for (const p in json) { if (!json.hasOwnProperty(p)) { continue; } inst[p] = json[p]; } return inst; };