import { UserExtraDataItemResolver } from '@ulangi/ulangi-common/resolvers' ; import { UserExtraDataItem } from '@ulangi/ulangi-common/types' ; import { UserExtraDataRow } from '../interfaces/UserExtraDataRow' ; export class UserExtraDataRowConverter { private userExtraDataItemResolver = new UserExtraDataItemResolver ( ) ; public convertToUserExtraDataItems ( rows , stripUnknown ) { return this . userExtraDataItemResolver . resolveArray ( rows . map ( ( row ) : UserExtraDataItem => { return { dataName : row . dataName , dataValue : JSON . parse ( row . dataValue ) , createdAt : row . createdAt , updatedAt : row . updatedAt , firstSyncedAt : row . firstSyncedAt , lastSyncedAt : row . lastSyncedAt , } ; } ) , stripUnknown ) ; } }