UNPKG

linagora-rse

Version:
11 lines (8 loc) 348 B
'use strict'; var mongoose = require('mongoose'); var TimelineEntry = mongoose.model('TimelineEntry'); function asObject(timelineentry) { var options = {virtuals: true}; return timelineentry instanceof TimelineEntry ? timelineentry.toObject(options) : new TimelineEntry(timelineentry).toObject(options); } module.exports.asObject = asObject;