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 { encodeMBI, UTF8Length, writeString, writeUint16 } from './utils';
/* eslint-disable */
......@@ -18,10 +16,7 @@ import { encodeMBI, UTF8Length, writeString, writeUint16 } from './utils';
// [key: string]: any
// }
var WireMessage = /*#__PURE__*/function () {
function WireMessage(type, options) {
_classCallCheck(this, WireMessage);
var WireMessage = function WireMessage(type, options) {
this.type = type;
for (var name in options) {
......@@ -29,11 +24,9 @@ var WireMessage = /*#__PURE__*/function () {
this[name] = options[name];
}
}
}
};
_createClass(WireMessage, [{
key: "encode",
value: function encode() {
WireMessage.prototype.encode = function () {
// Compute the first byte of the fixed header
var first = (this.type & 0x0f) << 4;
/*
......@@ -214,10 +207,6 @@ var WireMessage = /*#__PURE__*/function () {
}
return buffer;
}
}]);
return WireMessage;
}();
};
export default WireMessage;
\ No newline at end of file
export default WritableStream;
\ No newline at end of file
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _utils = require("./utils");
......@@ -30,9 +24,7 @@ var _utils = require("./utils");
// keepAliveInterval?: number
// [key: string]: any
// }
var WireMessage = /*#__PURE__*/function () {
function WireMessage(type, options) {
(0, _classCallCheck2.default)(this, WireMessage);
var WireMessage = function WireMessage(type, options) {
this.type = type;
for (var name in options) {
......@@ -40,11 +32,9 @@ var WireMessage = /*#__PURE__*/function () {
this[name] = options[name];
}
}
}
};
(0, _createClass2.default)(WireMessage, [{
key: "encode",
value: function encode() {
WireMessage.prototype.encode = function () {
// Compute the first byte of the fixed header
var first = (this.type & 0x0f) << 4;
/*
......@@ -225,10 +215,7 @@ var WireMessage = /*#__PURE__*/function () {
}
return buffer;
}
}]);
return WireMessage;
}();
};
var _default = WireMessage;
var _default = WritableStream;
exports.default = _default;
\ No newline at end of file
......@@ -221,4 +221,4 @@ WireMessage.prototype.encode = function() {
return buffer;
};
export default WritableStream
\ No newline at end of file
export default WireMessage
\ 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