Keine Beschreibung

MsgBase.js 562B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var uuid_1 = require("uuid");
  4. var MsgBase = (function () {
  5. function MsgBase() {
  6. this.id = uuid_1.v1();
  7. }
  8. MsgBase.prototype.isValid = function () {
  9. if (!this.from || !this.to) {
  10. return false;
  11. }
  12. return true;
  13. };
  14. MsgBase.createMsg = function (baseMsg) {
  15. var msg = new MsgBase();
  16. Object.assign(msg, baseMsg);
  17. return msg;
  18. };
  19. return MsgBase;
  20. }());
  21. exports.MsgBase = MsgBase;