No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

39 líneas
729 B

  1. module.exports = {
  2. syncExtend: function (data) {
  3. let effects = this.obj.effects;
  4. effects.syncExtend(this.id, data);
  5. },
  6. isFirstOfType: function () {
  7. let effects = this.obj.effects;
  8. let firstOfType = effects.find(f => f.type === this.type);
  9. return (firstOfType.id === this);
  10. },
  11. save: function () {
  12. if (!this.persist)
  13. return null;
  14. let values = {};
  15. for (let p in this) {
  16. let value = this[p];
  17. if ((typeof(value) === 'function') || (p === 'obj') || (p === 'events'))
  18. continue;
  19. values[p] = value;
  20. }
  21. if (!values.expire)
  22. values.expire = (+new Date()) + (this.ttl * consts.tickTime);
  23. return values;
  24. },
  25. simplify: function () {
  26. return {
  27. id: this.id,
  28. type: this.type
  29. };
  30. }
  31. };