import { ITable , Table } from "../table" ; export function serialize < T extends Table > ( tableClass , record ) { const res = { } ; tableClass . metadata . attributes . forEach ( ( attributeMetadata ) => { const attr = record . getAttribute ( attributeMetadata . name ) ; if ( attr !== undefined ) { res [ attributeMetadata . name ] = attr ; } } ) ; return res ; }