@nsshunt/stsdatamanagement 1.17.60 → 1.17.62
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/stsdatamanagement.mjs +1941 -142
- package/dist/stsdatamanagement.mjs.map +1 -1
- package/dist/stsdatamanagement.umd.js +2003 -203
- package/dist/stsdatamanagement.umd.js.map +1 -1
- package/package.json +2 -1
|
@@ -27,18 +27,16 @@ var __privateMethod = (obj, member, method) => {
|
|
|
27
27
|
return method;
|
|
28
28
|
};
|
|
29
29
|
var _options2, _observer, _pool, _cache, _pgpool, _poolManager, _latestResourceVersion, latestResourceVersion_fn, _buildQueryString, buildQueryString_fn, _options3, _accessLayer, _useMultiBar, _workerScriptFolder, _accessLayer2;
|
|
30
|
-
import process from "process";
|
|
31
30
|
import { $Options } from "@nsshunt/stsconfig";
|
|
32
31
|
import { $stsgd, Sleep } from "@nsshunt/stsutils";
|
|
33
32
|
import Debug from "debug";
|
|
34
33
|
import colors from "colors";
|
|
35
34
|
import require$$0$5 from "events";
|
|
36
|
-
import require$$0$6, { Buffer as Buffer$2 } from "buffer";
|
|
37
35
|
import crypto$2 from "crypto";
|
|
38
36
|
import require$$0$4 from "path";
|
|
39
37
|
import require$$1 from "fs";
|
|
40
38
|
import require$$0$3 from "stream";
|
|
41
|
-
import
|
|
39
|
+
import require$$0$6 from "buffer";
|
|
42
40
|
import * as fs$2 from "node:fs/promises";
|
|
43
41
|
import si from "systeminformation";
|
|
44
42
|
import { v4 } from "uuid";
|
|
@@ -81,6 +79,195 @@ function getAugmentedNamespace(n) {
|
|
|
81
79
|
});
|
|
82
80
|
return a;
|
|
83
81
|
}
|
|
82
|
+
const global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
83
|
+
function defaultSetTimout() {
|
|
84
|
+
throw new Error("setTimeout has not been defined");
|
|
85
|
+
}
|
|
86
|
+
function defaultClearTimeout() {
|
|
87
|
+
throw new Error("clearTimeout has not been defined");
|
|
88
|
+
}
|
|
89
|
+
var cachedSetTimeout = defaultSetTimout;
|
|
90
|
+
var cachedClearTimeout = defaultClearTimeout;
|
|
91
|
+
if (typeof global$1.setTimeout === "function") {
|
|
92
|
+
cachedSetTimeout = setTimeout;
|
|
93
|
+
}
|
|
94
|
+
if (typeof global$1.clearTimeout === "function") {
|
|
95
|
+
cachedClearTimeout = clearTimeout;
|
|
96
|
+
}
|
|
97
|
+
function runTimeout(fun) {
|
|
98
|
+
if (cachedSetTimeout === setTimeout) {
|
|
99
|
+
return setTimeout(fun, 0);
|
|
100
|
+
}
|
|
101
|
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
102
|
+
cachedSetTimeout = setTimeout;
|
|
103
|
+
return setTimeout(fun, 0);
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
return cachedSetTimeout(fun, 0);
|
|
107
|
+
} catch (e) {
|
|
108
|
+
try {
|
|
109
|
+
return cachedSetTimeout.call(null, fun, 0);
|
|
110
|
+
} catch (e2) {
|
|
111
|
+
return cachedSetTimeout.call(this, fun, 0);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function runClearTimeout(marker) {
|
|
116
|
+
if (cachedClearTimeout === clearTimeout) {
|
|
117
|
+
return clearTimeout(marker);
|
|
118
|
+
}
|
|
119
|
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
120
|
+
cachedClearTimeout = clearTimeout;
|
|
121
|
+
return clearTimeout(marker);
|
|
122
|
+
}
|
|
123
|
+
try {
|
|
124
|
+
return cachedClearTimeout(marker);
|
|
125
|
+
} catch (e) {
|
|
126
|
+
try {
|
|
127
|
+
return cachedClearTimeout.call(null, marker);
|
|
128
|
+
} catch (e2) {
|
|
129
|
+
return cachedClearTimeout.call(this, marker);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
var queue = [];
|
|
134
|
+
var draining = false;
|
|
135
|
+
var currentQueue;
|
|
136
|
+
var queueIndex = -1;
|
|
137
|
+
function cleanUpNextTick() {
|
|
138
|
+
if (!draining || !currentQueue) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
draining = false;
|
|
142
|
+
if (currentQueue.length) {
|
|
143
|
+
queue = currentQueue.concat(queue);
|
|
144
|
+
} else {
|
|
145
|
+
queueIndex = -1;
|
|
146
|
+
}
|
|
147
|
+
if (queue.length) {
|
|
148
|
+
drainQueue();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function drainQueue() {
|
|
152
|
+
if (draining) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
var timeout = runTimeout(cleanUpNextTick);
|
|
156
|
+
draining = true;
|
|
157
|
+
var len = queue.length;
|
|
158
|
+
while (len) {
|
|
159
|
+
currentQueue = queue;
|
|
160
|
+
queue = [];
|
|
161
|
+
while (++queueIndex < len) {
|
|
162
|
+
if (currentQueue) {
|
|
163
|
+
currentQueue[queueIndex].run();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
queueIndex = -1;
|
|
167
|
+
len = queue.length;
|
|
168
|
+
}
|
|
169
|
+
currentQueue = null;
|
|
170
|
+
draining = false;
|
|
171
|
+
runClearTimeout(timeout);
|
|
172
|
+
}
|
|
173
|
+
function nextTick(fun) {
|
|
174
|
+
var args = new Array(arguments.length - 1);
|
|
175
|
+
if (arguments.length > 1) {
|
|
176
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
177
|
+
args[i - 1] = arguments[i];
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
queue.push(new Item(fun, args));
|
|
181
|
+
if (queue.length === 1 && !draining) {
|
|
182
|
+
runTimeout(drainQueue);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function Item(fun, array2) {
|
|
186
|
+
this.fun = fun;
|
|
187
|
+
this.array = array2;
|
|
188
|
+
}
|
|
189
|
+
Item.prototype.run = function() {
|
|
190
|
+
this.fun.apply(null, this.array);
|
|
191
|
+
};
|
|
192
|
+
var title = "browser";
|
|
193
|
+
var platform = "browser";
|
|
194
|
+
var browser = true;
|
|
195
|
+
var env = {};
|
|
196
|
+
var argv = [];
|
|
197
|
+
var version = "";
|
|
198
|
+
var versions = {};
|
|
199
|
+
var release = {};
|
|
200
|
+
var config$1 = {};
|
|
201
|
+
function noop$2() {
|
|
202
|
+
}
|
|
203
|
+
var on = noop$2;
|
|
204
|
+
var addListener = noop$2;
|
|
205
|
+
var once = noop$2;
|
|
206
|
+
var off = noop$2;
|
|
207
|
+
var removeListener = noop$2;
|
|
208
|
+
var removeAllListeners = noop$2;
|
|
209
|
+
var emit = noop$2;
|
|
210
|
+
function binding(name) {
|
|
211
|
+
throw new Error("process.binding is not supported");
|
|
212
|
+
}
|
|
213
|
+
function cwd() {
|
|
214
|
+
return "/";
|
|
215
|
+
}
|
|
216
|
+
function chdir(dir) {
|
|
217
|
+
throw new Error("process.chdir is not supported");
|
|
218
|
+
}
|
|
219
|
+
function umask() {
|
|
220
|
+
return 0;
|
|
221
|
+
}
|
|
222
|
+
var performance = global$1.performance || {};
|
|
223
|
+
var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function() {
|
|
224
|
+
return (/* @__PURE__ */ new Date()).getTime();
|
|
225
|
+
};
|
|
226
|
+
function hrtime(previousTimestamp) {
|
|
227
|
+
var clocktime = performanceNow.call(performance) * 1e-3;
|
|
228
|
+
var seconds2 = Math.floor(clocktime);
|
|
229
|
+
var nanoseconds = Math.floor(clocktime % 1 * 1e9);
|
|
230
|
+
if (previousTimestamp) {
|
|
231
|
+
seconds2 = seconds2 - previousTimestamp[0];
|
|
232
|
+
nanoseconds = nanoseconds - previousTimestamp[1];
|
|
233
|
+
if (nanoseconds < 0) {
|
|
234
|
+
seconds2--;
|
|
235
|
+
nanoseconds += 1e9;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return [seconds2, nanoseconds];
|
|
239
|
+
}
|
|
240
|
+
var startTime = /* @__PURE__ */ new Date();
|
|
241
|
+
function uptime() {
|
|
242
|
+
var currentTime = /* @__PURE__ */ new Date();
|
|
243
|
+
var dif = currentTime - startTime;
|
|
244
|
+
return dif / 1e3;
|
|
245
|
+
}
|
|
246
|
+
var browser$1 = {
|
|
247
|
+
nextTick,
|
|
248
|
+
title,
|
|
249
|
+
browser,
|
|
250
|
+
env,
|
|
251
|
+
argv,
|
|
252
|
+
version,
|
|
253
|
+
versions,
|
|
254
|
+
on,
|
|
255
|
+
addListener,
|
|
256
|
+
once,
|
|
257
|
+
off,
|
|
258
|
+
removeListener,
|
|
259
|
+
removeAllListeners,
|
|
260
|
+
emit,
|
|
261
|
+
binding,
|
|
262
|
+
cwd,
|
|
263
|
+
chdir,
|
|
264
|
+
umask,
|
|
265
|
+
hrtime,
|
|
266
|
+
platform,
|
|
267
|
+
release,
|
|
268
|
+
config: config$1,
|
|
269
|
+
uptime
|
|
270
|
+
};
|
|
84
271
|
var libExports$3 = {};
|
|
85
272
|
var lib$3 = {
|
|
86
273
|
get exports() {
|
|
@@ -90,6 +277,1620 @@ var lib$3 = {
|
|
|
90
277
|
libExports$3 = v;
|
|
91
278
|
}
|
|
92
279
|
};
|
|
280
|
+
var lookup$1 = [];
|
|
281
|
+
var revLookup = [];
|
|
282
|
+
var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
|
283
|
+
var inited = false;
|
|
284
|
+
function init$2() {
|
|
285
|
+
inited = true;
|
|
286
|
+
var code2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
287
|
+
for (var i = 0, len = code2.length; i < len; ++i) {
|
|
288
|
+
lookup$1[i] = code2[i];
|
|
289
|
+
revLookup[code2.charCodeAt(i)] = i;
|
|
290
|
+
}
|
|
291
|
+
revLookup["-".charCodeAt(0)] = 62;
|
|
292
|
+
revLookup["_".charCodeAt(0)] = 63;
|
|
293
|
+
}
|
|
294
|
+
function toByteArray(b64) {
|
|
295
|
+
if (!inited) {
|
|
296
|
+
init$2();
|
|
297
|
+
}
|
|
298
|
+
var i, j, l, tmp, placeHolders, arr;
|
|
299
|
+
var len = b64.length;
|
|
300
|
+
if (len % 4 > 0) {
|
|
301
|
+
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
302
|
+
}
|
|
303
|
+
placeHolders = b64[len - 2] === "=" ? 2 : b64[len - 1] === "=" ? 1 : 0;
|
|
304
|
+
arr = new Arr(len * 3 / 4 - placeHolders);
|
|
305
|
+
l = placeHolders > 0 ? len - 4 : len;
|
|
306
|
+
var L = 0;
|
|
307
|
+
for (i = 0, j = 0; i < l; i += 4, j += 3) {
|
|
308
|
+
tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
|
|
309
|
+
arr[L++] = tmp >> 16 & 255;
|
|
310
|
+
arr[L++] = tmp >> 8 & 255;
|
|
311
|
+
arr[L++] = tmp & 255;
|
|
312
|
+
}
|
|
313
|
+
if (placeHolders === 2) {
|
|
314
|
+
tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
|
|
315
|
+
arr[L++] = tmp & 255;
|
|
316
|
+
} else if (placeHolders === 1) {
|
|
317
|
+
tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
|
|
318
|
+
arr[L++] = tmp >> 8 & 255;
|
|
319
|
+
arr[L++] = tmp & 255;
|
|
320
|
+
}
|
|
321
|
+
return arr;
|
|
322
|
+
}
|
|
323
|
+
function tripletToBase64(num) {
|
|
324
|
+
return lookup$1[num >> 18 & 63] + lookup$1[num >> 12 & 63] + lookup$1[num >> 6 & 63] + lookup$1[num & 63];
|
|
325
|
+
}
|
|
326
|
+
function encodeChunk(uint8, start, end) {
|
|
327
|
+
var tmp;
|
|
328
|
+
var output = [];
|
|
329
|
+
for (var i = start; i < end; i += 3) {
|
|
330
|
+
tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2];
|
|
331
|
+
output.push(tripletToBase64(tmp));
|
|
332
|
+
}
|
|
333
|
+
return output.join("");
|
|
334
|
+
}
|
|
335
|
+
function fromByteArray(uint8) {
|
|
336
|
+
if (!inited) {
|
|
337
|
+
init$2();
|
|
338
|
+
}
|
|
339
|
+
var tmp;
|
|
340
|
+
var len = uint8.length;
|
|
341
|
+
var extraBytes = len % 3;
|
|
342
|
+
var output = "";
|
|
343
|
+
var parts = [];
|
|
344
|
+
var maxChunkLength = 16383;
|
|
345
|
+
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
|
346
|
+
parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
|
|
347
|
+
}
|
|
348
|
+
if (extraBytes === 1) {
|
|
349
|
+
tmp = uint8[len - 1];
|
|
350
|
+
output += lookup$1[tmp >> 2];
|
|
351
|
+
output += lookup$1[tmp << 4 & 63];
|
|
352
|
+
output += "==";
|
|
353
|
+
} else if (extraBytes === 2) {
|
|
354
|
+
tmp = (uint8[len - 2] << 8) + uint8[len - 1];
|
|
355
|
+
output += lookup$1[tmp >> 10];
|
|
356
|
+
output += lookup$1[tmp >> 4 & 63];
|
|
357
|
+
output += lookup$1[tmp << 2 & 63];
|
|
358
|
+
output += "=";
|
|
359
|
+
}
|
|
360
|
+
parts.push(output);
|
|
361
|
+
return parts.join("");
|
|
362
|
+
}
|
|
363
|
+
function read(buffer, offset, isLE, mLen, nBytes) {
|
|
364
|
+
var e, m;
|
|
365
|
+
var eLen = nBytes * 8 - mLen - 1;
|
|
366
|
+
var eMax = (1 << eLen) - 1;
|
|
367
|
+
var eBias = eMax >> 1;
|
|
368
|
+
var nBits = -7;
|
|
369
|
+
var i = isLE ? nBytes - 1 : 0;
|
|
370
|
+
var d = isLE ? -1 : 1;
|
|
371
|
+
var s = buffer[offset + i];
|
|
372
|
+
i += d;
|
|
373
|
+
e = s & (1 << -nBits) - 1;
|
|
374
|
+
s >>= -nBits;
|
|
375
|
+
nBits += eLen;
|
|
376
|
+
for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {
|
|
377
|
+
}
|
|
378
|
+
m = e & (1 << -nBits) - 1;
|
|
379
|
+
e >>= -nBits;
|
|
380
|
+
nBits += mLen;
|
|
381
|
+
for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {
|
|
382
|
+
}
|
|
383
|
+
if (e === 0) {
|
|
384
|
+
e = 1 - eBias;
|
|
385
|
+
} else if (e === eMax) {
|
|
386
|
+
return m ? NaN : (s ? -1 : 1) * Infinity;
|
|
387
|
+
} else {
|
|
388
|
+
m = m + Math.pow(2, mLen);
|
|
389
|
+
e = e - eBias;
|
|
390
|
+
}
|
|
391
|
+
return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
|
|
392
|
+
}
|
|
393
|
+
function write(buffer, value, offset, isLE, mLen, nBytes) {
|
|
394
|
+
var e, m, c;
|
|
395
|
+
var eLen = nBytes * 8 - mLen - 1;
|
|
396
|
+
var eMax = (1 << eLen) - 1;
|
|
397
|
+
var eBias = eMax >> 1;
|
|
398
|
+
var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
|
|
399
|
+
var i = isLE ? 0 : nBytes - 1;
|
|
400
|
+
var d = isLE ? 1 : -1;
|
|
401
|
+
var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
|
|
402
|
+
value = Math.abs(value);
|
|
403
|
+
if (isNaN(value) || value === Infinity) {
|
|
404
|
+
m = isNaN(value) ? 1 : 0;
|
|
405
|
+
e = eMax;
|
|
406
|
+
} else {
|
|
407
|
+
e = Math.floor(Math.log(value) / Math.LN2);
|
|
408
|
+
if (value * (c = Math.pow(2, -e)) < 1) {
|
|
409
|
+
e--;
|
|
410
|
+
c *= 2;
|
|
411
|
+
}
|
|
412
|
+
if (e + eBias >= 1) {
|
|
413
|
+
value += rt / c;
|
|
414
|
+
} else {
|
|
415
|
+
value += rt * Math.pow(2, 1 - eBias);
|
|
416
|
+
}
|
|
417
|
+
if (value * c >= 2) {
|
|
418
|
+
e++;
|
|
419
|
+
c /= 2;
|
|
420
|
+
}
|
|
421
|
+
if (e + eBias >= eMax) {
|
|
422
|
+
m = 0;
|
|
423
|
+
e = eMax;
|
|
424
|
+
} else if (e + eBias >= 1) {
|
|
425
|
+
m = (value * c - 1) * Math.pow(2, mLen);
|
|
426
|
+
e = e + eBias;
|
|
427
|
+
} else {
|
|
428
|
+
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
|
|
429
|
+
e = 0;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {
|
|
433
|
+
}
|
|
434
|
+
e = e << mLen | m;
|
|
435
|
+
eLen += mLen;
|
|
436
|
+
for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {
|
|
437
|
+
}
|
|
438
|
+
buffer[offset + i - d] |= s * 128;
|
|
439
|
+
}
|
|
440
|
+
var toString = {}.toString;
|
|
441
|
+
var isArray$1 = Array.isArray || function(arr) {
|
|
442
|
+
return toString.call(arr) == "[object Array]";
|
|
443
|
+
};
|
|
444
|
+
/*!
|
|
445
|
+
* The buffer module from node.js, for the browser.
|
|
446
|
+
*
|
|
447
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
448
|
+
* @license MIT
|
|
449
|
+
*/
|
|
450
|
+
var INSPECT_MAX_BYTES = 50;
|
|
451
|
+
Buffer$2.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== void 0 ? global$1.TYPED_ARRAY_SUPPORT : true;
|
|
452
|
+
kMaxLength();
|
|
453
|
+
function kMaxLength() {
|
|
454
|
+
return Buffer$2.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
|
|
455
|
+
}
|
|
456
|
+
function createBuffer(that, length2) {
|
|
457
|
+
if (kMaxLength() < length2) {
|
|
458
|
+
throw new RangeError("Invalid typed array length");
|
|
459
|
+
}
|
|
460
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
461
|
+
that = new Uint8Array(length2);
|
|
462
|
+
that.__proto__ = Buffer$2.prototype;
|
|
463
|
+
} else {
|
|
464
|
+
if (that === null) {
|
|
465
|
+
that = new Buffer$2(length2);
|
|
466
|
+
}
|
|
467
|
+
that.length = length2;
|
|
468
|
+
}
|
|
469
|
+
return that;
|
|
470
|
+
}
|
|
471
|
+
function Buffer$2(arg, encodingOrOffset, length2) {
|
|
472
|
+
if (!Buffer$2.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer$2)) {
|
|
473
|
+
return new Buffer$2(arg, encodingOrOffset, length2);
|
|
474
|
+
}
|
|
475
|
+
if (typeof arg === "number") {
|
|
476
|
+
if (typeof encodingOrOffset === "string") {
|
|
477
|
+
throw new Error(
|
|
478
|
+
"If encoding is specified then the first argument must be a string"
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
return allocUnsafe(this, arg);
|
|
482
|
+
}
|
|
483
|
+
return from(this, arg, encodingOrOffset, length2);
|
|
484
|
+
}
|
|
485
|
+
Buffer$2.poolSize = 8192;
|
|
486
|
+
Buffer$2._augment = function(arr) {
|
|
487
|
+
arr.__proto__ = Buffer$2.prototype;
|
|
488
|
+
return arr;
|
|
489
|
+
};
|
|
490
|
+
function from(that, value, encodingOrOffset, length2) {
|
|
491
|
+
if (typeof value === "number") {
|
|
492
|
+
throw new TypeError('"value" argument must not be a number');
|
|
493
|
+
}
|
|
494
|
+
if (typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer) {
|
|
495
|
+
return fromArrayBuffer(that, value, encodingOrOffset, length2);
|
|
496
|
+
}
|
|
497
|
+
if (typeof value === "string") {
|
|
498
|
+
return fromString(that, value, encodingOrOffset);
|
|
499
|
+
}
|
|
500
|
+
return fromObject(that, value);
|
|
501
|
+
}
|
|
502
|
+
Buffer$2.from = function(value, encodingOrOffset, length2) {
|
|
503
|
+
return from(null, value, encodingOrOffset, length2);
|
|
504
|
+
};
|
|
505
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
506
|
+
Buffer$2.prototype.__proto__ = Uint8Array.prototype;
|
|
507
|
+
Buffer$2.__proto__ = Uint8Array;
|
|
508
|
+
if (typeof Symbol !== "undefined" && Symbol.species && Buffer$2[Symbol.species] === Buffer$2)
|
|
509
|
+
;
|
|
510
|
+
}
|
|
511
|
+
function assertSize(size2) {
|
|
512
|
+
if (typeof size2 !== "number") {
|
|
513
|
+
throw new TypeError('"size" argument must be a number');
|
|
514
|
+
} else if (size2 < 0) {
|
|
515
|
+
throw new RangeError('"size" argument must not be negative');
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
function alloc(that, size2, fill2, encoding) {
|
|
519
|
+
assertSize(size2);
|
|
520
|
+
if (size2 <= 0) {
|
|
521
|
+
return createBuffer(that, size2);
|
|
522
|
+
}
|
|
523
|
+
if (fill2 !== void 0) {
|
|
524
|
+
return typeof encoding === "string" ? createBuffer(that, size2).fill(fill2, encoding) : createBuffer(that, size2).fill(fill2);
|
|
525
|
+
}
|
|
526
|
+
return createBuffer(that, size2);
|
|
527
|
+
}
|
|
528
|
+
Buffer$2.alloc = function(size2, fill2, encoding) {
|
|
529
|
+
return alloc(null, size2, fill2, encoding);
|
|
530
|
+
};
|
|
531
|
+
function allocUnsafe(that, size2) {
|
|
532
|
+
assertSize(size2);
|
|
533
|
+
that = createBuffer(that, size2 < 0 ? 0 : checked(size2) | 0);
|
|
534
|
+
if (!Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
535
|
+
for (var i = 0; i < size2; ++i) {
|
|
536
|
+
that[i] = 0;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
return that;
|
|
540
|
+
}
|
|
541
|
+
Buffer$2.allocUnsafe = function(size2) {
|
|
542
|
+
return allocUnsafe(null, size2);
|
|
543
|
+
};
|
|
544
|
+
Buffer$2.allocUnsafeSlow = function(size2) {
|
|
545
|
+
return allocUnsafe(null, size2);
|
|
546
|
+
};
|
|
547
|
+
function fromString(that, string, encoding) {
|
|
548
|
+
if (typeof encoding !== "string" || encoding === "") {
|
|
549
|
+
encoding = "utf8";
|
|
550
|
+
}
|
|
551
|
+
if (!Buffer$2.isEncoding(encoding)) {
|
|
552
|
+
throw new TypeError('"encoding" must be a valid string encoding');
|
|
553
|
+
}
|
|
554
|
+
var length2 = byteLength(string, encoding) | 0;
|
|
555
|
+
that = createBuffer(that, length2);
|
|
556
|
+
var actual = that.write(string, encoding);
|
|
557
|
+
if (actual !== length2) {
|
|
558
|
+
that = that.slice(0, actual);
|
|
559
|
+
}
|
|
560
|
+
return that;
|
|
561
|
+
}
|
|
562
|
+
function fromArrayLike(that, array2) {
|
|
563
|
+
var length2 = array2.length < 0 ? 0 : checked(array2.length) | 0;
|
|
564
|
+
that = createBuffer(that, length2);
|
|
565
|
+
for (var i = 0; i < length2; i += 1) {
|
|
566
|
+
that[i] = array2[i] & 255;
|
|
567
|
+
}
|
|
568
|
+
return that;
|
|
569
|
+
}
|
|
570
|
+
function fromArrayBuffer(that, array2, byteOffset, length2) {
|
|
571
|
+
array2.byteLength;
|
|
572
|
+
if (byteOffset < 0 || array2.byteLength < byteOffset) {
|
|
573
|
+
throw new RangeError("'offset' is out of bounds");
|
|
574
|
+
}
|
|
575
|
+
if (array2.byteLength < byteOffset + (length2 || 0)) {
|
|
576
|
+
throw new RangeError("'length' is out of bounds");
|
|
577
|
+
}
|
|
578
|
+
if (byteOffset === void 0 && length2 === void 0) {
|
|
579
|
+
array2 = new Uint8Array(array2);
|
|
580
|
+
} else if (length2 === void 0) {
|
|
581
|
+
array2 = new Uint8Array(array2, byteOffset);
|
|
582
|
+
} else {
|
|
583
|
+
array2 = new Uint8Array(array2, byteOffset, length2);
|
|
584
|
+
}
|
|
585
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
586
|
+
that = array2;
|
|
587
|
+
that.__proto__ = Buffer$2.prototype;
|
|
588
|
+
} else {
|
|
589
|
+
that = fromArrayLike(that, array2);
|
|
590
|
+
}
|
|
591
|
+
return that;
|
|
592
|
+
}
|
|
593
|
+
function fromObject(that, obj) {
|
|
594
|
+
if (internalIsBuffer(obj)) {
|
|
595
|
+
var len = checked(obj.length) | 0;
|
|
596
|
+
that = createBuffer(that, len);
|
|
597
|
+
if (that.length === 0) {
|
|
598
|
+
return that;
|
|
599
|
+
}
|
|
600
|
+
obj.copy(that, 0, 0, len);
|
|
601
|
+
return that;
|
|
602
|
+
}
|
|
603
|
+
if (obj) {
|
|
604
|
+
if (typeof ArrayBuffer !== "undefined" && obj.buffer instanceof ArrayBuffer || "length" in obj) {
|
|
605
|
+
if (typeof obj.length !== "number" || isnan(obj.length)) {
|
|
606
|
+
return createBuffer(that, 0);
|
|
607
|
+
}
|
|
608
|
+
return fromArrayLike(that, obj);
|
|
609
|
+
}
|
|
610
|
+
if (obj.type === "Buffer" && isArray$1(obj.data)) {
|
|
611
|
+
return fromArrayLike(that, obj.data);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
|
|
615
|
+
}
|
|
616
|
+
function checked(length2) {
|
|
617
|
+
if (length2 >= kMaxLength()) {
|
|
618
|
+
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + kMaxLength().toString(16) + " bytes");
|
|
619
|
+
}
|
|
620
|
+
return length2 | 0;
|
|
621
|
+
}
|
|
622
|
+
Buffer$2.isBuffer = isBuffer;
|
|
623
|
+
function internalIsBuffer(b) {
|
|
624
|
+
return !!(b != null && b._isBuffer);
|
|
625
|
+
}
|
|
626
|
+
Buffer$2.compare = function compare(a, b) {
|
|
627
|
+
if (!internalIsBuffer(a) || !internalIsBuffer(b)) {
|
|
628
|
+
throw new TypeError("Arguments must be Buffers");
|
|
629
|
+
}
|
|
630
|
+
if (a === b)
|
|
631
|
+
return 0;
|
|
632
|
+
var x = a.length;
|
|
633
|
+
var y = b.length;
|
|
634
|
+
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
|
|
635
|
+
if (a[i] !== b[i]) {
|
|
636
|
+
x = a[i];
|
|
637
|
+
y = b[i];
|
|
638
|
+
break;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (x < y)
|
|
642
|
+
return -1;
|
|
643
|
+
if (y < x)
|
|
644
|
+
return 1;
|
|
645
|
+
return 0;
|
|
646
|
+
};
|
|
647
|
+
Buffer$2.isEncoding = function isEncoding(encoding) {
|
|
648
|
+
switch (String(encoding).toLowerCase()) {
|
|
649
|
+
case "hex":
|
|
650
|
+
case "utf8":
|
|
651
|
+
case "utf-8":
|
|
652
|
+
case "ascii":
|
|
653
|
+
case "latin1":
|
|
654
|
+
case "binary":
|
|
655
|
+
case "base64":
|
|
656
|
+
case "ucs2":
|
|
657
|
+
case "ucs-2":
|
|
658
|
+
case "utf16le":
|
|
659
|
+
case "utf-16le":
|
|
660
|
+
return true;
|
|
661
|
+
default:
|
|
662
|
+
return false;
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
Buffer$2.concat = function concat(list, length2) {
|
|
666
|
+
if (!isArray$1(list)) {
|
|
667
|
+
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
668
|
+
}
|
|
669
|
+
if (list.length === 0) {
|
|
670
|
+
return Buffer$2.alloc(0);
|
|
671
|
+
}
|
|
672
|
+
var i;
|
|
673
|
+
if (length2 === void 0) {
|
|
674
|
+
length2 = 0;
|
|
675
|
+
for (i = 0; i < list.length; ++i) {
|
|
676
|
+
length2 += list[i].length;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
var buffer = Buffer$2.allocUnsafe(length2);
|
|
680
|
+
var pos = 0;
|
|
681
|
+
for (i = 0; i < list.length; ++i) {
|
|
682
|
+
var buf = list[i];
|
|
683
|
+
if (!internalIsBuffer(buf)) {
|
|
684
|
+
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
685
|
+
}
|
|
686
|
+
buf.copy(buffer, pos);
|
|
687
|
+
pos += buf.length;
|
|
688
|
+
}
|
|
689
|
+
return buffer;
|
|
690
|
+
};
|
|
691
|
+
function byteLength(string, encoding) {
|
|
692
|
+
if (internalIsBuffer(string)) {
|
|
693
|
+
return string.length;
|
|
694
|
+
}
|
|
695
|
+
if (typeof ArrayBuffer !== "undefined" && typeof ArrayBuffer.isView === "function" && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
|
|
696
|
+
return string.byteLength;
|
|
697
|
+
}
|
|
698
|
+
if (typeof string !== "string") {
|
|
699
|
+
string = "" + string;
|
|
700
|
+
}
|
|
701
|
+
var len = string.length;
|
|
702
|
+
if (len === 0)
|
|
703
|
+
return 0;
|
|
704
|
+
var loweredCase = false;
|
|
705
|
+
for (; ; ) {
|
|
706
|
+
switch (encoding) {
|
|
707
|
+
case "ascii":
|
|
708
|
+
case "latin1":
|
|
709
|
+
case "binary":
|
|
710
|
+
return len;
|
|
711
|
+
case "utf8":
|
|
712
|
+
case "utf-8":
|
|
713
|
+
case void 0:
|
|
714
|
+
return utf8ToBytes(string).length;
|
|
715
|
+
case "ucs2":
|
|
716
|
+
case "ucs-2":
|
|
717
|
+
case "utf16le":
|
|
718
|
+
case "utf-16le":
|
|
719
|
+
return len * 2;
|
|
720
|
+
case "hex":
|
|
721
|
+
return len >>> 1;
|
|
722
|
+
case "base64":
|
|
723
|
+
return base64ToBytes(string).length;
|
|
724
|
+
default:
|
|
725
|
+
if (loweredCase)
|
|
726
|
+
return utf8ToBytes(string).length;
|
|
727
|
+
encoding = ("" + encoding).toLowerCase();
|
|
728
|
+
loweredCase = true;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
Buffer$2.byteLength = byteLength;
|
|
733
|
+
function slowToString(encoding, start, end) {
|
|
734
|
+
var loweredCase = false;
|
|
735
|
+
if (start === void 0 || start < 0) {
|
|
736
|
+
start = 0;
|
|
737
|
+
}
|
|
738
|
+
if (start > this.length) {
|
|
739
|
+
return "";
|
|
740
|
+
}
|
|
741
|
+
if (end === void 0 || end > this.length) {
|
|
742
|
+
end = this.length;
|
|
743
|
+
}
|
|
744
|
+
if (end <= 0) {
|
|
745
|
+
return "";
|
|
746
|
+
}
|
|
747
|
+
end >>>= 0;
|
|
748
|
+
start >>>= 0;
|
|
749
|
+
if (end <= start) {
|
|
750
|
+
return "";
|
|
751
|
+
}
|
|
752
|
+
if (!encoding)
|
|
753
|
+
encoding = "utf8";
|
|
754
|
+
while (true) {
|
|
755
|
+
switch (encoding) {
|
|
756
|
+
case "hex":
|
|
757
|
+
return hexSlice(this, start, end);
|
|
758
|
+
case "utf8":
|
|
759
|
+
case "utf-8":
|
|
760
|
+
return utf8Slice(this, start, end);
|
|
761
|
+
case "ascii":
|
|
762
|
+
return asciiSlice(this, start, end);
|
|
763
|
+
case "latin1":
|
|
764
|
+
case "binary":
|
|
765
|
+
return latin1Slice(this, start, end);
|
|
766
|
+
case "base64":
|
|
767
|
+
return base64Slice(this, start, end);
|
|
768
|
+
case "ucs2":
|
|
769
|
+
case "ucs-2":
|
|
770
|
+
case "utf16le":
|
|
771
|
+
case "utf-16le":
|
|
772
|
+
return utf16leSlice(this, start, end);
|
|
773
|
+
default:
|
|
774
|
+
if (loweredCase)
|
|
775
|
+
throw new TypeError("Unknown encoding: " + encoding);
|
|
776
|
+
encoding = (encoding + "").toLowerCase();
|
|
777
|
+
loweredCase = true;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
Buffer$2.prototype._isBuffer = true;
|
|
782
|
+
function swap(b, n, m) {
|
|
783
|
+
var i = b[n];
|
|
784
|
+
b[n] = b[m];
|
|
785
|
+
b[m] = i;
|
|
786
|
+
}
|
|
787
|
+
Buffer$2.prototype.swap16 = function swap16() {
|
|
788
|
+
var len = this.length;
|
|
789
|
+
if (len % 2 !== 0) {
|
|
790
|
+
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
791
|
+
}
|
|
792
|
+
for (var i = 0; i < len; i += 2) {
|
|
793
|
+
swap(this, i, i + 1);
|
|
794
|
+
}
|
|
795
|
+
return this;
|
|
796
|
+
};
|
|
797
|
+
Buffer$2.prototype.swap32 = function swap32() {
|
|
798
|
+
var len = this.length;
|
|
799
|
+
if (len % 4 !== 0) {
|
|
800
|
+
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
801
|
+
}
|
|
802
|
+
for (var i = 0; i < len; i += 4) {
|
|
803
|
+
swap(this, i, i + 3);
|
|
804
|
+
swap(this, i + 1, i + 2);
|
|
805
|
+
}
|
|
806
|
+
return this;
|
|
807
|
+
};
|
|
808
|
+
Buffer$2.prototype.swap64 = function swap64() {
|
|
809
|
+
var len = this.length;
|
|
810
|
+
if (len % 8 !== 0) {
|
|
811
|
+
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
812
|
+
}
|
|
813
|
+
for (var i = 0; i < len; i += 8) {
|
|
814
|
+
swap(this, i, i + 7);
|
|
815
|
+
swap(this, i + 1, i + 6);
|
|
816
|
+
swap(this, i + 2, i + 5);
|
|
817
|
+
swap(this, i + 3, i + 4);
|
|
818
|
+
}
|
|
819
|
+
return this;
|
|
820
|
+
};
|
|
821
|
+
Buffer$2.prototype.toString = function toString2() {
|
|
822
|
+
var length2 = this.length | 0;
|
|
823
|
+
if (length2 === 0)
|
|
824
|
+
return "";
|
|
825
|
+
if (arguments.length === 0)
|
|
826
|
+
return utf8Slice(this, 0, length2);
|
|
827
|
+
return slowToString.apply(this, arguments);
|
|
828
|
+
};
|
|
829
|
+
Buffer$2.prototype.equals = function equals(b) {
|
|
830
|
+
if (!internalIsBuffer(b))
|
|
831
|
+
throw new TypeError("Argument must be a Buffer");
|
|
832
|
+
if (this === b)
|
|
833
|
+
return true;
|
|
834
|
+
return Buffer$2.compare(this, b) === 0;
|
|
835
|
+
};
|
|
836
|
+
Buffer$2.prototype.inspect = function inspect() {
|
|
837
|
+
var str = "";
|
|
838
|
+
var max = INSPECT_MAX_BYTES;
|
|
839
|
+
if (this.length > 0) {
|
|
840
|
+
str = this.toString("hex", 0, max).match(/.{2}/g).join(" ");
|
|
841
|
+
if (this.length > max)
|
|
842
|
+
str += " ... ";
|
|
843
|
+
}
|
|
844
|
+
return "<Buffer " + str + ">";
|
|
845
|
+
};
|
|
846
|
+
Buffer$2.prototype.compare = function compare2(target, start, end, thisStart, thisEnd) {
|
|
847
|
+
if (!internalIsBuffer(target)) {
|
|
848
|
+
throw new TypeError("Argument must be a Buffer");
|
|
849
|
+
}
|
|
850
|
+
if (start === void 0) {
|
|
851
|
+
start = 0;
|
|
852
|
+
}
|
|
853
|
+
if (end === void 0) {
|
|
854
|
+
end = target ? target.length : 0;
|
|
855
|
+
}
|
|
856
|
+
if (thisStart === void 0) {
|
|
857
|
+
thisStart = 0;
|
|
858
|
+
}
|
|
859
|
+
if (thisEnd === void 0) {
|
|
860
|
+
thisEnd = this.length;
|
|
861
|
+
}
|
|
862
|
+
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
|
|
863
|
+
throw new RangeError("out of range index");
|
|
864
|
+
}
|
|
865
|
+
if (thisStart >= thisEnd && start >= end) {
|
|
866
|
+
return 0;
|
|
867
|
+
}
|
|
868
|
+
if (thisStart >= thisEnd) {
|
|
869
|
+
return -1;
|
|
870
|
+
}
|
|
871
|
+
if (start >= end) {
|
|
872
|
+
return 1;
|
|
873
|
+
}
|
|
874
|
+
start >>>= 0;
|
|
875
|
+
end >>>= 0;
|
|
876
|
+
thisStart >>>= 0;
|
|
877
|
+
thisEnd >>>= 0;
|
|
878
|
+
if (this === target)
|
|
879
|
+
return 0;
|
|
880
|
+
var x = thisEnd - thisStart;
|
|
881
|
+
var y = end - start;
|
|
882
|
+
var len = Math.min(x, y);
|
|
883
|
+
var thisCopy = this.slice(thisStart, thisEnd);
|
|
884
|
+
var targetCopy = target.slice(start, end);
|
|
885
|
+
for (var i = 0; i < len; ++i) {
|
|
886
|
+
if (thisCopy[i] !== targetCopy[i]) {
|
|
887
|
+
x = thisCopy[i];
|
|
888
|
+
y = targetCopy[i];
|
|
889
|
+
break;
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
if (x < y)
|
|
893
|
+
return -1;
|
|
894
|
+
if (y < x)
|
|
895
|
+
return 1;
|
|
896
|
+
return 0;
|
|
897
|
+
};
|
|
898
|
+
function bidirectionalIndexOf(buffer, val2, byteOffset, encoding, dir) {
|
|
899
|
+
if (buffer.length === 0)
|
|
900
|
+
return -1;
|
|
901
|
+
if (typeof byteOffset === "string") {
|
|
902
|
+
encoding = byteOffset;
|
|
903
|
+
byteOffset = 0;
|
|
904
|
+
} else if (byteOffset > 2147483647) {
|
|
905
|
+
byteOffset = 2147483647;
|
|
906
|
+
} else if (byteOffset < -2147483648) {
|
|
907
|
+
byteOffset = -2147483648;
|
|
908
|
+
}
|
|
909
|
+
byteOffset = +byteOffset;
|
|
910
|
+
if (isNaN(byteOffset)) {
|
|
911
|
+
byteOffset = dir ? 0 : buffer.length - 1;
|
|
912
|
+
}
|
|
913
|
+
if (byteOffset < 0)
|
|
914
|
+
byteOffset = buffer.length + byteOffset;
|
|
915
|
+
if (byteOffset >= buffer.length) {
|
|
916
|
+
if (dir)
|
|
917
|
+
return -1;
|
|
918
|
+
else
|
|
919
|
+
byteOffset = buffer.length - 1;
|
|
920
|
+
} else if (byteOffset < 0) {
|
|
921
|
+
if (dir)
|
|
922
|
+
byteOffset = 0;
|
|
923
|
+
else
|
|
924
|
+
return -1;
|
|
925
|
+
}
|
|
926
|
+
if (typeof val2 === "string") {
|
|
927
|
+
val2 = Buffer$2.from(val2, encoding);
|
|
928
|
+
}
|
|
929
|
+
if (internalIsBuffer(val2)) {
|
|
930
|
+
if (val2.length === 0) {
|
|
931
|
+
return -1;
|
|
932
|
+
}
|
|
933
|
+
return arrayIndexOf(buffer, val2, byteOffset, encoding, dir);
|
|
934
|
+
} else if (typeof val2 === "number") {
|
|
935
|
+
val2 = val2 & 255;
|
|
936
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === "function") {
|
|
937
|
+
if (dir) {
|
|
938
|
+
return Uint8Array.prototype.indexOf.call(buffer, val2, byteOffset);
|
|
939
|
+
} else {
|
|
940
|
+
return Uint8Array.prototype.lastIndexOf.call(buffer, val2, byteOffset);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
return arrayIndexOf(buffer, [val2], byteOffset, encoding, dir);
|
|
944
|
+
}
|
|
945
|
+
throw new TypeError("val must be string, number or Buffer");
|
|
946
|
+
}
|
|
947
|
+
function arrayIndexOf(arr, val2, byteOffset, encoding, dir) {
|
|
948
|
+
var indexSize = 1;
|
|
949
|
+
var arrLength = arr.length;
|
|
950
|
+
var valLength = val2.length;
|
|
951
|
+
if (encoding !== void 0) {
|
|
952
|
+
encoding = String(encoding).toLowerCase();
|
|
953
|
+
if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {
|
|
954
|
+
if (arr.length < 2 || val2.length < 2) {
|
|
955
|
+
return -1;
|
|
956
|
+
}
|
|
957
|
+
indexSize = 2;
|
|
958
|
+
arrLength /= 2;
|
|
959
|
+
valLength /= 2;
|
|
960
|
+
byteOffset /= 2;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
function read2(buf, i2) {
|
|
964
|
+
if (indexSize === 1) {
|
|
965
|
+
return buf[i2];
|
|
966
|
+
} else {
|
|
967
|
+
return buf.readUInt16BE(i2 * indexSize);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
var i;
|
|
971
|
+
if (dir) {
|
|
972
|
+
var foundIndex = -1;
|
|
973
|
+
for (i = byteOffset; i < arrLength; i++) {
|
|
974
|
+
if (read2(arr, i) === read2(val2, foundIndex === -1 ? 0 : i - foundIndex)) {
|
|
975
|
+
if (foundIndex === -1)
|
|
976
|
+
foundIndex = i;
|
|
977
|
+
if (i - foundIndex + 1 === valLength)
|
|
978
|
+
return foundIndex * indexSize;
|
|
979
|
+
} else {
|
|
980
|
+
if (foundIndex !== -1)
|
|
981
|
+
i -= i - foundIndex;
|
|
982
|
+
foundIndex = -1;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
} else {
|
|
986
|
+
if (byteOffset + valLength > arrLength)
|
|
987
|
+
byteOffset = arrLength - valLength;
|
|
988
|
+
for (i = byteOffset; i >= 0; i--) {
|
|
989
|
+
var found = true;
|
|
990
|
+
for (var j = 0; j < valLength; j++) {
|
|
991
|
+
if (read2(arr, i + j) !== read2(val2, j)) {
|
|
992
|
+
found = false;
|
|
993
|
+
break;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
if (found)
|
|
997
|
+
return i;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
return -1;
|
|
1001
|
+
}
|
|
1002
|
+
Buffer$2.prototype.includes = function includes(val2, byteOffset, encoding) {
|
|
1003
|
+
return this.indexOf(val2, byteOffset, encoding) !== -1;
|
|
1004
|
+
};
|
|
1005
|
+
Buffer$2.prototype.indexOf = function indexOf(val2, byteOffset, encoding) {
|
|
1006
|
+
return bidirectionalIndexOf(this, val2, byteOffset, encoding, true);
|
|
1007
|
+
};
|
|
1008
|
+
Buffer$2.prototype.lastIndexOf = function lastIndexOf(val2, byteOffset, encoding) {
|
|
1009
|
+
return bidirectionalIndexOf(this, val2, byteOffset, encoding, false);
|
|
1010
|
+
};
|
|
1011
|
+
function hexWrite(buf, string, offset, length2) {
|
|
1012
|
+
offset = Number(offset) || 0;
|
|
1013
|
+
var remaining = buf.length - offset;
|
|
1014
|
+
if (!length2) {
|
|
1015
|
+
length2 = remaining;
|
|
1016
|
+
} else {
|
|
1017
|
+
length2 = Number(length2);
|
|
1018
|
+
if (length2 > remaining) {
|
|
1019
|
+
length2 = remaining;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
var strLen = string.length;
|
|
1023
|
+
if (strLen % 2 !== 0)
|
|
1024
|
+
throw new TypeError("Invalid hex string");
|
|
1025
|
+
if (length2 > strLen / 2) {
|
|
1026
|
+
length2 = strLen / 2;
|
|
1027
|
+
}
|
|
1028
|
+
for (var i = 0; i < length2; ++i) {
|
|
1029
|
+
var parsed = parseInt(string.substr(i * 2, 2), 16);
|
|
1030
|
+
if (isNaN(parsed))
|
|
1031
|
+
return i;
|
|
1032
|
+
buf[offset + i] = parsed;
|
|
1033
|
+
}
|
|
1034
|
+
return i;
|
|
1035
|
+
}
|
|
1036
|
+
function utf8Write(buf, string, offset, length2) {
|
|
1037
|
+
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length2);
|
|
1038
|
+
}
|
|
1039
|
+
function asciiWrite(buf, string, offset, length2) {
|
|
1040
|
+
return blitBuffer(asciiToBytes(string), buf, offset, length2);
|
|
1041
|
+
}
|
|
1042
|
+
function latin1Write(buf, string, offset, length2) {
|
|
1043
|
+
return asciiWrite(buf, string, offset, length2);
|
|
1044
|
+
}
|
|
1045
|
+
function base64Write(buf, string, offset, length2) {
|
|
1046
|
+
return blitBuffer(base64ToBytes(string), buf, offset, length2);
|
|
1047
|
+
}
|
|
1048
|
+
function ucs2Write(buf, string, offset, length2) {
|
|
1049
|
+
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length2);
|
|
1050
|
+
}
|
|
1051
|
+
Buffer$2.prototype.write = function write2(string, offset, length2, encoding) {
|
|
1052
|
+
if (offset === void 0) {
|
|
1053
|
+
encoding = "utf8";
|
|
1054
|
+
length2 = this.length;
|
|
1055
|
+
offset = 0;
|
|
1056
|
+
} else if (length2 === void 0 && typeof offset === "string") {
|
|
1057
|
+
encoding = offset;
|
|
1058
|
+
length2 = this.length;
|
|
1059
|
+
offset = 0;
|
|
1060
|
+
} else if (isFinite(offset)) {
|
|
1061
|
+
offset = offset | 0;
|
|
1062
|
+
if (isFinite(length2)) {
|
|
1063
|
+
length2 = length2 | 0;
|
|
1064
|
+
if (encoding === void 0)
|
|
1065
|
+
encoding = "utf8";
|
|
1066
|
+
} else {
|
|
1067
|
+
encoding = length2;
|
|
1068
|
+
length2 = void 0;
|
|
1069
|
+
}
|
|
1070
|
+
} else {
|
|
1071
|
+
throw new Error(
|
|
1072
|
+
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
1073
|
+
);
|
|
1074
|
+
}
|
|
1075
|
+
var remaining = this.length - offset;
|
|
1076
|
+
if (length2 === void 0 || length2 > remaining)
|
|
1077
|
+
length2 = remaining;
|
|
1078
|
+
if (string.length > 0 && (length2 < 0 || offset < 0) || offset > this.length) {
|
|
1079
|
+
throw new RangeError("Attempt to write outside buffer bounds");
|
|
1080
|
+
}
|
|
1081
|
+
if (!encoding)
|
|
1082
|
+
encoding = "utf8";
|
|
1083
|
+
var loweredCase = false;
|
|
1084
|
+
for (; ; ) {
|
|
1085
|
+
switch (encoding) {
|
|
1086
|
+
case "hex":
|
|
1087
|
+
return hexWrite(this, string, offset, length2);
|
|
1088
|
+
case "utf8":
|
|
1089
|
+
case "utf-8":
|
|
1090
|
+
return utf8Write(this, string, offset, length2);
|
|
1091
|
+
case "ascii":
|
|
1092
|
+
return asciiWrite(this, string, offset, length2);
|
|
1093
|
+
case "latin1":
|
|
1094
|
+
case "binary":
|
|
1095
|
+
return latin1Write(this, string, offset, length2);
|
|
1096
|
+
case "base64":
|
|
1097
|
+
return base64Write(this, string, offset, length2);
|
|
1098
|
+
case "ucs2":
|
|
1099
|
+
case "ucs-2":
|
|
1100
|
+
case "utf16le":
|
|
1101
|
+
case "utf-16le":
|
|
1102
|
+
return ucs2Write(this, string, offset, length2);
|
|
1103
|
+
default:
|
|
1104
|
+
if (loweredCase)
|
|
1105
|
+
throw new TypeError("Unknown encoding: " + encoding);
|
|
1106
|
+
encoding = ("" + encoding).toLowerCase();
|
|
1107
|
+
loweredCase = true;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
};
|
|
1111
|
+
Buffer$2.prototype.toJSON = function toJSON() {
|
|
1112
|
+
return {
|
|
1113
|
+
type: "Buffer",
|
|
1114
|
+
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1117
|
+
function base64Slice(buf, start, end) {
|
|
1118
|
+
if (start === 0 && end === buf.length) {
|
|
1119
|
+
return fromByteArray(buf);
|
|
1120
|
+
} else {
|
|
1121
|
+
return fromByteArray(buf.slice(start, end));
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
function utf8Slice(buf, start, end) {
|
|
1125
|
+
end = Math.min(buf.length, end);
|
|
1126
|
+
var res = [];
|
|
1127
|
+
var i = start;
|
|
1128
|
+
while (i < end) {
|
|
1129
|
+
var firstByte = buf[i];
|
|
1130
|
+
var codePoint = null;
|
|
1131
|
+
var bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
|
|
1132
|
+
if (i + bytesPerSequence <= end) {
|
|
1133
|
+
var secondByte, thirdByte, fourthByte, tempCodePoint;
|
|
1134
|
+
switch (bytesPerSequence) {
|
|
1135
|
+
case 1:
|
|
1136
|
+
if (firstByte < 128) {
|
|
1137
|
+
codePoint = firstByte;
|
|
1138
|
+
}
|
|
1139
|
+
break;
|
|
1140
|
+
case 2:
|
|
1141
|
+
secondByte = buf[i + 1];
|
|
1142
|
+
if ((secondByte & 192) === 128) {
|
|
1143
|
+
tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
|
|
1144
|
+
if (tempCodePoint > 127) {
|
|
1145
|
+
codePoint = tempCodePoint;
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
break;
|
|
1149
|
+
case 3:
|
|
1150
|
+
secondByte = buf[i + 1];
|
|
1151
|
+
thirdByte = buf[i + 2];
|
|
1152
|
+
if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
|
|
1153
|
+
tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
|
|
1154
|
+
if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {
|
|
1155
|
+
codePoint = tempCodePoint;
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
break;
|
|
1159
|
+
case 4:
|
|
1160
|
+
secondByte = buf[i + 1];
|
|
1161
|
+
thirdByte = buf[i + 2];
|
|
1162
|
+
fourthByte = buf[i + 3];
|
|
1163
|
+
if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
|
|
1164
|
+
tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
|
|
1165
|
+
if (tempCodePoint > 65535 && tempCodePoint < 1114112) {
|
|
1166
|
+
codePoint = tempCodePoint;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
if (codePoint === null) {
|
|
1172
|
+
codePoint = 65533;
|
|
1173
|
+
bytesPerSequence = 1;
|
|
1174
|
+
} else if (codePoint > 65535) {
|
|
1175
|
+
codePoint -= 65536;
|
|
1176
|
+
res.push(codePoint >>> 10 & 1023 | 55296);
|
|
1177
|
+
codePoint = 56320 | codePoint & 1023;
|
|
1178
|
+
}
|
|
1179
|
+
res.push(codePoint);
|
|
1180
|
+
i += bytesPerSequence;
|
|
1181
|
+
}
|
|
1182
|
+
return decodeCodePointsArray(res);
|
|
1183
|
+
}
|
|
1184
|
+
var MAX_ARGUMENTS_LENGTH = 4096;
|
|
1185
|
+
function decodeCodePointsArray(codePoints) {
|
|
1186
|
+
var len = codePoints.length;
|
|
1187
|
+
if (len <= MAX_ARGUMENTS_LENGTH) {
|
|
1188
|
+
return String.fromCharCode.apply(String, codePoints);
|
|
1189
|
+
}
|
|
1190
|
+
var res = "";
|
|
1191
|
+
var i = 0;
|
|
1192
|
+
while (i < len) {
|
|
1193
|
+
res += String.fromCharCode.apply(
|
|
1194
|
+
String,
|
|
1195
|
+
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
|
|
1196
|
+
);
|
|
1197
|
+
}
|
|
1198
|
+
return res;
|
|
1199
|
+
}
|
|
1200
|
+
function asciiSlice(buf, start, end) {
|
|
1201
|
+
var ret = "";
|
|
1202
|
+
end = Math.min(buf.length, end);
|
|
1203
|
+
for (var i = start; i < end; ++i) {
|
|
1204
|
+
ret += String.fromCharCode(buf[i] & 127);
|
|
1205
|
+
}
|
|
1206
|
+
return ret;
|
|
1207
|
+
}
|
|
1208
|
+
function latin1Slice(buf, start, end) {
|
|
1209
|
+
var ret = "";
|
|
1210
|
+
end = Math.min(buf.length, end);
|
|
1211
|
+
for (var i = start; i < end; ++i) {
|
|
1212
|
+
ret += String.fromCharCode(buf[i]);
|
|
1213
|
+
}
|
|
1214
|
+
return ret;
|
|
1215
|
+
}
|
|
1216
|
+
function hexSlice(buf, start, end) {
|
|
1217
|
+
var len = buf.length;
|
|
1218
|
+
if (!start || start < 0)
|
|
1219
|
+
start = 0;
|
|
1220
|
+
if (!end || end < 0 || end > len)
|
|
1221
|
+
end = len;
|
|
1222
|
+
var out = "";
|
|
1223
|
+
for (var i = start; i < end; ++i) {
|
|
1224
|
+
out += toHex(buf[i]);
|
|
1225
|
+
}
|
|
1226
|
+
return out;
|
|
1227
|
+
}
|
|
1228
|
+
function utf16leSlice(buf, start, end) {
|
|
1229
|
+
var bytes = buf.slice(start, end);
|
|
1230
|
+
var res = "";
|
|
1231
|
+
for (var i = 0; i < bytes.length; i += 2) {
|
|
1232
|
+
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
|
|
1233
|
+
}
|
|
1234
|
+
return res;
|
|
1235
|
+
}
|
|
1236
|
+
Buffer$2.prototype.slice = function slice(start, end) {
|
|
1237
|
+
var len = this.length;
|
|
1238
|
+
start = ~~start;
|
|
1239
|
+
end = end === void 0 ? len : ~~end;
|
|
1240
|
+
if (start < 0) {
|
|
1241
|
+
start += len;
|
|
1242
|
+
if (start < 0)
|
|
1243
|
+
start = 0;
|
|
1244
|
+
} else if (start > len) {
|
|
1245
|
+
start = len;
|
|
1246
|
+
}
|
|
1247
|
+
if (end < 0) {
|
|
1248
|
+
end += len;
|
|
1249
|
+
if (end < 0)
|
|
1250
|
+
end = 0;
|
|
1251
|
+
} else if (end > len) {
|
|
1252
|
+
end = len;
|
|
1253
|
+
}
|
|
1254
|
+
if (end < start)
|
|
1255
|
+
end = start;
|
|
1256
|
+
var newBuf;
|
|
1257
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
1258
|
+
newBuf = this.subarray(start, end);
|
|
1259
|
+
newBuf.__proto__ = Buffer$2.prototype;
|
|
1260
|
+
} else {
|
|
1261
|
+
var sliceLen = end - start;
|
|
1262
|
+
newBuf = new Buffer$2(sliceLen, void 0);
|
|
1263
|
+
for (var i = 0; i < sliceLen; ++i) {
|
|
1264
|
+
newBuf[i] = this[i + start];
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
return newBuf;
|
|
1268
|
+
};
|
|
1269
|
+
function checkOffset(offset, ext, length2) {
|
|
1270
|
+
if (offset % 1 !== 0 || offset < 0)
|
|
1271
|
+
throw new RangeError("offset is not uint");
|
|
1272
|
+
if (offset + ext > length2)
|
|
1273
|
+
throw new RangeError("Trying to access beyond buffer length");
|
|
1274
|
+
}
|
|
1275
|
+
Buffer$2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {
|
|
1276
|
+
offset = offset | 0;
|
|
1277
|
+
byteLength2 = byteLength2 | 0;
|
|
1278
|
+
if (!noAssert)
|
|
1279
|
+
checkOffset(offset, byteLength2, this.length);
|
|
1280
|
+
var val2 = this[offset];
|
|
1281
|
+
var mul = 1;
|
|
1282
|
+
var i = 0;
|
|
1283
|
+
while (++i < byteLength2 && (mul *= 256)) {
|
|
1284
|
+
val2 += this[offset + i] * mul;
|
|
1285
|
+
}
|
|
1286
|
+
return val2;
|
|
1287
|
+
};
|
|
1288
|
+
Buffer$2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) {
|
|
1289
|
+
offset = offset | 0;
|
|
1290
|
+
byteLength2 = byteLength2 | 0;
|
|
1291
|
+
if (!noAssert) {
|
|
1292
|
+
checkOffset(offset, byteLength2, this.length);
|
|
1293
|
+
}
|
|
1294
|
+
var val2 = this[offset + --byteLength2];
|
|
1295
|
+
var mul = 1;
|
|
1296
|
+
while (byteLength2 > 0 && (mul *= 256)) {
|
|
1297
|
+
val2 += this[offset + --byteLength2] * mul;
|
|
1298
|
+
}
|
|
1299
|
+
return val2;
|
|
1300
|
+
};
|
|
1301
|
+
Buffer$2.prototype.readUInt8 = function readUInt8(offset, noAssert) {
|
|
1302
|
+
if (!noAssert)
|
|
1303
|
+
checkOffset(offset, 1, this.length);
|
|
1304
|
+
return this[offset];
|
|
1305
|
+
};
|
|
1306
|
+
Buffer$2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
|
|
1307
|
+
if (!noAssert)
|
|
1308
|
+
checkOffset(offset, 2, this.length);
|
|
1309
|
+
return this[offset] | this[offset + 1] << 8;
|
|
1310
|
+
};
|
|
1311
|
+
Buffer$2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
|
|
1312
|
+
if (!noAssert)
|
|
1313
|
+
checkOffset(offset, 2, this.length);
|
|
1314
|
+
return this[offset] << 8 | this[offset + 1];
|
|
1315
|
+
};
|
|
1316
|
+
Buffer$2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
|
|
1317
|
+
if (!noAssert)
|
|
1318
|
+
checkOffset(offset, 4, this.length);
|
|
1319
|
+
return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
|
|
1320
|
+
};
|
|
1321
|
+
Buffer$2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
|
|
1322
|
+
if (!noAssert)
|
|
1323
|
+
checkOffset(offset, 4, this.length);
|
|
1324
|
+
return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
|
|
1325
|
+
};
|
|
1326
|
+
Buffer$2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) {
|
|
1327
|
+
offset = offset | 0;
|
|
1328
|
+
byteLength2 = byteLength2 | 0;
|
|
1329
|
+
if (!noAssert)
|
|
1330
|
+
checkOffset(offset, byteLength2, this.length);
|
|
1331
|
+
var val2 = this[offset];
|
|
1332
|
+
var mul = 1;
|
|
1333
|
+
var i = 0;
|
|
1334
|
+
while (++i < byteLength2 && (mul *= 256)) {
|
|
1335
|
+
val2 += this[offset + i] * mul;
|
|
1336
|
+
}
|
|
1337
|
+
mul *= 128;
|
|
1338
|
+
if (val2 >= mul)
|
|
1339
|
+
val2 -= Math.pow(2, 8 * byteLength2);
|
|
1340
|
+
return val2;
|
|
1341
|
+
};
|
|
1342
|
+
Buffer$2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) {
|
|
1343
|
+
offset = offset | 0;
|
|
1344
|
+
byteLength2 = byteLength2 | 0;
|
|
1345
|
+
if (!noAssert)
|
|
1346
|
+
checkOffset(offset, byteLength2, this.length);
|
|
1347
|
+
var i = byteLength2;
|
|
1348
|
+
var mul = 1;
|
|
1349
|
+
var val2 = this[offset + --i];
|
|
1350
|
+
while (i > 0 && (mul *= 256)) {
|
|
1351
|
+
val2 += this[offset + --i] * mul;
|
|
1352
|
+
}
|
|
1353
|
+
mul *= 128;
|
|
1354
|
+
if (val2 >= mul)
|
|
1355
|
+
val2 -= Math.pow(2, 8 * byteLength2);
|
|
1356
|
+
return val2;
|
|
1357
|
+
};
|
|
1358
|
+
Buffer$2.prototype.readInt8 = function readInt8(offset, noAssert) {
|
|
1359
|
+
if (!noAssert)
|
|
1360
|
+
checkOffset(offset, 1, this.length);
|
|
1361
|
+
if (!(this[offset] & 128))
|
|
1362
|
+
return this[offset];
|
|
1363
|
+
return (255 - this[offset] + 1) * -1;
|
|
1364
|
+
};
|
|
1365
|
+
Buffer$2.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
|
|
1366
|
+
if (!noAssert)
|
|
1367
|
+
checkOffset(offset, 2, this.length);
|
|
1368
|
+
var val2 = this[offset] | this[offset + 1] << 8;
|
|
1369
|
+
return val2 & 32768 ? val2 | 4294901760 : val2;
|
|
1370
|
+
};
|
|
1371
|
+
Buffer$2.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
|
|
1372
|
+
if (!noAssert)
|
|
1373
|
+
checkOffset(offset, 2, this.length);
|
|
1374
|
+
var val2 = this[offset + 1] | this[offset] << 8;
|
|
1375
|
+
return val2 & 32768 ? val2 | 4294901760 : val2;
|
|
1376
|
+
};
|
|
1377
|
+
Buffer$2.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
|
|
1378
|
+
if (!noAssert)
|
|
1379
|
+
checkOffset(offset, 4, this.length);
|
|
1380
|
+
return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
|
|
1381
|
+
};
|
|
1382
|
+
Buffer$2.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
|
|
1383
|
+
if (!noAssert)
|
|
1384
|
+
checkOffset(offset, 4, this.length);
|
|
1385
|
+
return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
|
|
1386
|
+
};
|
|
1387
|
+
Buffer$2.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
|
|
1388
|
+
if (!noAssert)
|
|
1389
|
+
checkOffset(offset, 4, this.length);
|
|
1390
|
+
return read(this, offset, true, 23, 4);
|
|
1391
|
+
};
|
|
1392
|
+
Buffer$2.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
|
|
1393
|
+
if (!noAssert)
|
|
1394
|
+
checkOffset(offset, 4, this.length);
|
|
1395
|
+
return read(this, offset, false, 23, 4);
|
|
1396
|
+
};
|
|
1397
|
+
Buffer$2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
|
|
1398
|
+
if (!noAssert)
|
|
1399
|
+
checkOffset(offset, 8, this.length);
|
|
1400
|
+
return read(this, offset, true, 52, 8);
|
|
1401
|
+
};
|
|
1402
|
+
Buffer$2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
|
|
1403
|
+
if (!noAssert)
|
|
1404
|
+
checkOffset(offset, 8, this.length);
|
|
1405
|
+
return read(this, offset, false, 52, 8);
|
|
1406
|
+
};
|
|
1407
|
+
function checkInt(buf, value, offset, ext, max, min) {
|
|
1408
|
+
if (!internalIsBuffer(buf))
|
|
1409
|
+
throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
1410
|
+
if (value > max || value < min)
|
|
1411
|
+
throw new RangeError('"value" argument is out of bounds');
|
|
1412
|
+
if (offset + ext > buf.length)
|
|
1413
|
+
throw new RangeError("Index out of range");
|
|
1414
|
+
}
|
|
1415
|
+
Buffer$2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) {
|
|
1416
|
+
value = +value;
|
|
1417
|
+
offset = offset | 0;
|
|
1418
|
+
byteLength2 = byteLength2 | 0;
|
|
1419
|
+
if (!noAssert) {
|
|
1420
|
+
var maxBytes = Math.pow(2, 8 * byteLength2) - 1;
|
|
1421
|
+
checkInt(this, value, offset, byteLength2, maxBytes, 0);
|
|
1422
|
+
}
|
|
1423
|
+
var mul = 1;
|
|
1424
|
+
var i = 0;
|
|
1425
|
+
this[offset] = value & 255;
|
|
1426
|
+
while (++i < byteLength2 && (mul *= 256)) {
|
|
1427
|
+
this[offset + i] = value / mul & 255;
|
|
1428
|
+
}
|
|
1429
|
+
return offset + byteLength2;
|
|
1430
|
+
};
|
|
1431
|
+
Buffer$2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) {
|
|
1432
|
+
value = +value;
|
|
1433
|
+
offset = offset | 0;
|
|
1434
|
+
byteLength2 = byteLength2 | 0;
|
|
1435
|
+
if (!noAssert) {
|
|
1436
|
+
var maxBytes = Math.pow(2, 8 * byteLength2) - 1;
|
|
1437
|
+
checkInt(this, value, offset, byteLength2, maxBytes, 0);
|
|
1438
|
+
}
|
|
1439
|
+
var i = byteLength2 - 1;
|
|
1440
|
+
var mul = 1;
|
|
1441
|
+
this[offset + i] = value & 255;
|
|
1442
|
+
while (--i >= 0 && (mul *= 256)) {
|
|
1443
|
+
this[offset + i] = value / mul & 255;
|
|
1444
|
+
}
|
|
1445
|
+
return offset + byteLength2;
|
|
1446
|
+
};
|
|
1447
|
+
Buffer$2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
|
|
1448
|
+
value = +value;
|
|
1449
|
+
offset = offset | 0;
|
|
1450
|
+
if (!noAssert)
|
|
1451
|
+
checkInt(this, value, offset, 1, 255, 0);
|
|
1452
|
+
if (!Buffer$2.TYPED_ARRAY_SUPPORT)
|
|
1453
|
+
value = Math.floor(value);
|
|
1454
|
+
this[offset] = value & 255;
|
|
1455
|
+
return offset + 1;
|
|
1456
|
+
};
|
|
1457
|
+
function objectWriteUInt16(buf, value, offset, littleEndian) {
|
|
1458
|
+
if (value < 0)
|
|
1459
|
+
value = 65535 + value + 1;
|
|
1460
|
+
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
|
|
1461
|
+
buf[offset + i] = (value & 255 << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
Buffer$2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
|
|
1465
|
+
value = +value;
|
|
1466
|
+
offset = offset | 0;
|
|
1467
|
+
if (!noAssert)
|
|
1468
|
+
checkInt(this, value, offset, 2, 65535, 0);
|
|
1469
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
1470
|
+
this[offset] = value & 255;
|
|
1471
|
+
this[offset + 1] = value >>> 8;
|
|
1472
|
+
} else {
|
|
1473
|
+
objectWriteUInt16(this, value, offset, true);
|
|
1474
|
+
}
|
|
1475
|
+
return offset + 2;
|
|
1476
|
+
};
|
|
1477
|
+
Buffer$2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
|
|
1478
|
+
value = +value;
|
|
1479
|
+
offset = offset | 0;
|
|
1480
|
+
if (!noAssert)
|
|
1481
|
+
checkInt(this, value, offset, 2, 65535, 0);
|
|
1482
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
1483
|
+
this[offset] = value >>> 8;
|
|
1484
|
+
this[offset + 1] = value & 255;
|
|
1485
|
+
} else {
|
|
1486
|
+
objectWriteUInt16(this, value, offset, false);
|
|
1487
|
+
}
|
|
1488
|
+
return offset + 2;
|
|
1489
|
+
};
|
|
1490
|
+
function objectWriteUInt32(buf, value, offset, littleEndian) {
|
|
1491
|
+
if (value < 0)
|
|
1492
|
+
value = 4294967295 + value + 1;
|
|
1493
|
+
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
|
|
1494
|
+
buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 255;
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
Buffer$2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
|
|
1498
|
+
value = +value;
|
|
1499
|
+
offset = offset | 0;
|
|
1500
|
+
if (!noAssert)
|
|
1501
|
+
checkInt(this, value, offset, 4, 4294967295, 0);
|
|
1502
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
1503
|
+
this[offset + 3] = value >>> 24;
|
|
1504
|
+
this[offset + 2] = value >>> 16;
|
|
1505
|
+
this[offset + 1] = value >>> 8;
|
|
1506
|
+
this[offset] = value & 255;
|
|
1507
|
+
} else {
|
|
1508
|
+
objectWriteUInt32(this, value, offset, true);
|
|
1509
|
+
}
|
|
1510
|
+
return offset + 4;
|
|
1511
|
+
};
|
|
1512
|
+
Buffer$2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
|
|
1513
|
+
value = +value;
|
|
1514
|
+
offset = offset | 0;
|
|
1515
|
+
if (!noAssert)
|
|
1516
|
+
checkInt(this, value, offset, 4, 4294967295, 0);
|
|
1517
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
1518
|
+
this[offset] = value >>> 24;
|
|
1519
|
+
this[offset + 1] = value >>> 16;
|
|
1520
|
+
this[offset + 2] = value >>> 8;
|
|
1521
|
+
this[offset + 3] = value & 255;
|
|
1522
|
+
} else {
|
|
1523
|
+
objectWriteUInt32(this, value, offset, false);
|
|
1524
|
+
}
|
|
1525
|
+
return offset + 4;
|
|
1526
|
+
};
|
|
1527
|
+
Buffer$2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) {
|
|
1528
|
+
value = +value;
|
|
1529
|
+
offset = offset | 0;
|
|
1530
|
+
if (!noAssert) {
|
|
1531
|
+
var limit = Math.pow(2, 8 * byteLength2 - 1);
|
|
1532
|
+
checkInt(this, value, offset, byteLength2, limit - 1, -limit);
|
|
1533
|
+
}
|
|
1534
|
+
var i = 0;
|
|
1535
|
+
var mul = 1;
|
|
1536
|
+
var sub = 0;
|
|
1537
|
+
this[offset] = value & 255;
|
|
1538
|
+
while (++i < byteLength2 && (mul *= 256)) {
|
|
1539
|
+
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
|
|
1540
|
+
sub = 1;
|
|
1541
|
+
}
|
|
1542
|
+
this[offset + i] = (value / mul >> 0) - sub & 255;
|
|
1543
|
+
}
|
|
1544
|
+
return offset + byteLength2;
|
|
1545
|
+
};
|
|
1546
|
+
Buffer$2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) {
|
|
1547
|
+
value = +value;
|
|
1548
|
+
offset = offset | 0;
|
|
1549
|
+
if (!noAssert) {
|
|
1550
|
+
var limit = Math.pow(2, 8 * byteLength2 - 1);
|
|
1551
|
+
checkInt(this, value, offset, byteLength2, limit - 1, -limit);
|
|
1552
|
+
}
|
|
1553
|
+
var i = byteLength2 - 1;
|
|
1554
|
+
var mul = 1;
|
|
1555
|
+
var sub = 0;
|
|
1556
|
+
this[offset + i] = value & 255;
|
|
1557
|
+
while (--i >= 0 && (mul *= 256)) {
|
|
1558
|
+
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
|
|
1559
|
+
sub = 1;
|
|
1560
|
+
}
|
|
1561
|
+
this[offset + i] = (value / mul >> 0) - sub & 255;
|
|
1562
|
+
}
|
|
1563
|
+
return offset + byteLength2;
|
|
1564
|
+
};
|
|
1565
|
+
Buffer$2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
|
|
1566
|
+
value = +value;
|
|
1567
|
+
offset = offset | 0;
|
|
1568
|
+
if (!noAssert)
|
|
1569
|
+
checkInt(this, value, offset, 1, 127, -128);
|
|
1570
|
+
if (!Buffer$2.TYPED_ARRAY_SUPPORT)
|
|
1571
|
+
value = Math.floor(value);
|
|
1572
|
+
if (value < 0)
|
|
1573
|
+
value = 255 + value + 1;
|
|
1574
|
+
this[offset] = value & 255;
|
|
1575
|
+
return offset + 1;
|
|
1576
|
+
};
|
|
1577
|
+
Buffer$2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
|
|
1578
|
+
value = +value;
|
|
1579
|
+
offset = offset | 0;
|
|
1580
|
+
if (!noAssert)
|
|
1581
|
+
checkInt(this, value, offset, 2, 32767, -32768);
|
|
1582
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
1583
|
+
this[offset] = value & 255;
|
|
1584
|
+
this[offset + 1] = value >>> 8;
|
|
1585
|
+
} else {
|
|
1586
|
+
objectWriteUInt16(this, value, offset, true);
|
|
1587
|
+
}
|
|
1588
|
+
return offset + 2;
|
|
1589
|
+
};
|
|
1590
|
+
Buffer$2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
|
|
1591
|
+
value = +value;
|
|
1592
|
+
offset = offset | 0;
|
|
1593
|
+
if (!noAssert)
|
|
1594
|
+
checkInt(this, value, offset, 2, 32767, -32768);
|
|
1595
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
1596
|
+
this[offset] = value >>> 8;
|
|
1597
|
+
this[offset + 1] = value & 255;
|
|
1598
|
+
} else {
|
|
1599
|
+
objectWriteUInt16(this, value, offset, false);
|
|
1600
|
+
}
|
|
1601
|
+
return offset + 2;
|
|
1602
|
+
};
|
|
1603
|
+
Buffer$2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
|
|
1604
|
+
value = +value;
|
|
1605
|
+
offset = offset | 0;
|
|
1606
|
+
if (!noAssert)
|
|
1607
|
+
checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
1608
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
1609
|
+
this[offset] = value & 255;
|
|
1610
|
+
this[offset + 1] = value >>> 8;
|
|
1611
|
+
this[offset + 2] = value >>> 16;
|
|
1612
|
+
this[offset + 3] = value >>> 24;
|
|
1613
|
+
} else {
|
|
1614
|
+
objectWriteUInt32(this, value, offset, true);
|
|
1615
|
+
}
|
|
1616
|
+
return offset + 4;
|
|
1617
|
+
};
|
|
1618
|
+
Buffer$2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
|
|
1619
|
+
value = +value;
|
|
1620
|
+
offset = offset | 0;
|
|
1621
|
+
if (!noAssert)
|
|
1622
|
+
checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
1623
|
+
if (value < 0)
|
|
1624
|
+
value = 4294967295 + value + 1;
|
|
1625
|
+
if (Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
1626
|
+
this[offset] = value >>> 24;
|
|
1627
|
+
this[offset + 1] = value >>> 16;
|
|
1628
|
+
this[offset + 2] = value >>> 8;
|
|
1629
|
+
this[offset + 3] = value & 255;
|
|
1630
|
+
} else {
|
|
1631
|
+
objectWriteUInt32(this, value, offset, false);
|
|
1632
|
+
}
|
|
1633
|
+
return offset + 4;
|
|
1634
|
+
};
|
|
1635
|
+
function checkIEEE754(buf, value, offset, ext, max, min) {
|
|
1636
|
+
if (offset + ext > buf.length)
|
|
1637
|
+
throw new RangeError("Index out of range");
|
|
1638
|
+
if (offset < 0)
|
|
1639
|
+
throw new RangeError("Index out of range");
|
|
1640
|
+
}
|
|
1641
|
+
function writeFloat(buf, value, offset, littleEndian, noAssert) {
|
|
1642
|
+
if (!noAssert) {
|
|
1643
|
+
checkIEEE754(buf, value, offset, 4);
|
|
1644
|
+
}
|
|
1645
|
+
write(buf, value, offset, littleEndian, 23, 4);
|
|
1646
|
+
return offset + 4;
|
|
1647
|
+
}
|
|
1648
|
+
Buffer$2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
|
|
1649
|
+
return writeFloat(this, value, offset, true, noAssert);
|
|
1650
|
+
};
|
|
1651
|
+
Buffer$2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
|
|
1652
|
+
return writeFloat(this, value, offset, false, noAssert);
|
|
1653
|
+
};
|
|
1654
|
+
function writeDouble(buf, value, offset, littleEndian, noAssert) {
|
|
1655
|
+
if (!noAssert) {
|
|
1656
|
+
checkIEEE754(buf, value, offset, 8);
|
|
1657
|
+
}
|
|
1658
|
+
write(buf, value, offset, littleEndian, 52, 8);
|
|
1659
|
+
return offset + 8;
|
|
1660
|
+
}
|
|
1661
|
+
Buffer$2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
|
|
1662
|
+
return writeDouble(this, value, offset, true, noAssert);
|
|
1663
|
+
};
|
|
1664
|
+
Buffer$2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
|
|
1665
|
+
return writeDouble(this, value, offset, false, noAssert);
|
|
1666
|
+
};
|
|
1667
|
+
Buffer$2.prototype.copy = function copy(target, targetStart, start, end) {
|
|
1668
|
+
if (!start)
|
|
1669
|
+
start = 0;
|
|
1670
|
+
if (!end && end !== 0)
|
|
1671
|
+
end = this.length;
|
|
1672
|
+
if (targetStart >= target.length)
|
|
1673
|
+
targetStart = target.length;
|
|
1674
|
+
if (!targetStart)
|
|
1675
|
+
targetStart = 0;
|
|
1676
|
+
if (end > 0 && end < start)
|
|
1677
|
+
end = start;
|
|
1678
|
+
if (end === start)
|
|
1679
|
+
return 0;
|
|
1680
|
+
if (target.length === 0 || this.length === 0)
|
|
1681
|
+
return 0;
|
|
1682
|
+
if (targetStart < 0) {
|
|
1683
|
+
throw new RangeError("targetStart out of bounds");
|
|
1684
|
+
}
|
|
1685
|
+
if (start < 0 || start >= this.length)
|
|
1686
|
+
throw new RangeError("sourceStart out of bounds");
|
|
1687
|
+
if (end < 0)
|
|
1688
|
+
throw new RangeError("sourceEnd out of bounds");
|
|
1689
|
+
if (end > this.length)
|
|
1690
|
+
end = this.length;
|
|
1691
|
+
if (target.length - targetStart < end - start) {
|
|
1692
|
+
end = target.length - targetStart + start;
|
|
1693
|
+
}
|
|
1694
|
+
var len = end - start;
|
|
1695
|
+
var i;
|
|
1696
|
+
if (this === target && start < targetStart && targetStart < end) {
|
|
1697
|
+
for (i = len - 1; i >= 0; --i) {
|
|
1698
|
+
target[i + targetStart] = this[i + start];
|
|
1699
|
+
}
|
|
1700
|
+
} else if (len < 1e3 || !Buffer$2.TYPED_ARRAY_SUPPORT) {
|
|
1701
|
+
for (i = 0; i < len; ++i) {
|
|
1702
|
+
target[i + targetStart] = this[i + start];
|
|
1703
|
+
}
|
|
1704
|
+
} else {
|
|
1705
|
+
Uint8Array.prototype.set.call(
|
|
1706
|
+
target,
|
|
1707
|
+
this.subarray(start, start + len),
|
|
1708
|
+
targetStart
|
|
1709
|
+
);
|
|
1710
|
+
}
|
|
1711
|
+
return len;
|
|
1712
|
+
};
|
|
1713
|
+
Buffer$2.prototype.fill = function fill(val2, start, end, encoding) {
|
|
1714
|
+
if (typeof val2 === "string") {
|
|
1715
|
+
if (typeof start === "string") {
|
|
1716
|
+
encoding = start;
|
|
1717
|
+
start = 0;
|
|
1718
|
+
end = this.length;
|
|
1719
|
+
} else if (typeof end === "string") {
|
|
1720
|
+
encoding = end;
|
|
1721
|
+
end = this.length;
|
|
1722
|
+
}
|
|
1723
|
+
if (val2.length === 1) {
|
|
1724
|
+
var code2 = val2.charCodeAt(0);
|
|
1725
|
+
if (code2 < 256) {
|
|
1726
|
+
val2 = code2;
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
if (encoding !== void 0 && typeof encoding !== "string") {
|
|
1730
|
+
throw new TypeError("encoding must be a string");
|
|
1731
|
+
}
|
|
1732
|
+
if (typeof encoding === "string" && !Buffer$2.isEncoding(encoding)) {
|
|
1733
|
+
throw new TypeError("Unknown encoding: " + encoding);
|
|
1734
|
+
}
|
|
1735
|
+
} else if (typeof val2 === "number") {
|
|
1736
|
+
val2 = val2 & 255;
|
|
1737
|
+
}
|
|
1738
|
+
if (start < 0 || this.length < start || this.length < end) {
|
|
1739
|
+
throw new RangeError("Out of range index");
|
|
1740
|
+
}
|
|
1741
|
+
if (end <= start) {
|
|
1742
|
+
return this;
|
|
1743
|
+
}
|
|
1744
|
+
start = start >>> 0;
|
|
1745
|
+
end = end === void 0 ? this.length : end >>> 0;
|
|
1746
|
+
if (!val2)
|
|
1747
|
+
val2 = 0;
|
|
1748
|
+
var i;
|
|
1749
|
+
if (typeof val2 === "number") {
|
|
1750
|
+
for (i = start; i < end; ++i) {
|
|
1751
|
+
this[i] = val2;
|
|
1752
|
+
}
|
|
1753
|
+
} else {
|
|
1754
|
+
var bytes = internalIsBuffer(val2) ? val2 : utf8ToBytes(new Buffer$2(val2, encoding).toString());
|
|
1755
|
+
var len = bytes.length;
|
|
1756
|
+
for (i = 0; i < end - start; ++i) {
|
|
1757
|
+
this[i + start] = bytes[i % len];
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
return this;
|
|
1761
|
+
};
|
|
1762
|
+
var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
|
|
1763
|
+
function base64clean(str) {
|
|
1764
|
+
str = stringtrim(str).replace(INVALID_BASE64_RE, "");
|
|
1765
|
+
if (str.length < 2)
|
|
1766
|
+
return "";
|
|
1767
|
+
while (str.length % 4 !== 0) {
|
|
1768
|
+
str = str + "=";
|
|
1769
|
+
}
|
|
1770
|
+
return str;
|
|
1771
|
+
}
|
|
1772
|
+
function stringtrim(str) {
|
|
1773
|
+
if (str.trim)
|
|
1774
|
+
return str.trim();
|
|
1775
|
+
return str.replace(/^\s+|\s+$/g, "");
|
|
1776
|
+
}
|
|
1777
|
+
function toHex(n) {
|
|
1778
|
+
if (n < 16)
|
|
1779
|
+
return "0" + n.toString(16);
|
|
1780
|
+
return n.toString(16);
|
|
1781
|
+
}
|
|
1782
|
+
function utf8ToBytes(string, units) {
|
|
1783
|
+
units = units || Infinity;
|
|
1784
|
+
var codePoint;
|
|
1785
|
+
var length2 = string.length;
|
|
1786
|
+
var leadSurrogate = null;
|
|
1787
|
+
var bytes = [];
|
|
1788
|
+
for (var i = 0; i < length2; ++i) {
|
|
1789
|
+
codePoint = string.charCodeAt(i);
|
|
1790
|
+
if (codePoint > 55295 && codePoint < 57344) {
|
|
1791
|
+
if (!leadSurrogate) {
|
|
1792
|
+
if (codePoint > 56319) {
|
|
1793
|
+
if ((units -= 3) > -1)
|
|
1794
|
+
bytes.push(239, 191, 189);
|
|
1795
|
+
continue;
|
|
1796
|
+
} else if (i + 1 === length2) {
|
|
1797
|
+
if ((units -= 3) > -1)
|
|
1798
|
+
bytes.push(239, 191, 189);
|
|
1799
|
+
continue;
|
|
1800
|
+
}
|
|
1801
|
+
leadSurrogate = codePoint;
|
|
1802
|
+
continue;
|
|
1803
|
+
}
|
|
1804
|
+
if (codePoint < 56320) {
|
|
1805
|
+
if ((units -= 3) > -1)
|
|
1806
|
+
bytes.push(239, 191, 189);
|
|
1807
|
+
leadSurrogate = codePoint;
|
|
1808
|
+
continue;
|
|
1809
|
+
}
|
|
1810
|
+
codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;
|
|
1811
|
+
} else if (leadSurrogate) {
|
|
1812
|
+
if ((units -= 3) > -1)
|
|
1813
|
+
bytes.push(239, 191, 189);
|
|
1814
|
+
}
|
|
1815
|
+
leadSurrogate = null;
|
|
1816
|
+
if (codePoint < 128) {
|
|
1817
|
+
if ((units -= 1) < 0)
|
|
1818
|
+
break;
|
|
1819
|
+
bytes.push(codePoint);
|
|
1820
|
+
} else if (codePoint < 2048) {
|
|
1821
|
+
if ((units -= 2) < 0)
|
|
1822
|
+
break;
|
|
1823
|
+
bytes.push(
|
|
1824
|
+
codePoint >> 6 | 192,
|
|
1825
|
+
codePoint & 63 | 128
|
|
1826
|
+
);
|
|
1827
|
+
} else if (codePoint < 65536) {
|
|
1828
|
+
if ((units -= 3) < 0)
|
|
1829
|
+
break;
|
|
1830
|
+
bytes.push(
|
|
1831
|
+
codePoint >> 12 | 224,
|
|
1832
|
+
codePoint >> 6 & 63 | 128,
|
|
1833
|
+
codePoint & 63 | 128
|
|
1834
|
+
);
|
|
1835
|
+
} else if (codePoint < 1114112) {
|
|
1836
|
+
if ((units -= 4) < 0)
|
|
1837
|
+
break;
|
|
1838
|
+
bytes.push(
|
|
1839
|
+
codePoint >> 18 | 240,
|
|
1840
|
+
codePoint >> 12 & 63 | 128,
|
|
1841
|
+
codePoint >> 6 & 63 | 128,
|
|
1842
|
+
codePoint & 63 | 128
|
|
1843
|
+
);
|
|
1844
|
+
} else {
|
|
1845
|
+
throw new Error("Invalid code point");
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
return bytes;
|
|
1849
|
+
}
|
|
1850
|
+
function asciiToBytes(str) {
|
|
1851
|
+
var byteArray = [];
|
|
1852
|
+
for (var i = 0; i < str.length; ++i) {
|
|
1853
|
+
byteArray.push(str.charCodeAt(i) & 255);
|
|
1854
|
+
}
|
|
1855
|
+
return byteArray;
|
|
1856
|
+
}
|
|
1857
|
+
function utf16leToBytes(str, units) {
|
|
1858
|
+
var c, hi, lo;
|
|
1859
|
+
var byteArray = [];
|
|
1860
|
+
for (var i = 0; i < str.length; ++i) {
|
|
1861
|
+
if ((units -= 2) < 0)
|
|
1862
|
+
break;
|
|
1863
|
+
c = str.charCodeAt(i);
|
|
1864
|
+
hi = c >> 8;
|
|
1865
|
+
lo = c % 256;
|
|
1866
|
+
byteArray.push(lo);
|
|
1867
|
+
byteArray.push(hi);
|
|
1868
|
+
}
|
|
1869
|
+
return byteArray;
|
|
1870
|
+
}
|
|
1871
|
+
function base64ToBytes(str) {
|
|
1872
|
+
return toByteArray(base64clean(str));
|
|
1873
|
+
}
|
|
1874
|
+
function blitBuffer(src2, dst, offset, length2) {
|
|
1875
|
+
for (var i = 0; i < length2; ++i) {
|
|
1876
|
+
if (i + offset >= dst.length || i >= src2.length)
|
|
1877
|
+
break;
|
|
1878
|
+
dst[i + offset] = src2[i];
|
|
1879
|
+
}
|
|
1880
|
+
return i;
|
|
1881
|
+
}
|
|
1882
|
+
function isnan(val2) {
|
|
1883
|
+
return val2 !== val2;
|
|
1884
|
+
}
|
|
1885
|
+
function isBuffer(obj) {
|
|
1886
|
+
return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj));
|
|
1887
|
+
}
|
|
1888
|
+
function isFastBuffer(obj) {
|
|
1889
|
+
return !!obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
|
|
1890
|
+
}
|
|
1891
|
+
function isSlowBuffer(obj) {
|
|
1892
|
+
return typeof obj.readFloatLE === "function" && typeof obj.slice === "function" && isFastBuffer(obj.slice(0, 0));
|
|
1893
|
+
}
|
|
93
1894
|
var defaultsExports = {};
|
|
94
1895
|
var defaults$5 = {
|
|
95
1896
|
get exports() {
|
|
@@ -612,7 +2413,7 @@ var textParsers$1 = {
|
|
|
612
2413
|
init: init$1
|
|
613
2414
|
};
|
|
614
2415
|
var BASE = 1e6;
|
|
615
|
-
function
|
|
2416
|
+
function readInt82(buffer) {
|
|
616
2417
|
var high = buffer.readInt32BE(0);
|
|
617
2418
|
var low = buffer.readUInt32BE(4);
|
|
618
2419
|
var sign = "";
|
|
@@ -683,7 +2484,7 @@ function readInt8(buffer) {
|
|
|
683
2484
|
return sign + digits + result2;
|
|
684
2485
|
}
|
|
685
2486
|
}
|
|
686
|
-
var pgInt8 =
|
|
2487
|
+
var pgInt8 = readInt82;
|
|
687
2488
|
var parseInt64 = pgInt8;
|
|
688
2489
|
var parseBits = function(data, bits, offset, invert, callback) {
|
|
689
2490
|
offset = offset || 0;
|
|
@@ -980,7 +2781,7 @@ binaryParsers.init(function(oid, converter) {
|
|
|
980
2781
|
// database host. defaults to localhost
|
|
981
2782
|
host: "localhost",
|
|
982
2783
|
// database user's name
|
|
983
|
-
user:
|
|
2784
|
+
user: browser$1.platform === "win32" ? browser$1.env.USERNAME : browser$1.env.USER,
|
|
984
2785
|
// name of database to connect
|
|
985
2786
|
database: void 0,
|
|
986
2787
|
// database user's password
|
|
@@ -1428,7 +3229,7 @@ function split(matcher, mapper, options2) {
|
|
|
1428
3229
|
}
|
|
1429
3230
|
var split2 = split;
|
|
1430
3231
|
(function(module2) {
|
|
1431
|
-
var path = require$$0$4, Stream = require$$0$3.Stream, split3 = split2, util2 = require$$0$2, defaultPort = 5432, isWin =
|
|
3232
|
+
var path = require$$0$4, Stream = require$$0$3.Stream, split3 = split2, util2 = require$$0$2, defaultPort = 5432, isWin = browser$1.platform === "win32", warnStream = browser$1.stderr;
|
|
1432
3233
|
var S_IRWXG = 56, S_IRWXO = 7, S_IFMT = 61440, S_IFREG = 32768;
|
|
1433
3234
|
function isRegFile(mode) {
|
|
1434
3235
|
return (mode & S_IFMT) == S_IFREG;
|
|
@@ -1457,12 +3258,12 @@ var split2 = split;
|
|
|
1457
3258
|
return old2;
|
|
1458
3259
|
};
|
|
1459
3260
|
module2.exports.getFileName = function(rawEnv) {
|
|
1460
|
-
var
|
|
1461
|
-
var file =
|
|
3261
|
+
var env2 = rawEnv || browser$1.env;
|
|
3262
|
+
var file = env2.PGPASSFILE || (isWin ? path.join(env2.APPDATA || "./", "postgresql", "pgpass.conf") : path.join(env2.HOME || "./", ".pgpass"));
|
|
1462
3263
|
return file;
|
|
1463
3264
|
};
|
|
1464
3265
|
module2.exports.usePgPass = function(stats, fname) {
|
|
1465
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
3266
|
+
if (Object.prototype.hasOwnProperty.call(browser$1.env, "PGPASSWORD")) {
|
|
1466
3267
|
return false;
|
|
1467
3268
|
}
|
|
1468
3269
|
if (isWin) {
|
|
@@ -1523,7 +3324,7 @@ var split2 = split;
|
|
|
1523
3324
|
var isLastField = false;
|
|
1524
3325
|
var addToObj = function(idx, i0, i1) {
|
|
1525
3326
|
var field = line.substring(i0, i1);
|
|
1526
|
-
if (!Object.hasOwnProperty.call(
|
|
3327
|
+
if (!Object.hasOwnProperty.call(browser$1.env, "PGPASS_NO_DEESCAPE")) {
|
|
1527
3328
|
field = field.replace(/\\([:\\])/g, "$1");
|
|
1528
3329
|
}
|
|
1529
3330
|
obj[fieldNames[idx]] = field;
|
|
@@ -1706,16 +3507,16 @@ var defaults$3 = defaultsExports;
|
|
|
1706
3507
|
var parse$2 = pgConnectionString.parse;
|
|
1707
3508
|
var val = function(key, config2, envVar) {
|
|
1708
3509
|
if (envVar === void 0) {
|
|
1709
|
-
envVar =
|
|
3510
|
+
envVar = browser$1.env["PG" + key.toUpperCase()];
|
|
1710
3511
|
} else if (envVar === false)
|
|
1711
3512
|
;
|
|
1712
3513
|
else {
|
|
1713
|
-
envVar =
|
|
3514
|
+
envVar = browser$1.env[envVar];
|
|
1714
3515
|
}
|
|
1715
3516
|
return config2[key] || envVar || defaults$3[key];
|
|
1716
3517
|
};
|
|
1717
3518
|
var readSSLConfigFromEnvironment = function() {
|
|
1718
|
-
switch (
|
|
3519
|
+
switch (browser$1.env.PGSSLMODE) {
|
|
1719
3520
|
case "disable":
|
|
1720
3521
|
return false;
|
|
1721
3522
|
case "prefer":
|
|
@@ -1782,7 +3583,7 @@ let ConnectionParameters$1 = class ConnectionParameters {
|
|
|
1782
3583
|
this.idle_in_transaction_session_timeout = val("idle_in_transaction_session_timeout", config2, false);
|
|
1783
3584
|
this.query_timeout = val("query_timeout", config2, false);
|
|
1784
3585
|
if (config2.connectionTimeoutMillis === void 0) {
|
|
1785
|
-
this.connect_timeout =
|
|
3586
|
+
this.connect_timeout = browser$1.env.PGCONNECT_TIMEOUT || 0;
|
|
1786
3587
|
} else {
|
|
1787
3588
|
this.connect_timeout = Math.floor(config2.connectionTimeoutMillis / 1e3);
|
|
1788
3589
|
}
|
|
@@ -1929,8 +3730,8 @@ let Query$1 = class Query extends EventEmitter$2 {
|
|
|
1929
3730
|
this.portal = config2.portal || "";
|
|
1930
3731
|
this.callback = config2.callback;
|
|
1931
3732
|
this._rowMode = config2.rowMode;
|
|
1932
|
-
if (
|
|
1933
|
-
this.callback =
|
|
3733
|
+
if (browser$1.domain && config2.callback) {
|
|
3734
|
+
this.callback = browser$1.domain.bind(config2.callback);
|
|
1934
3735
|
}
|
|
1935
3736
|
this._result = new Result2(this._rowMode, this.types);
|
|
1936
3737
|
this._results = this._result;
|
|
@@ -2020,7 +3821,7 @@ let Query$1 = class Query extends EventEmitter$2 {
|
|
|
2020
3821
|
try {
|
|
2021
3822
|
this.callback(null, this._results);
|
|
2022
3823
|
} catch (err) {
|
|
2023
|
-
|
|
3824
|
+
browser$1.nextTick(() => {
|
|
2024
3825
|
throw err;
|
|
2025
3826
|
});
|
|
2026
3827
|
}
|
|
@@ -3131,7 +4932,7 @@ class Client extends EventEmitter {
|
|
|
3131
4932
|
}
|
|
3132
4933
|
_errorAllQueries(err) {
|
|
3133
4934
|
const enqueueError = (query2) => {
|
|
3134
|
-
|
|
4935
|
+
browser$1.nextTick(() => {
|
|
3135
4936
|
query2.handleError(err, this.connection);
|
|
3136
4937
|
});
|
|
3137
4938
|
};
|
|
@@ -3148,7 +4949,7 @@ class Client extends EventEmitter {
|
|
|
3148
4949
|
this._connectionCallback = callback;
|
|
3149
4950
|
if (this._connecting || this._connected) {
|
|
3150
4951
|
const err = new Error("Client has already been connected. You cannot reuse a client.");
|
|
3151
|
-
|
|
4952
|
+
browser$1.nextTick(() => {
|
|
3152
4953
|
callback(err);
|
|
3153
4954
|
});
|
|
3154
4955
|
return;
|
|
@@ -3193,7 +4994,7 @@ class Client extends EventEmitter {
|
|
|
3193
4994
|
this._handleErrorEvent(error);
|
|
3194
4995
|
}
|
|
3195
4996
|
}
|
|
3196
|
-
|
|
4997
|
+
browser$1.nextTick(() => {
|
|
3197
4998
|
this.emit("end");
|
|
3198
4999
|
});
|
|
3199
5000
|
});
|
|
@@ -3474,7 +5275,7 @@ class Client extends EventEmitter {
|
|
|
3474
5275
|
this.hasExecuted = true;
|
|
3475
5276
|
const queryError = this.activeQuery.submit(this.connection);
|
|
3476
5277
|
if (queryError) {
|
|
3477
|
-
|
|
5278
|
+
browser$1.nextTick(() => {
|
|
3478
5279
|
this.activeQuery.handleError(queryError, this.connection);
|
|
3479
5280
|
this.readyForQuery = true;
|
|
3480
5281
|
this._pulseQueryQueue();
|
|
@@ -3513,7 +5314,7 @@ class Client extends EventEmitter {
|
|
|
3513
5314
|
queryCallback = query2.callback;
|
|
3514
5315
|
readTimeoutTimer = setTimeout(() => {
|
|
3515
5316
|
var error = new Error("Query read timeout");
|
|
3516
|
-
|
|
5317
|
+
browser$1.nextTick(() => {
|
|
3517
5318
|
query2.handleError(error, this.connection);
|
|
3518
5319
|
});
|
|
3519
5320
|
queryCallback(error);
|
|
@@ -3537,13 +5338,13 @@ class Client extends EventEmitter {
|
|
|
3537
5338
|
query2._result._types = this._types;
|
|
3538
5339
|
}
|
|
3539
5340
|
if (!this._queryable) {
|
|
3540
|
-
|
|
5341
|
+
browser$1.nextTick(() => {
|
|
3541
5342
|
query2.handleError(new Error("Client has encountered a connection error and is not queryable"), this.connection);
|
|
3542
5343
|
});
|
|
3543
5344
|
return result2;
|
|
3544
5345
|
}
|
|
3545
5346
|
if (this._ending) {
|
|
3546
|
-
|
|
5347
|
+
browser$1.nextTick(() => {
|
|
3547
5348
|
query2.handleError(new Error("Client was closed and is not queryable"), this.connection);
|
|
3548
5349
|
});
|
|
3549
5350
|
return result2;
|
|
@@ -3734,7 +5535,7 @@ function requirePgPool() {
|
|
|
3734
5535
|
const result2 = response.result;
|
|
3735
5536
|
if (this._isFull() || this._idle.length) {
|
|
3736
5537
|
if (this._idle.length) {
|
|
3737
|
-
|
|
5538
|
+
browser$1.nextTick(() => this._pulseQueue());
|
|
3738
5539
|
}
|
|
3739
5540
|
if (!this.options.connectionTimeoutMillis) {
|
|
3740
5541
|
this._pendingQueue.push(new PendingItem(response.callback));
|
|
@@ -4103,8 +5904,8 @@ function requireQuery() {
|
|
|
4103
5904
|
self2.callback(null, results);
|
|
4104
5905
|
}
|
|
4105
5906
|
};
|
|
4106
|
-
if (
|
|
4107
|
-
after =
|
|
5907
|
+
if (browser$1.domain) {
|
|
5908
|
+
after = browser$1.domain.bind(after);
|
|
4108
5909
|
}
|
|
4109
5910
|
if (this.name) {
|
|
4110
5911
|
if (this.name.length > 63) {
|
|
@@ -4180,7 +5981,7 @@ function requireClient() {
|
|
|
4180
5981
|
util2.inherits(Client2, EventEmitter2);
|
|
4181
5982
|
Client2.prototype._errorAllQueries = function(err) {
|
|
4182
5983
|
const enqueueError = (query2) => {
|
|
4183
|
-
|
|
5984
|
+
browser$1.nextTick(() => {
|
|
4184
5985
|
query2.native = this.native;
|
|
4185
5986
|
query2.handleError(err);
|
|
4186
5987
|
});
|
|
@@ -4195,7 +5996,7 @@ function requireClient() {
|
|
|
4195
5996
|
Client2.prototype._connect = function(cb) {
|
|
4196
5997
|
var self2 = this;
|
|
4197
5998
|
if (this._connecting) {
|
|
4198
|
-
|
|
5999
|
+
browser$1.nextTick(() => cb(new Error("Client has already been connected. You cannot reuse a client.")));
|
|
4199
6000
|
return;
|
|
4200
6001
|
}
|
|
4201
6002
|
this._connecting = true;
|
|
@@ -4270,7 +6071,7 @@ function requireClient() {
|
|
|
4270
6071
|
queryCallback = query2.callback;
|
|
4271
6072
|
readTimeoutTimer = setTimeout(() => {
|
|
4272
6073
|
var error = new Error("Query read timeout");
|
|
4273
|
-
|
|
6074
|
+
browser$1.nextTick(() => {
|
|
4274
6075
|
query2.handleError(error, this.connection);
|
|
4275
6076
|
});
|
|
4276
6077
|
queryCallback(error);
|
|
@@ -4289,14 +6090,14 @@ function requireClient() {
|
|
|
4289
6090
|
}
|
|
4290
6091
|
if (!this._queryable) {
|
|
4291
6092
|
query2.native = this.native;
|
|
4292
|
-
|
|
6093
|
+
browser$1.nextTick(() => {
|
|
4293
6094
|
query2.handleError(new Error("Client has encountered a connection error and is not queryable"));
|
|
4294
6095
|
});
|
|
4295
6096
|
return result2;
|
|
4296
6097
|
}
|
|
4297
6098
|
if (this._ending) {
|
|
4298
6099
|
query2.native = this.native;
|
|
4299
|
-
|
|
6100
|
+
browser$1.nextTick(() => {
|
|
4300
6101
|
query2.handleError(new Error("Client was closed and is not queryable"));
|
|
4301
6102
|
});
|
|
4302
6103
|
return result2;
|
|
@@ -4319,7 +6120,7 @@ function requireClient() {
|
|
|
4319
6120
|
}
|
|
4320
6121
|
this.native.end(function() {
|
|
4321
6122
|
self2._errorAllQueries(new Error("Connection terminated"));
|
|
4322
|
-
|
|
6123
|
+
browser$1.nextTick(() => {
|
|
4323
6124
|
self2.emit("end");
|
|
4324
6125
|
if (cb)
|
|
4325
6126
|
cb();
|
|
@@ -4409,7 +6210,7 @@ function requireLib$1() {
|
|
|
4409
6210
|
this.types = pgTypes;
|
|
4410
6211
|
this.DatabaseError = DatabaseError2;
|
|
4411
6212
|
};
|
|
4412
|
-
if (typeof
|
|
6213
|
+
if (typeof browser$1.env.NODE_PG_FORCE_NATIVE !== "undefined") {
|
|
4413
6214
|
module2.exports = new PG(requireNative());
|
|
4414
6215
|
} else {
|
|
4415
6216
|
module2.exports = new PG(Client2);
|
|
@@ -4842,7 +6643,7 @@ const config = {
|
|
|
4842
6643
|
keyStop: 0,
|
|
4843
6644
|
step: 0
|
|
4844
6645
|
};
|
|
4845
|
-
const
|
|
6646
|
+
const copy2 = {
|
|
4846
6647
|
arity: -3,
|
|
4847
6648
|
flags: [
|
|
4848
6649
|
"write",
|
|
@@ -7046,7 +8847,7 @@ const require$$0 = {
|
|
|
7046
8847
|
cluster: cluster$1,
|
|
7047
8848
|
command,
|
|
7048
8849
|
config,
|
|
7049
|
-
copy,
|
|
8850
|
+
copy: copy2,
|
|
7050
8851
|
dbsize,
|
|
7051
8852
|
debug: debug$8,
|
|
7052
8853
|
decr,
|
|
@@ -7681,7 +9482,7 @@ function requireModern() {
|
|
|
7681
9482
|
};
|
|
7682
9483
|
return modern;
|
|
7683
9484
|
}
|
|
7684
|
-
const Errors =
|
|
9485
|
+
const Errors = browser$1.version.charCodeAt(1) < 55 && browser$1.version.charCodeAt(2) === 46 ? requireOld() : requireModern();
|
|
7685
9486
|
var redisErrors = Errors;
|
|
7686
9487
|
const __dirname$1 = "/home/runner/work/stsdatamanagement/stsdatamanagement/node_modules/ioredis/built";
|
|
7687
9488
|
var Command$1 = {};
|
|
@@ -8623,12 +10424,12 @@ TLSProfiles$1.default = TLSProfiles;
|
|
|
8623
10424
|
return options2;
|
|
8624
10425
|
}
|
|
8625
10426
|
exports.resolveTLSProfile = resolveTLSProfile;
|
|
8626
|
-
function sample(array2,
|
|
10427
|
+
function sample(array2, from2 = 0) {
|
|
8627
10428
|
const length2 = array2.length;
|
|
8628
|
-
if (
|
|
10429
|
+
if (from2 >= length2) {
|
|
8629
10430
|
return null;
|
|
8630
10431
|
}
|
|
8631
|
-
return array2[
|
|
10432
|
+
return array2[from2 + Math.floor(Math.random() * (length2 - from2))];
|
|
8632
10433
|
}
|
|
8633
10434
|
exports.sample = sample;
|
|
8634
10435
|
function shuffle(array2) {
|
|
@@ -9047,11 +10848,11 @@ var autoPipelining = {};
|
|
|
9047
10848
|
client2._runningAutoPipelines.delete(slotKey);
|
|
9048
10849
|
if (err) {
|
|
9049
10850
|
for (let i = 0; i < callbacks.length; i++) {
|
|
9050
|
-
|
|
10851
|
+
browser$1.nextTick(callbacks[i], err);
|
|
9051
10852
|
}
|
|
9052
10853
|
} else {
|
|
9053
10854
|
for (let i = 0; i < callbacks.length; i++) {
|
|
9054
|
-
|
|
10855
|
+
browser$1.nextTick(callbacks[i], ...results[i]);
|
|
9055
10856
|
}
|
|
9056
10857
|
}
|
|
9057
10858
|
if (client2._autoPipelines.has(slotKey)) {
|
|
@@ -9394,18 +11195,18 @@ class Pipeline extends Commander_1.default {
|
|
|
9394
11195
|
if (commonError && retriable) {
|
|
9395
11196
|
const _this = this;
|
|
9396
11197
|
const errv = commonError.message.split(" ");
|
|
9397
|
-
const
|
|
11198
|
+
const queue2 = this._queue;
|
|
9398
11199
|
let inTransaction = false;
|
|
9399
11200
|
this._queue = [];
|
|
9400
|
-
for (let i = 0; i <
|
|
9401
|
-
if (errv[0] === "ASK" && !inTransaction &&
|
|
11201
|
+
for (let i = 0; i < queue2.length; ++i) {
|
|
11202
|
+
if (errv[0] === "ASK" && !inTransaction && queue2[i].name !== "asking" && (!queue2[i - 1] || queue2[i - 1].name !== "asking")) {
|
|
9402
11203
|
const asking2 = new Command_1$1.default("asking");
|
|
9403
11204
|
asking2.ignore = true;
|
|
9404
11205
|
this.sendCommand(asking2);
|
|
9405
11206
|
}
|
|
9406
|
-
|
|
9407
|
-
this.sendCommand(
|
|
9408
|
-
inTransaction =
|
|
11207
|
+
queue2[i].initPromise();
|
|
11208
|
+
this.sendCommand(queue2[i]);
|
|
11209
|
+
inTransaction = queue2[i].inTransaction;
|
|
9409
11210
|
}
|
|
9410
11211
|
let matched = true;
|
|
9411
11212
|
if (typeof this.leftRedirections === "undefined") {
|
|
@@ -10430,12 +12231,12 @@ class DelayQueue {
|
|
|
10430
12231
|
* @param options
|
|
10431
12232
|
*/
|
|
10432
12233
|
push(bucket, item, options2) {
|
|
10433
|
-
const callback = options2.callback ||
|
|
12234
|
+
const callback = options2.callback || browser$1.nextTick;
|
|
10434
12235
|
if (!this.queues[bucket]) {
|
|
10435
12236
|
this.queues[bucket] = new Deque();
|
|
10436
12237
|
}
|
|
10437
|
-
const
|
|
10438
|
-
|
|
12238
|
+
const queue2 = this.queues[bucket];
|
|
12239
|
+
queue2.push(item);
|
|
10439
12240
|
if (!this.timeouts[bucket]) {
|
|
10440
12241
|
this.timeouts[bucket] = setTimeout(() => {
|
|
10441
12242
|
callback(() => {
|
|
@@ -10446,18 +12247,18 @@ class DelayQueue {
|
|
|
10446
12247
|
}
|
|
10447
12248
|
}
|
|
10448
12249
|
execute(bucket) {
|
|
10449
|
-
const
|
|
10450
|
-
if (!
|
|
12250
|
+
const queue2 = this.queues[bucket];
|
|
12251
|
+
if (!queue2) {
|
|
10451
12252
|
return;
|
|
10452
12253
|
}
|
|
10453
|
-
const { length: length2 } =
|
|
12254
|
+
const { length: length2 } = queue2;
|
|
10454
12255
|
if (!length2) {
|
|
10455
12256
|
return;
|
|
10456
12257
|
}
|
|
10457
12258
|
debug$6("send %d commands in %s queue", length2, bucket);
|
|
10458
12259
|
this.queues[bucket] = null;
|
|
10459
|
-
while (
|
|
10460
|
-
|
|
12260
|
+
while (queue2.length > 0) {
|
|
12261
|
+
queue2.shift()();
|
|
10461
12262
|
}
|
|
10462
12263
|
}
|
|
10463
12264
|
}
|
|
@@ -10719,7 +12520,7 @@ function requireCluster() {
|
|
|
10719
12520
|
refreshSlotsCache(callback) {
|
|
10720
12521
|
if (this.isRefreshing) {
|
|
10721
12522
|
if (callback) {
|
|
10722
|
-
|
|
12523
|
+
browser$1.nextTick(callback);
|
|
10723
12524
|
}
|
|
10724
12525
|
return;
|
|
10725
12526
|
}
|
|
@@ -10978,7 +12779,7 @@ function requireCluster() {
|
|
|
10978
12779
|
setStatus(status) {
|
|
10979
12780
|
debug2("status: %s -> %s", this.status || "[empty]", status);
|
|
10980
12781
|
this.status = status;
|
|
10981
|
-
|
|
12782
|
+
browser$1.nextTick(() => {
|
|
10982
12783
|
this.emit(status);
|
|
10983
12784
|
});
|
|
10984
12785
|
}
|
|
@@ -11102,7 +12903,7 @@ function requireCluster() {
|
|
|
11102
12903
|
}
|
|
11103
12904
|
invokeReadyDelayedCallbacks(err) {
|
|
11104
12905
|
for (const c of this._readyDelayedCallbacks) {
|
|
11105
|
-
|
|
12906
|
+
browser$1.nextTick(c, err);
|
|
11106
12907
|
}
|
|
11107
12908
|
this._readyDelayedCallbacks = [];
|
|
11108
12909
|
}
|
|
@@ -11276,7 +13077,7 @@ class StandaloneConnector extends AbstractConnector_1.default {
|
|
|
11276
13077
|
Object.assign(connectionOptions, options2.tls);
|
|
11277
13078
|
}
|
|
11278
13079
|
return new Promise((resolve, reject) => {
|
|
11279
|
-
|
|
13080
|
+
browser$1.nextTick(() => {
|
|
11280
13081
|
if (!this.connecting) {
|
|
11281
13082
|
reject(new Error(utils_1$2.CONNECTION_CLOSED_ERROR_MSG));
|
|
11282
13083
|
return;
|
|
@@ -12766,13 +14567,13 @@ function requireRedis() {
|
|
|
12766
14567
|
} else if (stream.destroyed) {
|
|
12767
14568
|
const firstError = _this.connector.firstError;
|
|
12768
14569
|
if (firstError) {
|
|
12769
|
-
|
|
14570
|
+
browser$1.nextTick(() => {
|
|
12770
14571
|
eventHandler.errorHandler(_this)(firstError);
|
|
12771
14572
|
});
|
|
12772
14573
|
}
|
|
12773
|
-
|
|
14574
|
+
browser$1.nextTick(eventHandler.closeHandler(_this));
|
|
12774
14575
|
} else {
|
|
12775
|
-
|
|
14576
|
+
browser$1.nextTick(eventHandler.connectHandler(_this));
|
|
12776
14577
|
}
|
|
12777
14578
|
if (!stream.destroyed) {
|
|
12778
14579
|
stream.once("error", eventHandler.errorHandler(_this));
|
|
@@ -13128,7 +14929,7 @@ function requireRedis() {
|
|
|
13128
14929
|
debug2("status[%s]: %s -> %s", this._getDescription(), this.status || "[empty]", status);
|
|
13129
14930
|
}
|
|
13130
14931
|
this.status = status;
|
|
13131
|
-
|
|
14932
|
+
browser$1.nextTick(this.emit.bind(this, status, arg));
|
|
13132
14933
|
}
|
|
13133
14934
|
createScanStream(command2, { key, options: options2 = {} }) {
|
|
13134
14935
|
return new ScanStream_1.default({
|
|
@@ -13299,12 +15100,12 @@ OffsetBuffer.prototype.toChunks = function toChunks() {
|
|
|
13299
15100
|
this.offset = 0;
|
|
13300
15101
|
}
|
|
13301
15102
|
var chunks = [];
|
|
13302
|
-
var
|
|
13303
|
-
for (var i = 0;
|
|
15103
|
+
var off2 = 0;
|
|
15104
|
+
for (var i = 0; off2 <= this.size && i < this.buffers.length; i++) {
|
|
13304
15105
|
var buf = this.buffers[i];
|
|
13305
|
-
|
|
13306
|
-
if (
|
|
13307
|
-
buf = buf.slice(0, buf.length - (
|
|
15106
|
+
off2 += buf.length;
|
|
15107
|
+
if (off2 > this.size) {
|
|
15108
|
+
buf = buf.slice(0, buf.length - (off2 - this.size));
|
|
13308
15109
|
this.buffers[i] = buf;
|
|
13309
15110
|
}
|
|
13310
15111
|
chunks.push(buf);
|
|
@@ -13313,14 +15114,14 @@ OffsetBuffer.prototype.toChunks = function toChunks() {
|
|
|
13313
15114
|
this.buffers.length = i;
|
|
13314
15115
|
return chunks;
|
|
13315
15116
|
};
|
|
13316
|
-
OffsetBuffer.prototype.toString = function
|
|
15117
|
+
OffsetBuffer.prototype.toString = function toString3(enc) {
|
|
13317
15118
|
return this.toChunks().map(function(c) {
|
|
13318
15119
|
return c.toString(enc);
|
|
13319
15120
|
}).join("");
|
|
13320
15121
|
};
|
|
13321
|
-
OffsetBuffer.prototype.use = function use(buf,
|
|
15122
|
+
OffsetBuffer.prototype.use = function use(buf, off2, n) {
|
|
13322
15123
|
this.buffers = [buf];
|
|
13323
|
-
this.offset =
|
|
15124
|
+
this.offset = off2;
|
|
13324
15125
|
this.size = n;
|
|
13325
15126
|
};
|
|
13326
15127
|
OffsetBuffer.prototype.push = function push3(data) {
|
|
@@ -13352,10 +15153,10 @@ OffsetBuffer.prototype.skip = function skip(n) {
|
|
|
13352
15153
|
}
|
|
13353
15154
|
this.buffers = this.buffers.slice(shift2);
|
|
13354
15155
|
};
|
|
13355
|
-
OffsetBuffer.prototype.copy = function
|
|
15156
|
+
OffsetBuffer.prototype.copy = function copy3(target, targetOff, off2, n) {
|
|
13356
15157
|
if (this.size === 0)
|
|
13357
15158
|
return;
|
|
13358
|
-
if (
|
|
15159
|
+
if (off2 !== 0)
|
|
13359
15160
|
throw new Error("Unsupported offset in .copy()");
|
|
13360
15161
|
var toff = targetOff;
|
|
13361
15162
|
var first = this.buffers[0];
|
|
@@ -13411,7 +15212,7 @@ OffsetBuffer.prototype.take = function take(n) {
|
|
|
13411
15212
|
OffsetBuffer.prototype.peekUInt8 = function peekUInt8() {
|
|
13412
15213
|
return this.buffers[0][this.offset];
|
|
13413
15214
|
};
|
|
13414
|
-
OffsetBuffer.prototype.readUInt8 = function
|
|
15215
|
+
OffsetBuffer.prototype.readUInt8 = function readUInt82() {
|
|
13415
15216
|
this.size -= 1;
|
|
13416
15217
|
var first = this.buffers[0];
|
|
13417
15218
|
var r = first[this.offset];
|
|
@@ -13421,7 +15222,7 @@ OffsetBuffer.prototype.readUInt8 = function readUInt8() {
|
|
|
13421
15222
|
}
|
|
13422
15223
|
return r;
|
|
13423
15224
|
};
|
|
13424
|
-
OffsetBuffer.prototype.readUInt16LE = function
|
|
15225
|
+
OffsetBuffer.prototype.readUInt16LE = function readUInt16LE2() {
|
|
13425
15226
|
var first = this.buffers[0];
|
|
13426
15227
|
this.size -= 2;
|
|
13427
15228
|
var r;
|
|
@@ -13473,7 +15274,7 @@ OffsetBuffer.prototype.readUInt24LE = function readUInt24LE() {
|
|
|
13473
15274
|
this.buffers = this.buffers.slice(shift2);
|
|
13474
15275
|
return r;
|
|
13475
15276
|
};
|
|
13476
|
-
OffsetBuffer.prototype.readUInt32LE = function
|
|
15277
|
+
OffsetBuffer.prototype.readUInt32LE = function readUInt32LE2() {
|
|
13477
15278
|
var first = this.buffers[0];
|
|
13478
15279
|
var r;
|
|
13479
15280
|
var shift2;
|
|
@@ -13510,7 +15311,7 @@ OffsetBuffer.prototype.readUInt32LE = function readUInt32LE() {
|
|
|
13510
15311
|
this.buffers = this.buffers.slice(shift2);
|
|
13511
15312
|
return r;
|
|
13512
15313
|
};
|
|
13513
|
-
OffsetBuffer.prototype.readUInt16BE = function
|
|
15314
|
+
OffsetBuffer.prototype.readUInt16BE = function readUInt16BE2() {
|
|
13514
15315
|
var r = this.readUInt16LE();
|
|
13515
15316
|
return (r & 255) << 8 | r >> 8;
|
|
13516
15317
|
};
|
|
@@ -13518,7 +15319,7 @@ OffsetBuffer.prototype.readUInt24BE = function readUInt24BE() {
|
|
|
13518
15319
|
var r = this.readUInt24LE();
|
|
13519
15320
|
return (r & 255) << 16 | (r >> 8 & 255) << 8 | r >> 16;
|
|
13520
15321
|
};
|
|
13521
|
-
OffsetBuffer.prototype.readUInt32BE = function
|
|
15322
|
+
OffsetBuffer.prototype.readUInt32BE = function readUInt32BE2() {
|
|
13522
15323
|
var r = this.readUInt32LE();
|
|
13523
15324
|
return ((r & 255) << 24 | (r >>> 8 & 255) << 16 | (r >>> 16 & 255) << 8 | r >>> 24) >>> 0;
|
|
13524
15325
|
};
|
|
@@ -13531,7 +15332,7 @@ function signedInt8(num) {
|
|
|
13531
15332
|
OffsetBuffer.prototype.peekInt8 = function peekInt8() {
|
|
13532
15333
|
return signedInt8(this.peekUInt8());
|
|
13533
15334
|
};
|
|
13534
|
-
OffsetBuffer.prototype.readInt8 = function
|
|
15335
|
+
OffsetBuffer.prototype.readInt8 = function readInt83() {
|
|
13535
15336
|
return signedInt8(this.readUInt8());
|
|
13536
15337
|
};
|
|
13537
15338
|
function signedInt16(num) {
|
|
@@ -13540,10 +15341,10 @@ function signedInt16(num) {
|
|
|
13540
15341
|
else
|
|
13541
15342
|
return num;
|
|
13542
15343
|
}
|
|
13543
|
-
OffsetBuffer.prototype.readInt16BE = function
|
|
15344
|
+
OffsetBuffer.prototype.readInt16BE = function readInt16BE2() {
|
|
13544
15345
|
return signedInt16(this.readUInt16BE());
|
|
13545
15346
|
};
|
|
13546
|
-
OffsetBuffer.prototype.readInt16LE = function
|
|
15347
|
+
OffsetBuffer.prototype.readInt16LE = function readInt16LE2() {
|
|
13547
15348
|
return signedInt16(this.readUInt16LE());
|
|
13548
15349
|
};
|
|
13549
15350
|
function signedInt24(num) {
|
|
@@ -13564,10 +15365,10 @@ function signedInt32(num) {
|
|
|
13564
15365
|
else
|
|
13565
15366
|
return num;
|
|
13566
15367
|
}
|
|
13567
|
-
OffsetBuffer.prototype.readInt32BE = function
|
|
15368
|
+
OffsetBuffer.prototype.readInt32BE = function readInt32BE2() {
|
|
13568
15369
|
return signedInt32(this.readUInt32BE());
|
|
13569
15370
|
};
|
|
13570
|
-
OffsetBuffer.prototype.readInt32LE = function
|
|
15371
|
+
OffsetBuffer.prototype.readInt32LE = function readInt32LE2() {
|
|
13571
15372
|
return signedInt32(this.readUInt32LE());
|
|
13572
15373
|
};
|
|
13573
15374
|
var messageFormats = {
|
|
@@ -13645,7 +15446,7 @@ let CopyStreamQuery$2 = class CopyStreamQuery extends Readable {
|
|
|
13645
15446
|
connectionStream.removeListener("readable", this._onReadableEvent);
|
|
13646
15447
|
connectionStream.addListener("data", this._pgDataHandler);
|
|
13647
15448
|
this._pgDataHandler(unreadBuffer);
|
|
13648
|
-
|
|
15449
|
+
browser$1.nextTick(function() {
|
|
13649
15450
|
connectionStream.resume();
|
|
13650
15451
|
});
|
|
13651
15452
|
}
|
|
@@ -13924,7 +15725,7 @@ class CopyStreamQuery3 extends Duplex {
|
|
|
13924
15725
|
connectionStream.removeListener("readable", this._onReadableEvent);
|
|
13925
15726
|
connectionStream.addListener("data", this._pgDataHandler);
|
|
13926
15727
|
this._pgDataHandler(unreadBuffer);
|
|
13927
|
-
|
|
15728
|
+
browser$1.nextTick(function() {
|
|
13928
15729
|
connectionStream.resume();
|
|
13929
15730
|
});
|
|
13930
15731
|
}
|
|
@@ -14733,7 +16534,7 @@ class PGAccessLayer {
|
|
|
14733
16534
|
resolve("Completed");
|
|
14734
16535
|
};
|
|
14735
16536
|
const stream = client2.query(copyFrom2("COPY stsresource (resname,resdesc,vnum,validfrom,dbaction,dbactionuser) FROM STDIN"));
|
|
14736
|
-
const rs = new
|
|
16537
|
+
const rs = new (void 0)();
|
|
14737
16538
|
let currentIndex = 0;
|
|
14738
16539
|
rs._read = function() {
|
|
14739
16540
|
if (currentIndex === fakerdata.length) {
|
|
@@ -14900,7 +16701,7 @@ function requireKleur() {
|
|
|
14900
16701
|
if (hasRequiredKleur)
|
|
14901
16702
|
return kleur;
|
|
14902
16703
|
hasRequiredKleur = 1;
|
|
14903
|
-
const { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } =
|
|
16704
|
+
const { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = browser$1.env;
|
|
14904
16705
|
const $ = {
|
|
14905
16706
|
enabled: !NODE_DISABLE_COLORS && TERM !== "dumb" && FORCE_COLOR !== "0",
|
|
14906
16707
|
// modifiers
|
|
@@ -15250,7 +17051,7 @@ function requireFigures$1() {
|
|
|
15250
17051
|
line: "─",
|
|
15251
17052
|
pointer: ">"
|
|
15252
17053
|
};
|
|
15253
|
-
const figures =
|
|
17054
|
+
const figures = browser$1.platform === "win32" ? win : main;
|
|
15254
17055
|
figures_1$1 = figures;
|
|
15255
17056
|
return figures_1$1;
|
|
15256
17057
|
}
|
|
@@ -15386,8 +17187,8 @@ function requirePrompt$1() {
|
|
|
15386
17187
|
constructor(opts = {}) {
|
|
15387
17188
|
super();
|
|
15388
17189
|
this.firstRender = true;
|
|
15389
|
-
this.in = opts.stdin ||
|
|
15390
|
-
this.out = opts.stdout ||
|
|
17190
|
+
this.in = opts.stdin || browser$1.stdin;
|
|
17191
|
+
this.out = opts.stdout || browser$1.stdout;
|
|
15391
17192
|
this.onRender = (opts.onRender || (() => void 0)).bind(this);
|
|
15392
17193
|
const rl = readline.createInterface({
|
|
15393
17194
|
input: this.in,
|
|
@@ -15771,7 +17572,7 @@ function requireSelect$1() {
|
|
|
15771
17572
|
if (!this.done) {
|
|
15772
17573
|
this.outputText += "\n";
|
|
15773
17574
|
for (let i = startIndex; i < endIndex; i++) {
|
|
15774
|
-
let
|
|
17575
|
+
let title2, prefix, desc = "", v = this.choices[i];
|
|
15775
17576
|
if (i === startIndex && startIndex > 0) {
|
|
15776
17577
|
prefix = figures.arrowUp;
|
|
15777
17578
|
} else if (i === endIndex - 1 && endIndex < this.choices.length) {
|
|
@@ -15780,14 +17581,14 @@ function requireSelect$1() {
|
|
|
15780
17581
|
prefix = " ";
|
|
15781
17582
|
}
|
|
15782
17583
|
if (v.disabled) {
|
|
15783
|
-
|
|
17584
|
+
title2 = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
|
|
15784
17585
|
prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + " " : " ") + prefix;
|
|
15785
17586
|
} else {
|
|
15786
|
-
|
|
17587
|
+
title2 = this.cursor === i ? color.cyan().underline(v.title) : v.title;
|
|
15787
17588
|
prefix = (this.cursor === i ? color.cyan(figures.pointer) + " " : " ") + prefix;
|
|
15788
17589
|
if (v.description && this.cursor === i) {
|
|
15789
17590
|
desc = ` - ${v.description}`;
|
|
15790
|
-
if (prefix.length +
|
|
17591
|
+
if (prefix.length + title2.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
|
|
15791
17592
|
desc = "\n" + wrap2(v.description, {
|
|
15792
17593
|
margin: 3,
|
|
15793
17594
|
width: this.out.columns
|
|
@@ -15795,7 +17596,7 @@ function requireSelect$1() {
|
|
|
15795
17596
|
}
|
|
15796
17597
|
}
|
|
15797
17598
|
}
|
|
15798
|
-
this.outputText += `${prefix} ${
|
|
17599
|
+
this.outputText += `${prefix} ${title2}${color.gray(desc)}
|
|
15799
17600
|
`;
|
|
15800
17601
|
}
|
|
15801
17602
|
}
|
|
@@ -16793,14 +18594,14 @@ Instructions:
|
|
|
16793
18594
|
}
|
|
16794
18595
|
renderOption(cursor2, v, i, arrowIndicator) {
|
|
16795
18596
|
const prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + arrowIndicator + " ";
|
|
16796
|
-
let
|
|
18597
|
+
let title2, desc;
|
|
16797
18598
|
if (v.disabled) {
|
|
16798
|
-
|
|
18599
|
+
title2 = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
|
|
16799
18600
|
} else {
|
|
16800
|
-
|
|
18601
|
+
title2 = cursor2 === i ? color.cyan().underline(v.title) : v.title;
|
|
16801
18602
|
if (cursor2 === i && v.description) {
|
|
16802
18603
|
desc = ` - ${v.description}`;
|
|
16803
|
-
if (prefix.length +
|
|
18604
|
+
if (prefix.length + title2.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
|
|
16804
18605
|
desc = "\n" + wrap2(v.description, {
|
|
16805
18606
|
margin: prefix.length,
|
|
16806
18607
|
width: this.out.columns
|
|
@@ -16808,7 +18609,7 @@ Instructions:
|
|
|
16808
18609
|
}
|
|
16809
18610
|
}
|
|
16810
18611
|
}
|
|
16811
|
-
return prefix +
|
|
18612
|
+
return prefix + title2 + color.gray(desc || "");
|
|
16812
18613
|
}
|
|
16813
18614
|
// shared with autocompleteMultiselect
|
|
16814
18615
|
paginateOptions(options2) {
|
|
@@ -17093,18 +18894,18 @@ function requireAutocomplete$1() {
|
|
|
17093
18894
|
renderOption(v, hovered, isStart, isEnd) {
|
|
17094
18895
|
let desc;
|
|
17095
18896
|
let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : " ";
|
|
17096
|
-
let
|
|
18897
|
+
let title2 = hovered ? color.cyan().underline(v.title) : v.title;
|
|
17097
18898
|
prefix = (hovered ? color.cyan(figures.pointer) + " " : " ") + prefix;
|
|
17098
18899
|
if (v.description) {
|
|
17099
18900
|
desc = ` - ${v.description}`;
|
|
17100
|
-
if (prefix.length +
|
|
18901
|
+
if (prefix.length + title2.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
|
|
17101
18902
|
desc = "\n" + wrap2(v.description, {
|
|
17102
18903
|
margin: 3,
|
|
17103
18904
|
width: this.out.columns
|
|
17104
18905
|
});
|
|
17105
18906
|
}
|
|
17106
18907
|
}
|
|
17107
|
-
return prefix + " " +
|
|
18908
|
+
return prefix + " " + title2 + color.gray(desc || "");
|
|
17108
18909
|
}
|
|
17109
18910
|
render() {
|
|
17110
18911
|
if (this.closed)
|
|
@@ -17252,12 +19053,12 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
|
|
|
17252
19053
|
`;
|
|
17253
19054
|
}
|
|
17254
19055
|
renderOption(cursor2, v, i) {
|
|
17255
|
-
let
|
|
19056
|
+
let title2;
|
|
17256
19057
|
if (v.disabled)
|
|
17257
|
-
|
|
19058
|
+
title2 = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
|
|
17258
19059
|
else
|
|
17259
|
-
|
|
17260
|
-
return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " +
|
|
19060
|
+
title2 = cursor2 === i ? color.cyan().underline(v.title) : v.title;
|
|
19061
|
+
return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + title2;
|
|
17261
19062
|
}
|
|
17262
19063
|
renderDoneOrInstructions() {
|
|
17263
19064
|
if (this.done) {
|
|
@@ -17813,7 +19614,7 @@ function requireFigures() {
|
|
|
17813
19614
|
line: "─",
|
|
17814
19615
|
pointer: ">"
|
|
17815
19616
|
};
|
|
17816
|
-
const figures =
|
|
19617
|
+
const figures = browser$1.platform === "win32" ? win : main;
|
|
17817
19618
|
figures_1 = figures;
|
|
17818
19619
|
return figures_1;
|
|
17819
19620
|
}
|
|
@@ -17934,8 +19735,8 @@ function requirePrompt() {
|
|
|
17934
19735
|
constructor(opts = {}) {
|
|
17935
19736
|
super();
|
|
17936
19737
|
this.firstRender = true;
|
|
17937
|
-
this.in = opts.stdin ||
|
|
17938
|
-
this.out = opts.stdout ||
|
|
19738
|
+
this.in = opts.stdin || browser$1.stdin;
|
|
19739
|
+
this.out = opts.stdout || browser$1.stdout;
|
|
17939
19740
|
this.onRender = (opts.onRender || (() => void 0)).bind(this);
|
|
17940
19741
|
const rl = readline.createInterface({ input: this.in, escapeCodeTimeout: 50 });
|
|
17941
19742
|
readline.emitKeypressEvents(this.in, rl);
|
|
@@ -18288,7 +20089,7 @@ function requireSelect() {
|
|
|
18288
20089
|
if (!this.done) {
|
|
18289
20090
|
this.outputText += "\n";
|
|
18290
20091
|
for (let i = startIndex; i < endIndex; i++) {
|
|
18291
|
-
let
|
|
20092
|
+
let title2, prefix, desc = "", v = this.choices[i];
|
|
18292
20093
|
if (i === startIndex && startIndex > 0) {
|
|
18293
20094
|
prefix = figures.arrowUp;
|
|
18294
20095
|
} else if (i === endIndex - 1 && endIndex < this.choices.length) {
|
|
@@ -18297,19 +20098,19 @@ function requireSelect() {
|
|
|
18297
20098
|
prefix = " ";
|
|
18298
20099
|
}
|
|
18299
20100
|
if (v.disabled) {
|
|
18300
|
-
|
|
20101
|
+
title2 = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
|
|
18301
20102
|
prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + " " : " ") + prefix;
|
|
18302
20103
|
} else {
|
|
18303
|
-
|
|
20104
|
+
title2 = this.cursor === i ? color.cyan().underline(v.title) : v.title;
|
|
18304
20105
|
prefix = (this.cursor === i ? color.cyan(figures.pointer) + " " : " ") + prefix;
|
|
18305
20106
|
if (v.description && this.cursor === i) {
|
|
18306
20107
|
desc = ` - ${v.description}`;
|
|
18307
|
-
if (prefix.length +
|
|
20108
|
+
if (prefix.length + title2.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
|
|
18308
20109
|
desc = "\n" + wrap2(v.description, { margin: 3, width: this.out.columns });
|
|
18309
20110
|
}
|
|
18310
20111
|
}
|
|
18311
20112
|
}
|
|
18312
|
-
this.outputText += `${prefix} ${
|
|
20113
|
+
this.outputText += `${prefix} ${title2}${color.gray(desc)}
|
|
18313
20114
|
`;
|
|
18314
20115
|
}
|
|
18315
20116
|
}
|
|
@@ -19242,19 +21043,19 @@ Instructions:
|
|
|
19242
21043
|
}
|
|
19243
21044
|
renderOption(cursor2, v, i, arrowIndicator) {
|
|
19244
21045
|
const prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + arrowIndicator + " ";
|
|
19245
|
-
let
|
|
21046
|
+
let title2, desc;
|
|
19246
21047
|
if (v.disabled) {
|
|
19247
|
-
|
|
21048
|
+
title2 = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
|
|
19248
21049
|
} else {
|
|
19249
|
-
|
|
21050
|
+
title2 = cursor2 === i ? color.cyan().underline(v.title) : v.title;
|
|
19250
21051
|
if (cursor2 === i && v.description) {
|
|
19251
21052
|
desc = ` - ${v.description}`;
|
|
19252
|
-
if (prefix.length +
|
|
21053
|
+
if (prefix.length + title2.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
|
|
19253
21054
|
desc = "\n" + wrap2(v.description, { margin: prefix.length, width: this.out.columns });
|
|
19254
21055
|
}
|
|
19255
21056
|
}
|
|
19256
21057
|
}
|
|
19257
|
-
return prefix +
|
|
21058
|
+
return prefix + title2 + color.gray(desc || "");
|
|
19258
21059
|
}
|
|
19259
21060
|
// shared with autocompleteMultiselect
|
|
19260
21061
|
paginateOptions(options2) {
|
|
@@ -19502,15 +21303,15 @@ function requireAutocomplete() {
|
|
|
19502
21303
|
renderOption(v, hovered, isStart, isEnd) {
|
|
19503
21304
|
let desc;
|
|
19504
21305
|
let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : " ";
|
|
19505
|
-
let
|
|
21306
|
+
let title2 = hovered ? color.cyan().underline(v.title) : v.title;
|
|
19506
21307
|
prefix = (hovered ? color.cyan(figures.pointer) + " " : " ") + prefix;
|
|
19507
21308
|
if (v.description) {
|
|
19508
21309
|
desc = ` - ${v.description}`;
|
|
19509
|
-
if (prefix.length +
|
|
21310
|
+
if (prefix.length + title2.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {
|
|
19510
21311
|
desc = "\n" + wrap2(v.description, { margin: 3, width: this.out.columns });
|
|
19511
21312
|
}
|
|
19512
21313
|
}
|
|
19513
|
-
return prefix + " " +
|
|
21314
|
+
return prefix + " " + title2 + color.gray(desc || "");
|
|
19514
21315
|
}
|
|
19515
21316
|
render() {
|
|
19516
21317
|
if (this.closed)
|
|
@@ -19668,12 +21469,12 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
|
|
|
19668
21469
|
`;
|
|
19669
21470
|
}
|
|
19670
21471
|
renderOption(cursor2, v, i) {
|
|
19671
|
-
let
|
|
21472
|
+
let title2;
|
|
19672
21473
|
if (v.disabled)
|
|
19673
|
-
|
|
21474
|
+
title2 = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
|
|
19674
21475
|
else
|
|
19675
|
-
|
|
19676
|
-
return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " +
|
|
21476
|
+
title2 = cursor2 === i ? color.cyan().underline(v.title) : v.title;
|
|
21477
|
+
return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + title2;
|
|
19677
21478
|
}
|
|
19678
21479
|
renderDoneOrInstructions() {
|
|
19679
21480
|
if (this.done) {
|
|
@@ -19953,7 +21754,7 @@ function requireLib() {
|
|
|
19953
21754
|
}
|
|
19954
21755
|
function isNodeLT(tar) {
|
|
19955
21756
|
tar = (Array.isArray(tar) ? tar : tar.split(".")).map(Number);
|
|
19956
|
-
let i = 0, src2 =
|
|
21757
|
+
let i = 0, src2 = browser$1.versions.node.split(".").map(Number);
|
|
19957
21758
|
for (; i < tar.length; i++) {
|
|
19958
21759
|
if (src2[i] > tar[i])
|
|
19959
21760
|
return false;
|
|
@@ -19963,8 +21764,6 @@ function isNodeLT(tar) {
|
|
|
19963
21764
|
return false;
|
|
19964
21765
|
}
|
|
19965
21766
|
var prompts = isNodeLT("8.6.0") ? requireDist() : requireLib();
|
|
19966
|
-
const global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
19967
|
-
const __dirname = "/home/runner/work/stsdatamanagement/stsdatamanagement/src";
|
|
19968
21767
|
class ETA {
|
|
19969
21768
|
constructor(length2, initTime, initValue) {
|
|
19970
21769
|
this.etaBufferLength = length2 || 100;
|
|
@@ -20298,7 +22097,7 @@ var options = {
|
|
|
20298
22097
|
const options2 = {};
|
|
20299
22098
|
const opt = Object.assign({}, preset, rawOptions);
|
|
20300
22099
|
options2.throttleTime = 1e3 / mergeOption(opt.fps, 10);
|
|
20301
|
-
options2.stream = mergeOption(opt.stream,
|
|
22100
|
+
options2.stream = mergeOption(opt.stream, browser$1.stderr);
|
|
20302
22101
|
options2.terminal = mergeOption(opt.terminal, null);
|
|
20303
22102
|
options2.clearOnComplete = mergeOption(opt.clearOnComplete, false);
|
|
20304
22103
|
options2.stopOnComplete = mergeOption(opt.stopOnComplete, false);
|
|
@@ -20494,8 +22293,8 @@ var singleBar = class SingleBar extends _GenericBar {
|
|
|
20494
22293
|
}
|
|
20495
22294
|
if (this.sigintCallback === null && this.options.gracefulExit) {
|
|
20496
22295
|
this.sigintCallback = this.stop.bind(this);
|
|
20497
|
-
|
|
20498
|
-
|
|
22296
|
+
browser$1.once("SIGINT", this.sigintCallback);
|
|
22297
|
+
browser$1.once("SIGTERM", this.sigintCallback);
|
|
20499
22298
|
}
|
|
20500
22299
|
this.terminal.cursorSave();
|
|
20501
22300
|
if (this.options.hideCursor === true) {
|
|
@@ -20513,8 +22312,8 @@ var singleBar = class SingleBar extends _GenericBar {
|
|
|
20513
22312
|
return;
|
|
20514
22313
|
}
|
|
20515
22314
|
if (this.sigintCallback) {
|
|
20516
|
-
|
|
20517
|
-
|
|
22315
|
+
browser$1.removeListener("SIGINT", this.sigintCallback);
|
|
22316
|
+
browser$1.removeListener("SIGTERM", this.sigintCallback);
|
|
20518
22317
|
this.sigintCallback = null;
|
|
20519
22318
|
}
|
|
20520
22319
|
this.render();
|
|
@@ -20572,8 +22371,8 @@ var multiBar = class MultiBar extends _EventEmitter {
|
|
|
20572
22371
|
}
|
|
20573
22372
|
if (this.sigintCallback === null && this.options.gracefulExit) {
|
|
20574
22373
|
this.sigintCallback = this.stop.bind(this);
|
|
20575
|
-
|
|
20576
|
-
|
|
22374
|
+
browser$1.once("SIGINT", this.sigintCallback);
|
|
22375
|
+
browser$1.once("SIGTERM", this.sigintCallback);
|
|
20577
22376
|
}
|
|
20578
22377
|
if (!this.isActive) {
|
|
20579
22378
|
if (this.options.hideCursor === true) {
|
|
@@ -20637,8 +22436,8 @@ var multiBar = class MultiBar extends _EventEmitter {
|
|
|
20637
22436
|
clearTimeout(this.timer);
|
|
20638
22437
|
this.timer = null;
|
|
20639
22438
|
if (this.sigintCallback) {
|
|
20640
|
-
|
|
20641
|
-
|
|
22439
|
+
browser$1.removeListener("SIGINT", this.sigintCallback);
|
|
22440
|
+
browser$1.removeListener("SIGTERM", this.sigintCallback);
|
|
20642
22441
|
this.sigintCallback = null;
|
|
20643
22442
|
}
|
|
20644
22443
|
this.isActive = false;
|
|
@@ -20785,7 +22584,7 @@ class CliWorker {
|
|
|
20785
22584
|
}
|
|
20786
22585
|
_options3 = new WeakMap();
|
|
20787
22586
|
const goptions = $Options();
|
|
20788
|
-
global
|
|
22587
|
+
global.appRoot = require$$0$4.resolve(__dirname);
|
|
20789
22588
|
const userid = "dbinitrunner";
|
|
20790
22589
|
const resrandomuserprefix = "RESRU-";
|
|
20791
22590
|
const debug$1 = Debug(`proc:${process.pid}:DataGenerator`);
|