zmdms-utils 0.0.81 → 0.0.83
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/es/validate.js +168 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +2 -6
- package/src/index.ts +0 -3
- package/src/validate.ts +198 -0
- package/dist/es/_virtual/FastBufferList.js +0 -7
- package/dist/es/_virtual/_commonjs-dynamic-modules.js +0 -5
- package/dist/es/_virtual/browser.js +0 -7
- package/dist/es/_virtual/browser2.js +0 -7
- package/dist/es/_virtual/debug.js +0 -7
- package/dist/es/_virtual/event.js +0 -7
- package/dist/es/_virtual/http-parser.js +0 -3
- package/dist/es/_virtual/iframe.js +0 -7
- package/dist/es/_virtual/index.js +0 -7
- package/dist/es/_virtual/index2.js +0 -7
- package/dist/es/_virtual/index3.js +0 -7
- package/dist/es/_virtual/index4.js +0 -7
- package/dist/es/_virtual/index5.js +0 -7
- package/dist/es/_virtual/index6.js +0 -7
- package/dist/es/_virtual/index7.js +0 -3
- package/dist/es/_virtual/index8.js +0 -7
- package/dist/es/_virtual/index9.js +0 -7
- package/dist/es/_virtual/inherits.js +0 -7
- package/dist/es/_virtual/inherits_browser.js +0 -7
- package/dist/es/_virtual/json3.js +0 -7
- package/dist/es/_virtual/node.js +0 -7
- package/dist/es/_virtual/node2.js +0 -7
- package/dist/es/_virtual/stomp-node.js +0 -3
- package/dist/es/_virtual/stomp.js +0 -3
- package/dist/es/_virtual/streams.js +0 -3
- package/dist/es/_virtual/utils.js +0 -3
- package/dist/es/node_modules/bufferutil/fallback.js +0 -43
- package/dist/es/node_modules/bufferutil/index.js +0 -21
- package/dist/es/node_modules/debug/src/browser.js +0 -192
- package/dist/es/node_modules/debug/src/common.js +0 -259
- package/dist/es/node_modules/debug/src/index.js +0 -25
- package/dist/es/node_modules/debug/src/node.js +0 -192
- package/dist/es/node_modules/eventsource/lib/eventsource.js +0 -493
- package/dist/es/node_modules/faye-websocket/lib/faye/eventsource.js +0 -150
- package/dist/es/node_modules/faye-websocket/lib/faye/websocket/api/event.js +0 -31
- package/dist/es/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js +0 -41
- package/dist/es/node_modules/faye-websocket/lib/faye/websocket/api.js +0 -205
- package/dist/es/node_modules/faye-websocket/lib/faye/websocket/client.js +0 -107
- package/dist/es/node_modules/faye-websocket/lib/faye/websocket.js +0 -47
- package/dist/es/node_modules/has-flag/index.js +0 -17
- package/dist/es/node_modules/http-parser-js/http-parser.js +0 -471
- package/dist/es/node_modules/inherits/inherits.js +0 -14
- package/dist/es/node_modules/inherits/inherits_browser.js +0 -38
- package/dist/es/node_modules/is-typedarray/index.js +0 -51
- package/dist/es/node_modules/json3/lib/json3.js +0 -937
- package/dist/es/node_modules/ms/index.js +0 -172
- package/dist/es/node_modules/node-gyp-build/index.js +0 -21
- package/dist/es/node_modules/node-gyp-build/node-gyp-build.js +0 -222
- package/dist/es/node_modules/querystringify/index.js +0 -120
- package/dist/es/node_modules/requires-port/index.js +0 -38
- package/dist/es/node_modules/safe-buffer/index.js +0 -71
- package/dist/es/node_modules/supports-color/index.js +0 -143
- package/dist/es/node_modules/typedarray-to-buffer/index.js +0 -37
- package/dist/es/node_modules/url-parse/index.js +0 -594
- package/dist/es/node_modules/utf-8-validate/fallback.js +0 -71
- package/dist/es/node_modules/utf-8-validate/index.js +0 -21
- package/dist/es/node_modules/websocket/index.js +0 -15
- package/dist/es/node_modules/websocket/lib/Deprecation.js +0 -42
- package/dist/es/node_modules/websocket/lib/W3CWebSocket.js +0 -268
- package/dist/es/node_modules/websocket/lib/WebSocketClient.js +0 -380
- package/dist/es/node_modules/websocket/lib/WebSocketConnection.js +0 -914
- package/dist/es/node_modules/websocket/lib/WebSocketFrame.js +0 -293
- package/dist/es/node_modules/websocket/lib/WebSocketRequest.js +0 -543
- package/dist/es/node_modules/websocket/lib/WebSocketRouter.js +0 -172
- package/dist/es/node_modules/websocket/lib/WebSocketRouterRequest.js +0 -67
- package/dist/es/node_modules/websocket/lib/WebSocketServer.js +0 -272
- package/dist/es/node_modules/websocket/lib/utils.js +0 -80
- package/dist/es/node_modules/websocket/lib/version.js +0 -13
- package/dist/es/node_modules/websocket/lib/websocket.js +0 -31
- package/dist/es/node_modules/websocket/node_modules/debug/src/browser.js +0 -199
- package/dist/es/node_modules/websocket/node_modules/debug/src/debug.js +0 -215
- package/dist/es/node_modules/websocket/node_modules/debug/src/index.js +0 -25
- package/dist/es/node_modules/websocket/node_modules/debug/src/node.js +0 -266
- package/dist/es/node_modules/websocket/node_modules/ms/index.js +0 -162
- package/dist/es/node_modules/websocket/package.json.js +0 -77
- package/dist/es/node_modules/websocket/vendor/FastBufferList.js +0 -205
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/base.js +0 -202
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/client.js +0 -152
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/draft75.js +0 -128
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/draft76.js +0 -124
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/headers.js +0 -44
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/hybi/frame.js +0 -21
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/hybi/message.js +0 -37
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/hybi.js +0 -492
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/proxy.js +0 -108
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/server.js +0 -119
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver/stream_reader.js +0 -72
- package/dist/es/node_modules/websocket-driver/lib/websocket/driver.js +0 -47
- package/dist/es/node_modules/websocket-driver/lib/websocket/http_parser.js +0 -140
- package/dist/es/node_modules/websocket-driver/lib/websocket/streams.js +0 -150
- package/dist/es/node_modules/websocket-extensions/lib/parser.js +0 -103
- package/dist/es/node_modules/websocket-extensions/lib/pipeline/cell.js +0 -56
- package/dist/es/node_modules/websocket-extensions/lib/pipeline/functor.js +0 -74
- package/dist/es/node_modules/websocket-extensions/lib/pipeline/index.js +0 -50
- package/dist/es/node_modules/websocket-extensions/lib/pipeline/pledge.js +0 -39
- package/dist/es/node_modules/websocket-extensions/lib/pipeline/ring_buffer.js +0 -66
- package/dist/es/node_modules/websocket-extensions/lib/websocket_extensions.js +0 -165
- package/dist/es/node_modules/yaeti/index.js +0 -17
- package/dist/es/node_modules/yaeti/lib/Event.js +0 -24
- package/dist/es/node_modules/yaeti/lib/EventTarget.js +0 -130
- package/dist/es/node_modules/zt-sockjs-client/lib/entry.js +0 -14
- package/dist/es/node_modules/zt-sockjs-client/lib/event/close.js +0 -21
- package/dist/es/node_modules/zt-sockjs-client/lib/event/event.js +0 -22
- package/dist/es/node_modules/zt-sockjs-client/lib/event/eventtarget.js +0 -62
- package/dist/es/node_modules/zt-sockjs-client/lib/event/trans-message.js +0 -19
- package/dist/es/node_modules/zt-sockjs-client/lib/facade.js +0 -40
- package/dist/es/node_modules/zt-sockjs-client/lib/iframe-bootstrap.js +0 -122
- package/dist/es/node_modules/zt-sockjs-client/lib/info-ajax.js +0 -57
- package/dist/es/node_modules/zt-sockjs-client/lib/info-iframe-receiver.js +0 -50
- package/dist/es/node_modules/zt-sockjs-client/lib/info-iframe.js +0 -81
- package/dist/es/node_modules/zt-sockjs-client/lib/info-receiver.js +0 -101
- package/dist/es/node_modules/zt-sockjs-client/lib/location.js +0 -12
- package/dist/es/node_modules/zt-sockjs-client/lib/main.js +0 -413
- package/dist/es/node_modules/zt-sockjs-client/lib/shims.js +0 -449
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/driver/websocket.js +0 -5
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/driver/xhr.js +0 -80
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/eventsource.js +0 -34
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/htmlfile.js +0 -31
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/iframe.js +0 -154
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/jsonp-polling.js +0 -41
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/ajax-based.js +0 -55
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/buffered-sender.js +0 -92
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/iframe-wrap.js +0 -39
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/polling.js +0 -65
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/sender-receiver.js +0 -52
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/eventsource.js +0 -69
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/htmlfile.js +0 -96
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/jsonp.js +0 -193
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/xhr.js +0 -75
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/jsonp.js +0 -104
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xdr.js +0 -113
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xhr-cors.js +0 -19
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xhr-fake.js +0 -28
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xhr-local.js +0 -21
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/websocket.js +0 -108
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/xdr-polling.js +0 -30
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/xdr-streaming.js +0 -38
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/xhr-polling.js +0 -40
- package/dist/es/node_modules/zt-sockjs-client/lib/transport/xhr-streaming.js +0 -50
- package/dist/es/node_modules/zt-sockjs-client/lib/transport-list.js +0 -28
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/browser.js +0 -29
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/escape.js +0 -53
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/event.js +0 -78
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/iframe.js +0 -205
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/log.js +0 -20
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/object.js +0 -24
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/random.js +0 -30
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/transport.js +0 -52
- package/dist/es/node_modules/zt-sockjs-client/lib/utils/url.js +0 -54
- package/dist/es/node_modules/zt-sockjs-client/lib/version.js +0 -11
- package/dist/es/node_modules/zt-stompjs/index.js +0 -23
- package/dist/es/node_modules/zt-stompjs/lib/stomp-node.js +0 -117
- package/dist/es/node_modules/zt-stompjs/lib/stomp.js +0 -536
- package/dist/es/stompClient.d.ts +0 -55
- package/dist/es/stompClient.js +0 -379
- package/src/stompClient.ts +0 -449
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helpers.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
var ms;
|
|
6
|
-
var hasRequiredMs;
|
|
7
|
-
|
|
8
|
-
function requireMs () {
|
|
9
|
-
if (hasRequiredMs) return ms;
|
|
10
|
-
hasRequiredMs = 1;
|
|
11
|
-
var s = 1000;
|
|
12
|
-
var m = s * 60;
|
|
13
|
-
var h = m * 60;
|
|
14
|
-
var d = h * 24;
|
|
15
|
-
var w = d * 7;
|
|
16
|
-
var y = d * 365.25;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Parse or format the given `val`.
|
|
20
|
-
*
|
|
21
|
-
* Options:
|
|
22
|
-
*
|
|
23
|
-
* - `long` verbose formatting [false]
|
|
24
|
-
*
|
|
25
|
-
* @param {String|Number} val
|
|
26
|
-
* @param {Object} [options]
|
|
27
|
-
* @throws {Error} throw an error if val is not a non-empty string or a number
|
|
28
|
-
* @return {String|Number}
|
|
29
|
-
* @api public
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
ms = function (val, options) {
|
|
33
|
-
options = options || {};
|
|
34
|
-
var type = typeof val;
|
|
35
|
-
if (type === 'string' && val.length > 0) {
|
|
36
|
-
return parse(val);
|
|
37
|
-
} else if (type === 'number' && isFinite(val)) {
|
|
38
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
39
|
-
}
|
|
40
|
-
throw new Error(
|
|
41
|
-
'val is not a non-empty string or a valid number. val=' +
|
|
42
|
-
JSON.stringify(val)
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Parse the given `str` and return milliseconds.
|
|
48
|
-
*
|
|
49
|
-
* @param {String} str
|
|
50
|
-
* @return {Number}
|
|
51
|
-
* @api private
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
function parse(str) {
|
|
55
|
-
str = String(str);
|
|
56
|
-
if (str.length > 100) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
60
|
-
str
|
|
61
|
-
);
|
|
62
|
-
if (!match) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
var n = parseFloat(match[1]);
|
|
66
|
-
var type = (match[2] || 'ms').toLowerCase();
|
|
67
|
-
switch (type) {
|
|
68
|
-
case 'years':
|
|
69
|
-
case 'year':
|
|
70
|
-
case 'yrs':
|
|
71
|
-
case 'yr':
|
|
72
|
-
case 'y':
|
|
73
|
-
return n * y;
|
|
74
|
-
case 'weeks':
|
|
75
|
-
case 'week':
|
|
76
|
-
case 'w':
|
|
77
|
-
return n * w;
|
|
78
|
-
case 'days':
|
|
79
|
-
case 'day':
|
|
80
|
-
case 'd':
|
|
81
|
-
return n * d;
|
|
82
|
-
case 'hours':
|
|
83
|
-
case 'hour':
|
|
84
|
-
case 'hrs':
|
|
85
|
-
case 'hr':
|
|
86
|
-
case 'h':
|
|
87
|
-
return n * h;
|
|
88
|
-
case 'minutes':
|
|
89
|
-
case 'minute':
|
|
90
|
-
case 'mins':
|
|
91
|
-
case 'min':
|
|
92
|
-
case 'm':
|
|
93
|
-
return n * m;
|
|
94
|
-
case 'seconds':
|
|
95
|
-
case 'second':
|
|
96
|
-
case 'secs':
|
|
97
|
-
case 'sec':
|
|
98
|
-
case 's':
|
|
99
|
-
return n * s;
|
|
100
|
-
case 'milliseconds':
|
|
101
|
-
case 'millisecond':
|
|
102
|
-
case 'msecs':
|
|
103
|
-
case 'msec':
|
|
104
|
-
case 'ms':
|
|
105
|
-
return n;
|
|
106
|
-
default:
|
|
107
|
-
return undefined;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Short format for `ms`.
|
|
113
|
-
*
|
|
114
|
-
* @param {Number} ms
|
|
115
|
-
* @return {String}
|
|
116
|
-
* @api private
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
|
-
function fmtShort(ms) {
|
|
120
|
-
var msAbs = Math.abs(ms);
|
|
121
|
-
if (msAbs >= d) {
|
|
122
|
-
return Math.round(ms / d) + 'd';
|
|
123
|
-
}
|
|
124
|
-
if (msAbs >= h) {
|
|
125
|
-
return Math.round(ms / h) + 'h';
|
|
126
|
-
}
|
|
127
|
-
if (msAbs >= m) {
|
|
128
|
-
return Math.round(ms / m) + 'm';
|
|
129
|
-
}
|
|
130
|
-
if (msAbs >= s) {
|
|
131
|
-
return Math.round(ms / s) + 's';
|
|
132
|
-
}
|
|
133
|
-
return ms + 'ms';
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Long format for `ms`.
|
|
138
|
-
*
|
|
139
|
-
* @param {Number} ms
|
|
140
|
-
* @return {String}
|
|
141
|
-
* @api private
|
|
142
|
-
*/
|
|
143
|
-
|
|
144
|
-
function fmtLong(ms) {
|
|
145
|
-
var msAbs = Math.abs(ms);
|
|
146
|
-
if (msAbs >= d) {
|
|
147
|
-
return plural(ms, msAbs, d, 'day');
|
|
148
|
-
}
|
|
149
|
-
if (msAbs >= h) {
|
|
150
|
-
return plural(ms, msAbs, h, 'hour');
|
|
151
|
-
}
|
|
152
|
-
if (msAbs >= m) {
|
|
153
|
-
return plural(ms, msAbs, m, 'minute');
|
|
154
|
-
}
|
|
155
|
-
if (msAbs >= s) {
|
|
156
|
-
return plural(ms, msAbs, s, 'second');
|
|
157
|
-
}
|
|
158
|
-
return ms + ' ms';
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Pluralization helper.
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
|
-
function plural(ms, msAbs, n, name) {
|
|
166
|
-
var isPlural = msAbs >= n * 1.5;
|
|
167
|
-
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
168
|
-
}
|
|
169
|
-
return ms;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export { requireMs as __require };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { commonjsRequire } from '../../_virtual/_commonjs-dynamic-modules.js';
|
|
2
|
-
import { __module as nodeGypBuild, exports as nodeGypBuildExports } from '../../_virtual/index6.js';
|
|
3
|
-
import { __require as requireNodeGypBuild$1 } from './node-gyp-build.js';
|
|
4
|
-
|
|
5
|
-
var hasRequiredNodeGypBuild;
|
|
6
|
-
|
|
7
|
-
function requireNodeGypBuild () {
|
|
8
|
-
if (hasRequiredNodeGypBuild) return nodeGypBuildExports;
|
|
9
|
-
hasRequiredNodeGypBuild = 1;
|
|
10
|
-
(function (module) {
|
|
11
|
-
const runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : commonjsRequire; // eslint-disable-line
|
|
12
|
-
if (typeof runtimeRequire.addon === 'function') { // if the platform supports native resolving prefer that
|
|
13
|
-
module.exports = runtimeRequire.addon.bind(runtimeRequire);
|
|
14
|
-
} else { // else use the runtime version here
|
|
15
|
-
module.exports = requireNodeGypBuild$1();
|
|
16
|
-
}
|
|
17
|
-
} (nodeGypBuild));
|
|
18
|
-
return nodeGypBuildExports;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { requireNodeGypBuild as __require };
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { commonjsRequire } from '../../_virtual/_commonjs-dynamic-modules.js';
|
|
2
|
-
import require$$3 from 'fs';
|
|
3
|
-
import require$$1 from 'path';
|
|
4
|
-
import require$$2 from 'os';
|
|
5
|
-
|
|
6
|
-
var nodeGypBuild;
|
|
7
|
-
var hasRequiredNodeGypBuild;
|
|
8
|
-
|
|
9
|
-
function requireNodeGypBuild () {
|
|
10
|
-
if (hasRequiredNodeGypBuild) return nodeGypBuild;
|
|
11
|
-
hasRequiredNodeGypBuild = 1;
|
|
12
|
-
var fs = require$$3;
|
|
13
|
-
var path = require$$1;
|
|
14
|
-
var os = require$$2;
|
|
15
|
-
|
|
16
|
-
// Workaround to fix webpack's build warnings: 'the request of a dependency is an expression'
|
|
17
|
-
var runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : commonjsRequire; // eslint-disable-line
|
|
18
|
-
|
|
19
|
-
var vars = (process.config && process.config.variables) || {};
|
|
20
|
-
var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
|
|
21
|
-
var abi = process.versions.modules; // TODO: support old node where this is undef
|
|
22
|
-
var runtime = isElectron() ? 'electron' : (isNwjs() ? 'node-webkit' : 'node');
|
|
23
|
-
|
|
24
|
-
var arch = process.env.npm_config_arch || os.arch();
|
|
25
|
-
var platform = process.env.npm_config_platform || os.platform();
|
|
26
|
-
var libc = process.env.LIBC || (isAlpine(platform) ? 'musl' : 'glibc');
|
|
27
|
-
var armv = process.env.ARM_VERSION || (arch === 'arm64' ? '8' : vars.arm_version) || '';
|
|
28
|
-
var uv = (process.versions.uv || '').split('.')[0];
|
|
29
|
-
|
|
30
|
-
nodeGypBuild = load;
|
|
31
|
-
|
|
32
|
-
function load (dir) {
|
|
33
|
-
return runtimeRequire(load.resolve(dir))
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
load.resolve = load.path = function (dir) {
|
|
37
|
-
dir = path.resolve(dir || '.');
|
|
38
|
-
|
|
39
|
-
try {
|
|
40
|
-
var name = runtimeRequire(path.join(dir, 'package.json')).name.toUpperCase().replace(/-/g, '_');
|
|
41
|
-
if (process.env[name + '_PREBUILD']) dir = process.env[name + '_PREBUILD'];
|
|
42
|
-
} catch (err) {}
|
|
43
|
-
|
|
44
|
-
if (!prebuildsOnly) {
|
|
45
|
-
var release = getFirst(path.join(dir, 'build/Release'), matchBuild);
|
|
46
|
-
if (release) return release
|
|
47
|
-
|
|
48
|
-
var debug = getFirst(path.join(dir, 'build/Debug'), matchBuild);
|
|
49
|
-
if (debug) return debug
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
var prebuild = resolve(dir);
|
|
53
|
-
if (prebuild) return prebuild
|
|
54
|
-
|
|
55
|
-
var nearby = resolve(path.dirname(process.execPath));
|
|
56
|
-
if (nearby) return nearby
|
|
57
|
-
|
|
58
|
-
var target = [
|
|
59
|
-
'platform=' + platform,
|
|
60
|
-
'arch=' + arch,
|
|
61
|
-
'runtime=' + runtime,
|
|
62
|
-
'abi=' + abi,
|
|
63
|
-
'uv=' + uv,
|
|
64
|
-
armv ? 'armv=' + armv : '',
|
|
65
|
-
'libc=' + libc,
|
|
66
|
-
'node=' + process.versions.node,
|
|
67
|
-
process.versions.electron ? 'electron=' + process.versions.electron : '',
|
|
68
|
-
typeof __webpack_require__ === 'function' ? 'webpack=true' : '' // eslint-disable-line
|
|
69
|
-
].filter(Boolean).join(' ');
|
|
70
|
-
|
|
71
|
-
throw new Error('No native build was found for ' + target + '\n loaded from: ' + dir + '\n')
|
|
72
|
-
|
|
73
|
-
function resolve (dir) {
|
|
74
|
-
// Find matching "prebuilds/<platform>-<arch>" directory
|
|
75
|
-
var tuples = readdirSync(path.join(dir, 'prebuilds')).map(parseTuple);
|
|
76
|
-
var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
|
|
77
|
-
if (!tuple) return
|
|
78
|
-
|
|
79
|
-
// Find most specific flavor first
|
|
80
|
-
var prebuilds = path.join(dir, 'prebuilds', tuple.name);
|
|
81
|
-
var parsed = readdirSync(prebuilds).map(parseTags);
|
|
82
|
-
var candidates = parsed.filter(matchTags(runtime, abi));
|
|
83
|
-
var winner = candidates.sort(compareTags(runtime))[0];
|
|
84
|
-
if (winner) return path.join(prebuilds, winner.file)
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
function readdirSync (dir) {
|
|
89
|
-
try {
|
|
90
|
-
return fs.readdirSync(dir)
|
|
91
|
-
} catch (err) {
|
|
92
|
-
return []
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function getFirst (dir, filter) {
|
|
97
|
-
var files = readdirSync(dir).filter(filter);
|
|
98
|
-
return files[0] && path.join(dir, files[0])
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function matchBuild (name) {
|
|
102
|
-
return /\.node$/.test(name)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function parseTuple (name) {
|
|
106
|
-
// Example: darwin-x64+arm64
|
|
107
|
-
var arr = name.split('-');
|
|
108
|
-
if (arr.length !== 2) return
|
|
109
|
-
|
|
110
|
-
var platform = arr[0];
|
|
111
|
-
var architectures = arr[1].split('+');
|
|
112
|
-
|
|
113
|
-
if (!platform) return
|
|
114
|
-
if (!architectures.length) return
|
|
115
|
-
if (!architectures.every(Boolean)) return
|
|
116
|
-
|
|
117
|
-
return { name, platform, architectures }
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function matchTuple (platform, arch) {
|
|
121
|
-
return function (tuple) {
|
|
122
|
-
if (tuple == null) return false
|
|
123
|
-
if (tuple.platform !== platform) return false
|
|
124
|
-
return tuple.architectures.includes(arch)
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function compareTuples (a, b) {
|
|
129
|
-
// Prefer single-arch prebuilds over multi-arch
|
|
130
|
-
return a.architectures.length - b.architectures.length
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function parseTags (file) {
|
|
134
|
-
var arr = file.split('.');
|
|
135
|
-
var extension = arr.pop();
|
|
136
|
-
var tags = { file: file, specificity: 0 };
|
|
137
|
-
|
|
138
|
-
if (extension !== 'node') return
|
|
139
|
-
|
|
140
|
-
for (var i = 0; i < arr.length; i++) {
|
|
141
|
-
var tag = arr[i];
|
|
142
|
-
|
|
143
|
-
if (tag === 'node' || tag === 'electron' || tag === 'node-webkit') {
|
|
144
|
-
tags.runtime = tag;
|
|
145
|
-
} else if (tag === 'napi') {
|
|
146
|
-
tags.napi = true;
|
|
147
|
-
} else if (tag.slice(0, 3) === 'abi') {
|
|
148
|
-
tags.abi = tag.slice(3);
|
|
149
|
-
} else if (tag.slice(0, 2) === 'uv') {
|
|
150
|
-
tags.uv = tag.slice(2);
|
|
151
|
-
} else if (tag.slice(0, 4) === 'armv') {
|
|
152
|
-
tags.armv = tag.slice(4);
|
|
153
|
-
} else if (tag === 'glibc' || tag === 'musl') {
|
|
154
|
-
tags.libc = tag;
|
|
155
|
-
} else {
|
|
156
|
-
continue
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
tags.specificity++;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return tags
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function matchTags (runtime, abi) {
|
|
166
|
-
return function (tags) {
|
|
167
|
-
if (tags == null) return false
|
|
168
|
-
if (tags.runtime && tags.runtime !== runtime && !runtimeAgnostic(tags)) return false
|
|
169
|
-
if (tags.abi && tags.abi !== abi && !tags.napi) return false
|
|
170
|
-
if (tags.uv && tags.uv !== uv) return false
|
|
171
|
-
if (tags.armv && tags.armv !== armv) return false
|
|
172
|
-
if (tags.libc && tags.libc !== libc) return false
|
|
173
|
-
|
|
174
|
-
return true
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function runtimeAgnostic (tags) {
|
|
179
|
-
return tags.runtime === 'node' && tags.napi
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function compareTags (runtime) {
|
|
183
|
-
// Precedence: non-agnostic runtime, abi over napi, then by specificity.
|
|
184
|
-
return function (a, b) {
|
|
185
|
-
if (a.runtime !== b.runtime) {
|
|
186
|
-
return a.runtime === runtime ? -1 : 1
|
|
187
|
-
} else if (a.abi !== b.abi) {
|
|
188
|
-
return a.abi ? -1 : 1
|
|
189
|
-
} else if (a.specificity !== b.specificity) {
|
|
190
|
-
return a.specificity > b.specificity ? -1 : 1
|
|
191
|
-
} else {
|
|
192
|
-
return 0
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
function isNwjs () {
|
|
198
|
-
return !!(process.versions && process.versions.nw)
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function isElectron () {
|
|
202
|
-
if (process.versions && process.versions.electron) return true
|
|
203
|
-
if (process.env.ELECTRON_RUN_AS_NODE) return true
|
|
204
|
-
return typeof window !== 'undefined' && window.process && window.process.type === 'renderer'
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
function isAlpine (platform) {
|
|
208
|
-
return platform === 'linux' && fs.existsSync('/etc/alpine-release')
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// Exposed for unit tests
|
|
212
|
-
// TODO: move to lib
|
|
213
|
-
load.parseTags = parseTags;
|
|
214
|
-
load.matchTags = matchTags;
|
|
215
|
-
load.compareTags = compareTags;
|
|
216
|
-
load.parseTuple = parseTuple;
|
|
217
|
-
load.matchTuple = matchTuple;
|
|
218
|
-
load.compareTuples = compareTuples;
|
|
219
|
-
return nodeGypBuild;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
export { requireNodeGypBuild as __require };
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { __exports as querystringify$1 } from '../../_virtual/index7.js';
|
|
2
|
-
|
|
3
|
-
var has = Object.prototype.hasOwnProperty
|
|
4
|
-
, undef;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Decode a URI encoded string.
|
|
8
|
-
*
|
|
9
|
-
* @param {String} input The URI encoded string.
|
|
10
|
-
* @returns {String|Null} The decoded string.
|
|
11
|
-
* @api private
|
|
12
|
-
*/
|
|
13
|
-
function decode(input) {
|
|
14
|
-
try {
|
|
15
|
-
return decodeURIComponent(input.replace(/\+/g, ' '));
|
|
16
|
-
} catch (e) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Attempts to encode a given input.
|
|
23
|
-
*
|
|
24
|
-
* @param {String} input The string that needs to be encoded.
|
|
25
|
-
* @returns {String|Null} The encoded string.
|
|
26
|
-
* @api private
|
|
27
|
-
*/
|
|
28
|
-
function encode(input) {
|
|
29
|
-
try {
|
|
30
|
-
return encodeURIComponent(input);
|
|
31
|
-
} catch (e) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Simple query string parser.
|
|
38
|
-
*
|
|
39
|
-
* @param {String} query The query string that needs to be parsed.
|
|
40
|
-
* @returns {Object}
|
|
41
|
-
* @api public
|
|
42
|
-
*/
|
|
43
|
-
function querystring(query) {
|
|
44
|
-
var parser = /([^=?#&]+)=?([^&]*)/g
|
|
45
|
-
, result = {}
|
|
46
|
-
, part;
|
|
47
|
-
|
|
48
|
-
while (part = parser.exec(query)) {
|
|
49
|
-
var key = decode(part[1])
|
|
50
|
-
, value = decode(part[2]);
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
// Prevent overriding of existing properties. This ensures that build-in
|
|
54
|
-
// methods like `toString` or __proto__ are not overriden by malicious
|
|
55
|
-
// querystrings.
|
|
56
|
-
//
|
|
57
|
-
// In the case if failed decoding, we want to omit the key/value pairs
|
|
58
|
-
// from the result.
|
|
59
|
-
//
|
|
60
|
-
if (key === null || value === null || key in result) continue;
|
|
61
|
-
result[key] = value;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return result;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Transform a query string to an object.
|
|
69
|
-
*
|
|
70
|
-
* @param {Object} obj Object that should be transformed.
|
|
71
|
-
* @param {String} prefix Optional prefix.
|
|
72
|
-
* @returns {String}
|
|
73
|
-
* @api public
|
|
74
|
-
*/
|
|
75
|
-
function querystringify(obj, prefix) {
|
|
76
|
-
prefix = prefix || '';
|
|
77
|
-
|
|
78
|
-
var pairs = []
|
|
79
|
-
, value
|
|
80
|
-
, key;
|
|
81
|
-
|
|
82
|
-
//
|
|
83
|
-
// Optionally prefix with a '?' if needed
|
|
84
|
-
//
|
|
85
|
-
if ('string' !== typeof prefix) prefix = '?';
|
|
86
|
-
|
|
87
|
-
for (key in obj) {
|
|
88
|
-
if (has.call(obj, key)) {
|
|
89
|
-
value = obj[key];
|
|
90
|
-
|
|
91
|
-
//
|
|
92
|
-
// Edge cases where we actually want to encode the value to an empty
|
|
93
|
-
// string instead of the stringified value.
|
|
94
|
-
//
|
|
95
|
-
if (!value && (value === null || value === undef || isNaN(value))) {
|
|
96
|
-
value = '';
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
key = encode(key);
|
|
100
|
-
value = encode(value);
|
|
101
|
-
|
|
102
|
-
//
|
|
103
|
-
// If we failed to encode the strings, we should bail out as we don't
|
|
104
|
-
// want to add invalid strings to the query.
|
|
105
|
-
//
|
|
106
|
-
if (key === null || value === null) continue;
|
|
107
|
-
pairs.push(key +'='+ value);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return pairs.length ? prefix + pairs.join('&') : '';
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
//
|
|
115
|
-
// Expose the module.
|
|
116
|
-
//
|
|
117
|
-
querystringify$1.stringify = querystringify;
|
|
118
|
-
querystringify$1.parse = querystring;
|
|
119
|
-
|
|
120
|
-
export { querystringify$1 as default };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if we're required to add a port number.
|
|
3
|
-
*
|
|
4
|
-
* @see https://url.spec.whatwg.org/#default-port
|
|
5
|
-
* @param {Number|String} port Port number we need to check
|
|
6
|
-
* @param {String} protocol Protocol we need to check against.
|
|
7
|
-
* @returns {Boolean} Is it a default port for the given protocol
|
|
8
|
-
* @api private
|
|
9
|
-
*/
|
|
10
|
-
var requiresPort = function required(port, protocol) {
|
|
11
|
-
protocol = protocol.split(':')[0];
|
|
12
|
-
port = +port;
|
|
13
|
-
|
|
14
|
-
if (!port) return false;
|
|
15
|
-
|
|
16
|
-
switch (protocol) {
|
|
17
|
-
case 'http':
|
|
18
|
-
case 'ws':
|
|
19
|
-
return port !== 80;
|
|
20
|
-
|
|
21
|
-
case 'https':
|
|
22
|
-
case 'wss':
|
|
23
|
-
return port !== 443;
|
|
24
|
-
|
|
25
|
-
case 'ftp':
|
|
26
|
-
return port !== 21;
|
|
27
|
-
|
|
28
|
-
case 'gopher':
|
|
29
|
-
return port !== 70;
|
|
30
|
-
|
|
31
|
-
case 'file':
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return port !== 0;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export { requiresPort as default };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { exports as safeBufferExports, __module as safeBuffer } from '../../_virtual/index9.js';
|
|
2
|
-
import require$$0 from 'buffer';
|
|
3
|
-
|
|
4
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
5
|
-
|
|
6
|
-
(function (module, exports) {
|
|
7
|
-
/* eslint-disable node/no-deprecated-api */
|
|
8
|
-
var buffer = require$$0;
|
|
9
|
-
var Buffer = buffer.Buffer;
|
|
10
|
-
|
|
11
|
-
// alternative to using Object.keys for old browsers
|
|
12
|
-
function copyProps (src, dst) {
|
|
13
|
-
for (var key in src) {
|
|
14
|
-
dst[key] = src[key];
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
|
|
18
|
-
module.exports = buffer;
|
|
19
|
-
} else {
|
|
20
|
-
// Copy properties from require('buffer')
|
|
21
|
-
copyProps(buffer, exports);
|
|
22
|
-
exports.Buffer = SafeBuffer;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function SafeBuffer (arg, encodingOrOffset, length) {
|
|
26
|
-
return Buffer(arg, encodingOrOffset, length)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
SafeBuffer.prototype = Object.create(Buffer.prototype);
|
|
30
|
-
|
|
31
|
-
// Copy static methods from Buffer
|
|
32
|
-
copyProps(Buffer, SafeBuffer);
|
|
33
|
-
|
|
34
|
-
SafeBuffer.from = function (arg, encodingOrOffset, length) {
|
|
35
|
-
if (typeof arg === 'number') {
|
|
36
|
-
throw new TypeError('Argument must not be a number')
|
|
37
|
-
}
|
|
38
|
-
return Buffer(arg, encodingOrOffset, length)
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
SafeBuffer.alloc = function (size, fill, encoding) {
|
|
42
|
-
if (typeof size !== 'number') {
|
|
43
|
-
throw new TypeError('Argument must be a number')
|
|
44
|
-
}
|
|
45
|
-
var buf = Buffer(size);
|
|
46
|
-
if (fill !== undefined) {
|
|
47
|
-
if (typeof encoding === 'string') {
|
|
48
|
-
buf.fill(fill, encoding);
|
|
49
|
-
} else {
|
|
50
|
-
buf.fill(fill);
|
|
51
|
-
}
|
|
52
|
-
} else {
|
|
53
|
-
buf.fill(0);
|
|
54
|
-
}
|
|
55
|
-
return buf
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
SafeBuffer.allocUnsafe = function (size) {
|
|
59
|
-
if (typeof size !== 'number') {
|
|
60
|
-
throw new TypeError('Argument must be a number')
|
|
61
|
-
}
|
|
62
|
-
return Buffer(size)
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
SafeBuffer.allocUnsafeSlow = function (size) {
|
|
66
|
-
if (typeof size !== 'number') {
|
|
67
|
-
throw new TypeError('Argument must be a number')
|
|
68
|
-
}
|
|
69
|
-
return buffer.SlowBuffer(size)
|
|
70
|
-
};
|
|
71
|
-
} (safeBuffer, safeBufferExports));
|