Commit 9f956206 authored by 邓晓峰's avatar 邓晓峰

fix: WireMessage

parent c1e0a22f
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import { MESSAGE_TYPE, MqttProtoIdentifierv3, MqttProtoIdentifierv4 } from './consts'; import { MESSAGE_TYPE, MqttProtoIdentifierv3, MqttProtoIdentifierv4 } from './consts';
import { encodeMBI, UTF8Length, writeString, writeUint16 } from './utils'; import { encodeMBI, UTF8Length, writeString, writeUint16 } from './utils';
/* eslint-disable */ /* eslint-disable */
...@@ -18,10 +16,7 @@ import { encodeMBI, UTF8Length, writeString, writeUint16 } from './utils'; ...@@ -18,10 +16,7 @@ import { encodeMBI, UTF8Length, writeString, writeUint16 } from './utils';
// [key: string]: any // [key: string]: any
// } // }
var WireMessage = /*#__PURE__*/function () { var WireMessage = function WireMessage(type, options) {
function WireMessage(type, options) {
_classCallCheck(this, WireMessage);
this.type = type; this.type = type;
for (var name in options) { for (var name in options) {
...@@ -29,11 +24,9 @@ var WireMessage = /*#__PURE__*/function () { ...@@ -29,11 +24,9 @@ var WireMessage = /*#__PURE__*/function () {
this[name] = options[name]; this[name] = options[name];
} }
} }
} };
_createClass(WireMessage, [{ WireMessage.prototype.encode = function () {
key: "encode",
value: function encode() {
// Compute the first byte of the fixed header // Compute the first byte of the fixed header
var first = (this.type & 0x0f) << 4; var first = (this.type & 0x0f) << 4;
/* /*
...@@ -214,10 +207,6 @@ var WireMessage = /*#__PURE__*/function () { ...@@ -214,10 +207,6 @@ var WireMessage = /*#__PURE__*/function () {
} }
return buffer; return buffer;
} };
}]);
return WireMessage;
}();
export default WireMessage; export default WritableStream;
\ No newline at end of file \ No newline at end of file
"use strict"; "use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
exports.default = void 0; exports.default = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _consts = require("./consts"); var _consts = require("./consts");
var _utils = require("./utils"); var _utils = require("./utils");
...@@ -30,9 +24,7 @@ var _utils = require("./utils"); ...@@ -30,9 +24,7 @@ var _utils = require("./utils");
// keepAliveInterval?: number // keepAliveInterval?: number
// [key: string]: any // [key: string]: any
// } // }
var WireMessage = /*#__PURE__*/function () { var WireMessage = function WireMessage(type, options) {
function WireMessage(type, options) {
(0, _classCallCheck2.default)(this, WireMessage);
this.type = type; this.type = type;
for (var name in options) { for (var name in options) {
...@@ -40,11 +32,9 @@ var WireMessage = /*#__PURE__*/function () { ...@@ -40,11 +32,9 @@ var WireMessage = /*#__PURE__*/function () {
this[name] = options[name]; this[name] = options[name];
} }
} }
} };
(0, _createClass2.default)(WireMessage, [{ WireMessage.prototype.encode = function () {
key: "encode",
value: function encode() {
// Compute the first byte of the fixed header // Compute the first byte of the fixed header
var first = (this.type & 0x0f) << 4; var first = (this.type & 0x0f) << 4;
/* /*
...@@ -225,10 +215,7 @@ var WireMessage = /*#__PURE__*/function () { ...@@ -225,10 +215,7 @@ var WireMessage = /*#__PURE__*/function () {
} }
return buffer; return buffer;
} };
}]);
return WireMessage;
}();
var _default = WireMessage; var _default = WritableStream;
exports.default = _default; exports.default = _default;
\ No newline at end of file
...@@ -221,4 +221,4 @@ WireMessage.prototype.encode = function() { ...@@ -221,4 +221,4 @@ WireMessage.prototype.encode = function() {
return buffer; return buffer;
}; };
export default WritableStream export default WireMessage
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment