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.
 
 
 

25 lines
413 B

  1. module.exports = {
  2. save: function () {
  3. if (!this.persist)
  4. return null;
  5. let values = {};
  6. for (let p in this) {
  7. let value = this[p];
  8. if ((typeof(value) === 'function') || (p === 'obj') || (p === 'events'))
  9. continue;
  10. values[p] = value;
  11. }
  12. if (!values.expire)
  13. values.expire = (+new Date()) + (this.ttl * 350);
  14. return values;
  15. },
  16. simplify: function () {
  17. return this.type;
  18. }
  19. };