import { injectable } from 'inversify' ; import { ActionedDetails } from '../../../types' ; import { IActionDetailsParser } from '../types' ; @ injectable ( ) export class ActionDetailsParser implements IActionDetailsParser { public parse ( name , email , unixTime ) { name = ( name || '' ) . trim ( ) ; unixTime = ( unixTime || '' ) . trim ( ) ; if ( unixTime . length === 0 ) { return ; } const time = parseInt ( unixTime , 10 ) ; const date = new Date ( time * 1000 ) ; return { date , email , name , } ; } }