-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrequest.js
executable file
·28 lines (28 loc) · 1.13 KB
/
request.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"),
_classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),
_createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")),
Request = function() {
function r(e) {
(0, _classCallCheck2.default)(this, r), this.verifiy(e), this.Body = e
}
return (0, _createClass2.default)(r, [{
key: "verifiy",
value: function(e) {
if (!e.hasOwnProperty("connectType")) throw new Error("Missing 'connectType'.");
if (!e.hasOwnProperty("cmd")) throw new Error("Missing 'cmd'.")
}
}, {
key: "getParams",
value: function() {
return this.Body.hasOwnProperty("params") ? this.Body.params : {}
}
}, {
key: "getOptions",
value: function() {
var e = this.getParams();
return e.hasOwnProperty("options") ? e.options : {}
}
}]), r
}();
module.exports = Request;