Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mqtt-client
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
mqtt-client
Commits
9f956206
Commit
9f956206
authored
Nov 16, 2020
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: WireMessage
parent
c1e0a22f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
37 deletions
+14
-37
WireMessage.js
es/WireMessage.js
+6
-17
WireMessage.js
lib/WireMessage.js
+6
-18
WireMessage.js
src/WireMessage.js
+2
-2
No files found.
es/WireMessage.js
View file @
9f956206
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
lib/WireMessage.js
View file @
9f956206
"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
=
W
ireMessage
;
var
_default
=
W
ritableStream
;
exports
.
default
=
_default
;
exports
.
default
=
_default
;
\ No newline at end of file
src/WireMessage.js
View file @
9f956206
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment