You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
340 B

exports.compare = function(a, b) {
return (
a.serial.localeCompare(b.serial) ||
// For the case serials are a same value on old logs
a.created.getTime() - b.created.getTime()
)
}
exports.deserialize = function(log) {
return Object.assign({}, log, {
date: new Date(log.date),
created: new Date(log.created)
})
}