import { SetExtraDataItemResolver } from '@ulangi/ulangi-common/resolvers' ; import { SetExtraDataItem } from '@ulangi/ulangi-common/types' ; import { SetExtraDataRow } from '../interfaces/SetExtraDataRow' ; export class SetExtraDataRowConverter { private setExtraDataItemResolver = new SetExtraDataItemResolver ( ) ; public convertToSetExtraDataItems ( rows , stripUnknown ) { return this . setExtraDataItemResolver . resolveArray ( rows . map ( ( row ) : SetExtraDataItem => { return { dataName : row . dataName as any , dataValue : JSON . parse ( row . dataValue ) , createdAt : row . createdAt , updatedAt : row . updatedAt , firstSyncedAt : row . firstSyncedAt , lastSyncedAt : row . lastSyncedAt , } ; } ) , stripUnknown ) ; } }