function getRecords(type) { let o = obj[type]; if(!o) o = {type, message : ''}; o.dateTime = new Date(); return [o]; }