export const Name = {
props: ["of"],
methods: {
name(objects) {
const nameObjects = objects
.filter(o=>
'name' in o &&
'of' in o &&
'timestamp' in o &&
typeof o.name == 'string' &&
o.of == this.of &&
o._by == this.of &&
typeof o.timestamp == 'number')
.sortBy('-timestamp')
return nameObjects.length?
nameObjects[0].name : 'anonymous'
}
},
template: `