@dpuse/dpuse-tool-adaltas-csv-parser 0.0.158 → 0.0.160
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/README.md +106 -49
- package/dist/dpuse-tool-adaltas-csv-parser.es.js +1003 -648
- package/dist/dpuse-tool-adaltas-csv-parser.es.js.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/package.json +17 -22
- package/dist/types/eslint.config.d.ts +0 -3
- package/dist/types/vite.config.d.ts +0 -2
- package/dist/types/vitest.config.d.ts +0 -2
|
@@ -65,7 +65,7 @@ _.poolSize = 8192, _._augment = function(e) {
|
|
|
65
65
|
};
|
|
66
66
|
function v(e, t, n, r) {
|
|
67
67
|
if (typeof t == "number") throw TypeError("\"value\" argument must not be a number");
|
|
68
|
-
return typeof ArrayBuffer < "u" && t instanceof ArrayBuffer ?
|
|
68
|
+
return typeof ArrayBuffer < "u" && t instanceof ArrayBuffer ? ne(e, t, n, r) : typeof t == "string" ? ee(e, t, n) : re(e, t);
|
|
69
69
|
}
|
|
70
70
|
_.from = function(e, t, n) {
|
|
71
71
|
return v(null, e, t, n);
|
|
@@ -81,7 +81,7 @@ _.alloc = function(e, t, n) {
|
|
|
81
81
|
return b(null, e, t, n);
|
|
82
82
|
};
|
|
83
83
|
function x(e, t) {
|
|
84
|
-
if (y(t), e = g(e, t < 0 ? 0 :
|
|
84
|
+
if (y(t), e = g(e, t < 0 ? 0 : ie(t) | 0), !_.TYPED_ARRAY_SUPPORT) for (var n = 0; n < t; ++n) e[n] = 0;
|
|
85
85
|
return e;
|
|
86
86
|
}
|
|
87
87
|
_.allocUnsafe = function(e) {
|
|
@@ -91,43 +91,43 @@ _.allocUnsafe = function(e) {
|
|
|
91
91
|
};
|
|
92
92
|
function ee(e, t, n) {
|
|
93
93
|
if ((typeof n != "string" || n === "") && (n = "utf8"), !_.isEncoding(n)) throw TypeError("\"encoding\" must be a valid string encoding");
|
|
94
|
-
var r =
|
|
94
|
+
var r = C(t, n) | 0;
|
|
95
95
|
e = g(e, r);
|
|
96
96
|
var i = e.write(t, n);
|
|
97
97
|
return i !== r && (e = e.slice(0, i)), e;
|
|
98
98
|
}
|
|
99
99
|
function te(e, t) {
|
|
100
|
-
var n = t.length < 0 ? 0 :
|
|
100
|
+
var n = t.length < 0 ? 0 : ie(t.length) | 0;
|
|
101
101
|
e = g(e, n);
|
|
102
102
|
for (var r = 0; r < n; r += 1) e[r] = t[r] & 255;
|
|
103
103
|
return e;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function ne(e, t, n, r) {
|
|
106
106
|
if (t.byteLength, n < 0 || t.byteLength < n) throw RangeError("'offset' is out of bounds");
|
|
107
107
|
if (t.byteLength < n + (r || 0)) throw RangeError("'length' is out of bounds");
|
|
108
108
|
return t = n === void 0 && r === void 0 ? new Uint8Array(t) : r === void 0 ? new Uint8Array(t, n) : new Uint8Array(t, n, r), _.TYPED_ARRAY_SUPPORT ? (e = t, e.__proto__ = _.prototype) : e = te(e, t), e;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
112
|
-
var n =
|
|
110
|
+
function re(e, t) {
|
|
111
|
+
if (S(t)) {
|
|
112
|
+
var n = ie(t.length) | 0;
|
|
113
113
|
return e = g(e, n), e.length === 0 || t.copy(e, 0, 0, n), e;
|
|
114
114
|
}
|
|
115
115
|
if (t) {
|
|
116
|
-
if (typeof ArrayBuffer < "u" && t.buffer instanceof ArrayBuffer || "length" in t) return typeof t.length != "number" ||
|
|
116
|
+
if (typeof ArrayBuffer < "u" && t.buffer instanceof ArrayBuffer || "length" in t) return typeof t.length != "number" || Ie(t.length) ? g(e, 0) : te(e, t);
|
|
117
117
|
if (t.type === "Buffer" && p(t.data)) return te(e, t.data);
|
|
118
118
|
}
|
|
119
119
|
throw TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function ie(e) {
|
|
122
122
|
if (e >= h()) throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + h().toString(16) + " bytes");
|
|
123
123
|
return e | 0;
|
|
124
124
|
}
|
|
125
|
-
_.isBuffer =
|
|
126
|
-
function
|
|
125
|
+
_.isBuffer = D;
|
|
126
|
+
function S(e) {
|
|
127
127
|
return !!(e != null && e._isBuffer);
|
|
128
128
|
}
|
|
129
129
|
_.compare = function(e, t) {
|
|
130
|
-
if (!
|
|
130
|
+
if (!S(e) || !S(t)) throw TypeError("Arguments must be Buffers");
|
|
131
131
|
if (e === t) return 0;
|
|
132
132
|
for (var n = e.length, r = t.length, i = 0, a = Math.min(n, r); i < a; ++i) if (e[i] !== t[i]) {
|
|
133
133
|
n = e[i], r = t[i];
|
|
@@ -157,13 +157,13 @@ _.compare = function(e, t) {
|
|
|
157
157
|
var r = _.allocUnsafe(t), i = 0;
|
|
158
158
|
for (n = 0; n < e.length; ++n) {
|
|
159
159
|
var a = e[n];
|
|
160
|
-
if (!
|
|
160
|
+
if (!S(a)) throw TypeError("\"list\" argument must be an Array of Buffers");
|
|
161
161
|
a.copy(r, i), i += a.length;
|
|
162
162
|
}
|
|
163
163
|
return r;
|
|
164
164
|
};
|
|
165
|
-
function
|
|
166
|
-
if (
|
|
165
|
+
function C(e, t) {
|
|
166
|
+
if (S(e)) return e.length;
|
|
167
167
|
if (typeof ArrayBuffer < "u" && typeof ArrayBuffer.isView == "function" && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)) return e.byteLength;
|
|
168
168
|
typeof e != "string" && (e = "" + e);
|
|
169
169
|
var n = e.length;
|
|
@@ -174,70 +174,70 @@ function w(e, t) {
|
|
|
174
174
|
case "binary": return n;
|
|
175
175
|
case "utf8":
|
|
176
176
|
case "utf-8":
|
|
177
|
-
case void 0: return
|
|
177
|
+
case void 0: return je(e).length;
|
|
178
178
|
case "ucs2":
|
|
179
179
|
case "ucs-2":
|
|
180
180
|
case "utf16le":
|
|
181
181
|
case "utf-16le": return n * 2;
|
|
182
182
|
case "hex": return n >>> 1;
|
|
183
|
-
case "base64": return
|
|
183
|
+
case "base64": return Pe(e).length;
|
|
184
184
|
default:
|
|
185
|
-
if (r) return
|
|
185
|
+
if (r) return je(e).length;
|
|
186
186
|
t = ("" + t).toLowerCase(), r = !0;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
_.byteLength =
|
|
190
|
-
function
|
|
189
|
+
_.byteLength = C;
|
|
190
|
+
function ae(e, t, n) {
|
|
191
191
|
var r = !1;
|
|
192
192
|
if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((n === void 0 || n > this.length) && (n = this.length), n <= 0) || (n >>>= 0, t >>>= 0, n <= t)) return "";
|
|
193
193
|
for (e ||= "utf8";;) switch (e) {
|
|
194
|
-
case "hex": return
|
|
194
|
+
case "hex": return be(this, t, n);
|
|
195
195
|
case "utf8":
|
|
196
|
-
case "utf-8": return
|
|
197
|
-
case "ascii": return
|
|
196
|
+
case "utf-8": return he(this, t, n);
|
|
197
|
+
case "ascii": return ve(this, t, n);
|
|
198
198
|
case "latin1":
|
|
199
|
-
case "binary": return
|
|
200
|
-
case "base64": return
|
|
199
|
+
case "binary": return ye(this, t, n);
|
|
200
|
+
case "base64": return me(this, t, n);
|
|
201
201
|
case "ucs2":
|
|
202
202
|
case "ucs-2":
|
|
203
203
|
case "utf16le":
|
|
204
|
-
case "utf-16le": return
|
|
204
|
+
case "utf-16le": return xe(this, t, n);
|
|
205
205
|
default:
|
|
206
206
|
if (r) throw TypeError("Unknown encoding: " + e);
|
|
207
207
|
e = (e + "").toLowerCase(), r = !0;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
_.prototype._isBuffer = !0;
|
|
211
|
-
function
|
|
211
|
+
function w(e, t, n) {
|
|
212
212
|
var r = e[t];
|
|
213
213
|
e[t] = e[n], e[n] = r;
|
|
214
214
|
}
|
|
215
215
|
_.prototype.swap16 = function() {
|
|
216
216
|
var e = this.length;
|
|
217
217
|
if (e % 2 != 0) throw RangeError("Buffer size must be a multiple of 16-bits");
|
|
218
|
-
for (var t = 0; t < e; t += 2)
|
|
218
|
+
for (var t = 0; t < e; t += 2) w(this, t, t + 1);
|
|
219
219
|
return this;
|
|
220
220
|
}, _.prototype.swap32 = function() {
|
|
221
221
|
var e = this.length;
|
|
222
222
|
if (e % 4 != 0) throw RangeError("Buffer size must be a multiple of 32-bits");
|
|
223
|
-
for (var t = 0; t < e; t += 4)
|
|
223
|
+
for (var t = 0; t < e; t += 4) w(this, t, t + 3), w(this, t + 1, t + 2);
|
|
224
224
|
return this;
|
|
225
225
|
}, _.prototype.swap64 = function() {
|
|
226
226
|
var e = this.length;
|
|
227
227
|
if (e % 8 != 0) throw RangeError("Buffer size must be a multiple of 64-bits");
|
|
228
|
-
for (var t = 0; t < e; t += 8)
|
|
228
|
+
for (var t = 0; t < e; t += 8) w(this, t, t + 7), w(this, t + 1, t + 6), w(this, t + 2, t + 5), w(this, t + 3, t + 4);
|
|
229
229
|
return this;
|
|
230
230
|
}, _.prototype.toString = function() {
|
|
231
231
|
var e = this.length | 0;
|
|
232
|
-
return e === 0 ? "" : arguments.length === 0 ?
|
|
232
|
+
return e === 0 ? "" : arguments.length === 0 ? he(this, 0, e) : ae.apply(this, arguments);
|
|
233
233
|
}, _.prototype.equals = function(e) {
|
|
234
|
-
if (!
|
|
234
|
+
if (!S(e)) throw TypeError("Argument must be a Buffer");
|
|
235
235
|
return this === e || _.compare(this, e) === 0;
|
|
236
236
|
}, _.prototype.inspect = function() {
|
|
237
237
|
var e = "", t = m;
|
|
238
238
|
return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "), this.length > t && (e += " ... ")), "<Buffer " + e + ">";
|
|
239
239
|
}, _.prototype.compare = function(e, t, n, r, i) {
|
|
240
|
-
if (!
|
|
240
|
+
if (!S(e)) throw TypeError("Argument must be a Buffer");
|
|
241
241
|
if (t === void 0 && (t = 0), n === void 0 && (n = e ? e.length : 0), r === void 0 && (r = 0), i === void 0 && (i = this.length), t < 0 || n > e.length || r < 0 || i > this.length) throw RangeError("out of range index");
|
|
242
242
|
if (r >= i && t >= n) return 0;
|
|
243
243
|
if (r >= i) return -1;
|
|
@@ -249,7 +249,7 @@ _.prototype.swap16 = function() {
|
|
|
249
249
|
}
|
|
250
250
|
return a < o ? -1 : +(o < a);
|
|
251
251
|
};
|
|
252
|
-
function
|
|
252
|
+
function oe(e, t, n, r, i) {
|
|
253
253
|
if (e.length === 0) return -1;
|
|
254
254
|
if (typeof n == "string" ? (r = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, isNaN(n) && (n = i ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) {
|
|
255
255
|
if (i) return -1;
|
|
@@ -258,11 +258,11 @@ function ae(e, t, n, r, i) {
|
|
|
258
258
|
if (i) n = 0;
|
|
259
259
|
else return -1;
|
|
260
260
|
}
|
|
261
|
-
if (typeof t == "string" && (t = _.from(t, r)),
|
|
262
|
-
if (typeof t == "number") return t &= 255, _.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf == "function" ? i ? Uint8Array.prototype.indexOf.call(e, t, n) : Uint8Array.prototype.lastIndexOf.call(e, t, n) :
|
|
261
|
+
if (typeof t == "string" && (t = _.from(t, r)), S(t)) return t.length === 0 ? -1 : se(e, t, n, r, i);
|
|
262
|
+
if (typeof t == "number") return t &= 255, _.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf == "function" ? i ? Uint8Array.prototype.indexOf.call(e, t, n) : Uint8Array.prototype.lastIndexOf.call(e, t, n) : se(e, [t], n, r, i);
|
|
263
263
|
throw TypeError("val must be string, number or Buffer");
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function se(e, t, n, r, i) {
|
|
266
266
|
var a = 1, o = e.length, s = t.length;
|
|
267
267
|
if (r !== void 0 && (r = String(r).toLowerCase(), r === "ucs2" || r === "ucs-2" || r === "utf16le" || r === "utf-16le")) {
|
|
268
268
|
if (e.length < 2 || t.length < 2) return -1;
|
|
@@ -289,11 +289,11 @@ function oe(e, t, n, r, i) {
|
|
|
289
289
|
_.prototype.includes = function(e, t, n) {
|
|
290
290
|
return this.indexOf(e, t, n) !== -1;
|
|
291
291
|
}, _.prototype.indexOf = function(e, t, n) {
|
|
292
|
-
return
|
|
292
|
+
return oe(this, e, t, n, !0);
|
|
293
293
|
}, _.prototype.lastIndexOf = function(e, t, n) {
|
|
294
|
-
return
|
|
294
|
+
return oe(this, e, t, n, !1);
|
|
295
295
|
};
|
|
296
|
-
function
|
|
296
|
+
function ce(e, t, n, r) {
|
|
297
297
|
n = Number(n) || 0;
|
|
298
298
|
var i = e.length - n;
|
|
299
299
|
r ? (r = Number(r), r > i && (r = i)) : r = i;
|
|
@@ -307,20 +307,20 @@ function se(e, t, n, r) {
|
|
|
307
307
|
}
|
|
308
308
|
return o;
|
|
309
309
|
}
|
|
310
|
-
function ce(e, t, n, r) {
|
|
311
|
-
return Pe(Ae(t, e.length - n), e, n, r);
|
|
312
|
-
}
|
|
313
310
|
function le(e, t, n, r) {
|
|
314
|
-
return
|
|
311
|
+
return Fe(je(t, e.length - n), e, n, r);
|
|
315
312
|
}
|
|
316
313
|
function ue(e, t, n, r) {
|
|
317
|
-
return
|
|
314
|
+
return Fe(Me(t), e, n, r);
|
|
318
315
|
}
|
|
319
316
|
function de(e, t, n, r) {
|
|
320
|
-
return
|
|
317
|
+
return ue(e, t, n, r);
|
|
321
318
|
}
|
|
322
319
|
function fe(e, t, n, r) {
|
|
323
|
-
return Pe(
|
|
320
|
+
return Fe(Pe(t), e, n, r);
|
|
321
|
+
}
|
|
322
|
+
function pe(e, t, n, r) {
|
|
323
|
+
return Fe(Ne(t, e.length - n), e, n, r);
|
|
324
324
|
}
|
|
325
325
|
_.prototype.write = function(e, t, n, r) {
|
|
326
326
|
if (t === void 0) r = "utf8", n = this.length, t = 0;
|
|
@@ -331,17 +331,17 @@ _.prototype.write = function(e, t, n, r) {
|
|
|
331
331
|
if ((n === void 0 || n > i) && (n = i), e.length > 0 && (n < 0 || t < 0) || t > this.length) throw RangeError("Attempt to write outside buffer bounds");
|
|
332
332
|
r ||= "utf8";
|
|
333
333
|
for (var a = !1;;) switch (r) {
|
|
334
|
-
case "hex": return
|
|
334
|
+
case "hex": return ce(this, e, t, n);
|
|
335
335
|
case "utf8":
|
|
336
|
-
case "utf-8": return
|
|
337
|
-
case "ascii": return
|
|
336
|
+
case "utf-8": return le(this, e, t, n);
|
|
337
|
+
case "ascii": return ue(this, e, t, n);
|
|
338
338
|
case "latin1":
|
|
339
|
-
case "binary": return
|
|
340
|
-
case "base64": return
|
|
339
|
+
case "binary": return de(this, e, t, n);
|
|
340
|
+
case "base64": return fe(this, e, t, n);
|
|
341
341
|
case "ucs2":
|
|
342
342
|
case "ucs-2":
|
|
343
343
|
case "utf16le":
|
|
344
|
-
case "utf-16le": return
|
|
344
|
+
case "utf-16le": return pe(this, e, t, n);
|
|
345
345
|
default:
|
|
346
346
|
if (a) throw TypeError("Unknown encoding: " + r);
|
|
347
347
|
r = ("" + r).toLowerCase(), a = !0;
|
|
@@ -352,10 +352,10 @@ _.prototype.write = function(e, t, n, r) {
|
|
|
352
352
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
353
353
|
};
|
|
354
354
|
};
|
|
355
|
-
function
|
|
355
|
+
function me(e, t, n) {
|
|
356
356
|
return t === 0 && n === e.length ? l(e) : l(e.slice(t, n));
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function he(e, t, n) {
|
|
359
359
|
n = Math.min(e.length, n);
|
|
360
360
|
for (var r = [], i = t; i < n;) {
|
|
361
361
|
var a = e[i], o = null, s = a > 239 ? 4 : a > 223 ? 3 : a > 191 ? 2 : 1;
|
|
@@ -376,34 +376,34 @@ function me(e, t, n) {
|
|
|
376
376
|
}
|
|
377
377
|
o === null ? (o = 65533, s = 1) : o > 65535 && (o -= 65536, r.push(o >>> 10 & 1023 | 55296), o = 56320 | o & 1023), r.push(o), i += s;
|
|
378
378
|
}
|
|
379
|
-
return
|
|
379
|
+
return _e(r);
|
|
380
380
|
}
|
|
381
|
-
var
|
|
382
|
-
function
|
|
381
|
+
var ge = 4096;
|
|
382
|
+
function _e(e) {
|
|
383
383
|
var t = e.length;
|
|
384
|
-
if (t <=
|
|
385
|
-
for (var n = "", r = 0; r < t;) n += String.fromCharCode.apply(String, e.slice(r, r +=
|
|
384
|
+
if (t <= ge) return String.fromCharCode.apply(String, e);
|
|
385
|
+
for (var n = "", r = 0; r < t;) n += String.fromCharCode.apply(String, e.slice(r, r += ge));
|
|
386
386
|
return n;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function ve(e, t, n) {
|
|
389
389
|
var r = "";
|
|
390
390
|
n = Math.min(e.length, n);
|
|
391
391
|
for (var i = t; i < n; ++i) r += String.fromCharCode(e[i] & 127);
|
|
392
392
|
return r;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function ye(e, t, n) {
|
|
395
395
|
var r = "";
|
|
396
396
|
n = Math.min(e.length, n);
|
|
397
397
|
for (var i = t; i < n; ++i) r += String.fromCharCode(e[i]);
|
|
398
398
|
return r;
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function be(e, t, n) {
|
|
401
401
|
var r = e.length;
|
|
402
402
|
(!t || t < 0) && (t = 0), (!n || n < 0 || n > r) && (n = r);
|
|
403
|
-
for (var i = "", a = t; a < n; ++a) i +=
|
|
403
|
+
for (var i = "", a = t; a < n; ++a) i += Ae(e[a]);
|
|
404
404
|
return i;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function xe(e, t, n) {
|
|
407
407
|
for (var r = e.slice(t, n), i = "", a = 0; a < r.length; a += 2) i += String.fromCharCode(r[a] + r[a + 1] * 256);
|
|
408
408
|
return i;
|
|
409
409
|
}
|
|
@@ -419,68 +419,68 @@ _.prototype.slice = function(e, t) {
|
|
|
419
419
|
}
|
|
420
420
|
return r;
|
|
421
421
|
};
|
|
422
|
-
function
|
|
422
|
+
function T(e, t, n) {
|
|
423
423
|
if (e % 1 != 0 || e < 0) throw RangeError("offset is not uint");
|
|
424
424
|
if (e + t > n) throw RangeError("Trying to access beyond buffer length");
|
|
425
425
|
}
|
|
426
426
|
_.prototype.readUIntLE = function(e, t, n) {
|
|
427
|
-
e |= 0, t |= 0, n ||
|
|
427
|
+
e |= 0, t |= 0, n || T(e, t, this.length);
|
|
428
428
|
for (var r = this[e], i = 1, a = 0; ++a < t && (i *= 256);) r += this[e + a] * i;
|
|
429
429
|
return r;
|
|
430
430
|
}, _.prototype.readUIntBE = function(e, t, n) {
|
|
431
|
-
e |= 0, t |= 0, n ||
|
|
431
|
+
e |= 0, t |= 0, n || T(e, t, this.length);
|
|
432
432
|
for (var r = this[e + --t], i = 1; t > 0 && (i *= 256);) r += this[e + --t] * i;
|
|
433
433
|
return r;
|
|
434
434
|
}, _.prototype.readUInt8 = function(e, t) {
|
|
435
|
-
return t ||
|
|
435
|
+
return t || T(e, 1, this.length), this[e];
|
|
436
436
|
}, _.prototype.readUInt16LE = function(e, t) {
|
|
437
|
-
return t ||
|
|
437
|
+
return t || T(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
438
438
|
}, _.prototype.readUInt16BE = function(e, t) {
|
|
439
|
-
return t ||
|
|
439
|
+
return t || T(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
440
440
|
}, _.prototype.readUInt32LE = function(e, t) {
|
|
441
|
-
return t ||
|
|
441
|
+
return t || T(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
|
|
442
442
|
}, _.prototype.readUInt32BE = function(e, t) {
|
|
443
|
-
return t ||
|
|
443
|
+
return t || T(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
444
444
|
}, _.prototype.readIntLE = function(e, t, n) {
|
|
445
|
-
e |= 0, t |= 0, n ||
|
|
445
|
+
e |= 0, t |= 0, n || T(e, t, this.length);
|
|
446
446
|
for (var r = this[e], i = 1, a = 0; ++a < t && (i *= 256);) r += this[e + a] * i;
|
|
447
447
|
return i *= 128, r >= i && (r -= 2 ** (8 * t)), r;
|
|
448
448
|
}, _.prototype.readIntBE = function(e, t, n) {
|
|
449
|
-
e |= 0, t |= 0, n ||
|
|
449
|
+
e |= 0, t |= 0, n || T(e, t, this.length);
|
|
450
450
|
for (var r = t, i = 1, a = this[e + --r]; r > 0 && (i *= 256);) a += this[e + --r] * i;
|
|
451
451
|
return i *= 128, a >= i && (a -= 2 ** (8 * t)), a;
|
|
452
452
|
}, _.prototype.readInt8 = function(e, t) {
|
|
453
|
-
return t ||
|
|
453
|
+
return t || T(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
454
454
|
}, _.prototype.readInt16LE = function(e, t) {
|
|
455
|
-
t ||
|
|
455
|
+
t || T(e, 2, this.length);
|
|
456
456
|
var n = this[e] | this[e + 1] << 8;
|
|
457
457
|
return n & 32768 ? n | 4294901760 : n;
|
|
458
458
|
}, _.prototype.readInt16BE = function(e, t) {
|
|
459
|
-
t ||
|
|
459
|
+
t || T(e, 2, this.length);
|
|
460
460
|
var n = this[e + 1] | this[e] << 8;
|
|
461
461
|
return n & 32768 ? n | 4294901760 : n;
|
|
462
462
|
}, _.prototype.readInt32LE = function(e, t) {
|
|
463
|
-
return t ||
|
|
463
|
+
return t || T(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
464
464
|
}, _.prototype.readInt32BE = function(e, t) {
|
|
465
|
-
return t ||
|
|
465
|
+
return t || T(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
466
466
|
}, _.prototype.readFloatLE = function(e, t) {
|
|
467
|
-
return t ||
|
|
467
|
+
return t || T(e, 4, this.length), u(this, e, !0, 23, 4);
|
|
468
468
|
}, _.prototype.readFloatBE = function(e, t) {
|
|
469
|
-
return t ||
|
|
469
|
+
return t || T(e, 4, this.length), u(this, e, !1, 23, 4);
|
|
470
470
|
}, _.prototype.readDoubleLE = function(e, t) {
|
|
471
|
-
return t ||
|
|
471
|
+
return t || T(e, 8, this.length), u(this, e, !0, 52, 8);
|
|
472
472
|
}, _.prototype.readDoubleBE = function(e, t) {
|
|
473
|
-
return t ||
|
|
473
|
+
return t || T(e, 8, this.length), u(this, e, !1, 52, 8);
|
|
474
474
|
};
|
|
475
|
-
function
|
|
476
|
-
if (!
|
|
475
|
+
function E(e, t, n, r, i, a) {
|
|
476
|
+
if (!S(e)) throw TypeError("\"buffer\" argument must be a Buffer instance");
|
|
477
477
|
if (t > i || t < a) throw RangeError("\"value\" argument is out of bounds");
|
|
478
478
|
if (n + r > e.length) throw RangeError("Index out of range");
|
|
479
479
|
}
|
|
480
480
|
_.prototype.writeUIntLE = function(e, t, n, r) {
|
|
481
481
|
if (e = +e, t |= 0, n |= 0, !r) {
|
|
482
482
|
var i = 2 ** (8 * n) - 1;
|
|
483
|
-
|
|
483
|
+
E(this, e, t, n, i, 0);
|
|
484
484
|
}
|
|
485
485
|
var a = 1, o = 0;
|
|
486
486
|
for (this[t] = e & 255; ++o < n && (a *= 256);) this[t + o] = e / a & 255;
|
|
@@ -488,35 +488,35 @@ _.prototype.writeUIntLE = function(e, t, n, r) {
|
|
|
488
488
|
}, _.prototype.writeUIntBE = function(e, t, n, r) {
|
|
489
489
|
if (e = +e, t |= 0, n |= 0, !r) {
|
|
490
490
|
var i = 2 ** (8 * n) - 1;
|
|
491
|
-
|
|
491
|
+
E(this, e, t, n, i, 0);
|
|
492
492
|
}
|
|
493
493
|
var a = n - 1, o = 1;
|
|
494
494
|
for (this[t + a] = e & 255; --a >= 0 && (o *= 256);) this[t + a] = e / o & 255;
|
|
495
495
|
return t + n;
|
|
496
496
|
}, _.prototype.writeUInt8 = function(e, t, n) {
|
|
497
|
-
return e = +e, t |= 0, n ||
|
|
497
|
+
return e = +e, t |= 0, n || E(this, e, t, 1, 255, 0), _.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), this[t] = e & 255, t + 1;
|
|
498
498
|
};
|
|
499
|
-
function
|
|
499
|
+
function Se(e, t, n, r) {
|
|
500
500
|
t < 0 && (t = 65535 + t + 1);
|
|
501
501
|
for (var i = 0, a = Math.min(e.length - n, 2); i < a; ++i) e[n + i] = (t & 255 << 8 * (r ? i : 1 - i)) >>> (r ? i : 1 - i) * 8;
|
|
502
502
|
}
|
|
503
503
|
_.prototype.writeUInt16LE = function(e, t, n) {
|
|
504
|
-
return e = +e, t |= 0, n ||
|
|
504
|
+
return e = +e, t |= 0, n || E(this, e, t, 2, 65535, 0), _.TYPED_ARRAY_SUPPORT ? (this[t] = e & 255, this[t + 1] = e >>> 8) : Se(this, e, t, !0), t + 2;
|
|
505
505
|
}, _.prototype.writeUInt16BE = function(e, t, n) {
|
|
506
|
-
return e = +e, t |= 0, n ||
|
|
506
|
+
return e = +e, t |= 0, n || E(this, e, t, 2, 65535, 0), _.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, this[t + 1] = e & 255) : Se(this, e, t, !1), t + 2;
|
|
507
507
|
};
|
|
508
|
-
function
|
|
508
|
+
function Ce(e, t, n, r) {
|
|
509
509
|
t < 0 && (t = 4294967295 + t + 1);
|
|
510
510
|
for (var i = 0, a = Math.min(e.length - n, 4); i < a; ++i) e[n + i] = t >>> (r ? i : 3 - i) * 8 & 255;
|
|
511
511
|
}
|
|
512
512
|
_.prototype.writeUInt32LE = function(e, t, n) {
|
|
513
|
-
return e = +e, t |= 0, n ||
|
|
513
|
+
return e = +e, t |= 0, n || E(this, e, t, 4, 4294967295, 0), _.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = e & 255) : Ce(this, e, t, !0), t + 4;
|
|
514
514
|
}, _.prototype.writeUInt32BE = function(e, t, n) {
|
|
515
|
-
return e = +e, t |= 0, n ||
|
|
515
|
+
return e = +e, t |= 0, n || E(this, e, t, 4, 4294967295, 0), _.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255) : Ce(this, e, t, !1), t + 4;
|
|
516
516
|
}, _.prototype.writeIntLE = function(e, t, n, r) {
|
|
517
517
|
if (e = +e, t |= 0, !r) {
|
|
518
518
|
var i = 2 ** (8 * n - 1);
|
|
519
|
-
|
|
519
|
+
E(this, e, t, n, i - 1, -i);
|
|
520
520
|
}
|
|
521
521
|
var a = 0, o = 1, s = 0;
|
|
522
522
|
for (this[t] = e & 255; ++a < n && (o *= 256);) e < 0 && s === 0 && this[t + a - 1] !== 0 && (s = 1), this[t + a] = (e / o >> 0) - s & 255;
|
|
@@ -524,40 +524,40 @@ _.prototype.writeUInt32LE = function(e, t, n) {
|
|
|
524
524
|
}, _.prototype.writeIntBE = function(e, t, n, r) {
|
|
525
525
|
if (e = +e, t |= 0, !r) {
|
|
526
526
|
var i = 2 ** (8 * n - 1);
|
|
527
|
-
|
|
527
|
+
E(this, e, t, n, i - 1, -i);
|
|
528
528
|
}
|
|
529
529
|
var a = n - 1, o = 1, s = 0;
|
|
530
530
|
for (this[t + a] = e & 255; --a >= 0 && (o *= 256);) e < 0 && s === 0 && this[t + a + 1] !== 0 && (s = 1), this[t + a] = (e / o >> 0) - s & 255;
|
|
531
531
|
return t + n;
|
|
532
532
|
}, _.prototype.writeInt8 = function(e, t, n) {
|
|
533
|
-
return e = +e, t |= 0, n ||
|
|
533
|
+
return e = +e, t |= 0, n || E(this, e, t, 1, 127, -128), _.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
|
|
534
534
|
}, _.prototype.writeInt16LE = function(e, t, n) {
|
|
535
|
-
return e = +e, t |= 0, n ||
|
|
535
|
+
return e = +e, t |= 0, n || E(this, e, t, 2, 32767, -32768), _.TYPED_ARRAY_SUPPORT ? (this[t] = e & 255, this[t + 1] = e >>> 8) : Se(this, e, t, !0), t + 2;
|
|
536
536
|
}, _.prototype.writeInt16BE = function(e, t, n) {
|
|
537
|
-
return e = +e, t |= 0, n ||
|
|
537
|
+
return e = +e, t |= 0, n || E(this, e, t, 2, 32767, -32768), _.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, this[t + 1] = e & 255) : Se(this, e, t, !1), t + 2;
|
|
538
538
|
}, _.prototype.writeInt32LE = function(e, t, n) {
|
|
539
|
-
return e = +e, t |= 0, n ||
|
|
539
|
+
return e = +e, t |= 0, n || E(this, e, t, 4, 2147483647, -2147483648), _.TYPED_ARRAY_SUPPORT ? (this[t] = e & 255, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24) : Ce(this, e, t, !0), t + 4;
|
|
540
540
|
}, _.prototype.writeInt32BE = function(e, t, n) {
|
|
541
|
-
return e = +e, t |= 0, n ||
|
|
541
|
+
return e = +e, t |= 0, n || E(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), _.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255) : Ce(this, e, t, !1), t + 4;
|
|
542
542
|
};
|
|
543
|
-
function
|
|
543
|
+
function we(e, t, n, r, i, a) {
|
|
544
544
|
if (n + r > e.length || n < 0) throw RangeError("Index out of range");
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
return i ||
|
|
546
|
+
function Te(e, t, n, r, i) {
|
|
547
|
+
return i || we(e, t, n, 4), d(e, t, n, r, 23, 4), n + 4;
|
|
548
548
|
}
|
|
549
549
|
_.prototype.writeFloatLE = function(e, t, n) {
|
|
550
|
-
return
|
|
550
|
+
return Te(this, e, t, !0, n);
|
|
551
551
|
}, _.prototype.writeFloatBE = function(e, t, n) {
|
|
552
|
-
return
|
|
552
|
+
return Te(this, e, t, !1, n);
|
|
553
553
|
};
|
|
554
|
-
function
|
|
555
|
-
return i ||
|
|
554
|
+
function Ee(e, t, n, r, i) {
|
|
555
|
+
return i || we(e, t, n, 8), d(e, t, n, r, 52, 8), n + 8;
|
|
556
556
|
}
|
|
557
557
|
_.prototype.writeDoubleLE = function(e, t, n) {
|
|
558
|
-
return
|
|
558
|
+
return Ee(this, e, t, !0, n);
|
|
559
559
|
}, _.prototype.writeDoubleBE = function(e, t, n) {
|
|
560
|
-
return
|
|
560
|
+
return Ee(this, e, t, !1, n);
|
|
561
561
|
}, _.prototype.copy = function(e, t, n, r) {
|
|
562
562
|
if (n ||= 0, !r && r !== 0 && (r = this.length), t >= e.length && (t = e.length), t ||= 0, r > 0 && r < n && (r = n), r === n || e.length === 0 || this.length === 0) return 0;
|
|
563
563
|
if (t < 0) throw RangeError("targetStart out of bounds");
|
|
@@ -584,24 +584,24 @@ _.prototype.writeDoubleLE = function(e, t, n) {
|
|
|
584
584
|
var a;
|
|
585
585
|
if (typeof e == "number") for (a = t; a < n; ++a) this[a] = e;
|
|
586
586
|
else {
|
|
587
|
-
var o =
|
|
587
|
+
var o = S(e) ? e : je(new _(e, r).toString()), s = o.length;
|
|
588
588
|
for (a = 0; a < n - t; ++a) this[a + t] = o[a % s];
|
|
589
589
|
}
|
|
590
590
|
return this;
|
|
591
591
|
};
|
|
592
|
-
var
|
|
593
|
-
function
|
|
594
|
-
if (e =
|
|
592
|
+
var De = /[^+\/0-9A-Za-z-_]/g;
|
|
593
|
+
function Oe(e) {
|
|
594
|
+
if (e = ke(e).replace(De, ""), e.length < 2) return "";
|
|
595
595
|
for (; e.length % 4 != 0;) e += "=";
|
|
596
596
|
return e;
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function ke(e) {
|
|
599
599
|
return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "");
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function Ae(e) {
|
|
602
602
|
return e < 16 ? "0" + e.toString(16) : e.toString(16);
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function je(e, t) {
|
|
605
605
|
t ||= Infinity;
|
|
606
606
|
for (var n, r = e.length, i = null, a = [], o = 0; o < r; ++o) {
|
|
607
607
|
if (n = e.charCodeAt(o), n > 55295 && n < 57344) {
|
|
@@ -639,72 +639,72 @@ function Ae(e, t) {
|
|
|
639
639
|
}
|
|
640
640
|
return a;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function Me(e) {
|
|
643
643
|
for (var t = [], n = 0; n < e.length; ++n) t.push(e.charCodeAt(n) & 255);
|
|
644
644
|
return t;
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function Ne(e, t) {
|
|
647
647
|
for (var n, r, i, a = [], o = 0; o < e.length && !((t -= 2) < 0); ++o) n = e.charCodeAt(o), r = n >> 8, i = n % 256, a.push(i), a.push(r);
|
|
648
648
|
return a;
|
|
649
649
|
}
|
|
650
|
-
function
|
|
651
|
-
return o(
|
|
650
|
+
function Pe(e) {
|
|
651
|
+
return o(Oe(e));
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function Fe(e, t, n, r) {
|
|
654
654
|
for (var i = 0; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i];
|
|
655
655
|
return i;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function Ie(e) {
|
|
658
658
|
return e !== e;
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
return e != null && (!!e._isBuffer ||
|
|
660
|
+
function D(e) {
|
|
661
|
+
return e != null && (!!e._isBuffer || Le(e) || Re(e));
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function Le(e) {
|
|
664
664
|
return !!e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
return typeof e.readFloatLE == "function" && typeof e.slice == "function" &&
|
|
666
|
+
function Re(e) {
|
|
667
|
+
return typeof e.readFloatLE == "function" && typeof e.slice == "function" && Le(e.slice(0, 0));
|
|
668
668
|
}
|
|
669
|
-
var
|
|
670
|
-
function
|
|
671
|
-
|
|
672
|
-
function
|
|
673
|
-
|
|
669
|
+
var ze;
|
|
670
|
+
function O() {}
|
|
671
|
+
O.prototype = Object.create(null);
|
|
672
|
+
function k() {
|
|
673
|
+
k.init.call(this);
|
|
674
674
|
}
|
|
675
|
-
|
|
676
|
-
this.domain = null,
|
|
677
|
-
},
|
|
675
|
+
k.EventEmitter = k, k.usingDomains = !1, k.prototype.domain = void 0, k.prototype._events = void 0, k.prototype._maxListeners = void 0, k.defaultMaxListeners = 10, k.init = function() {
|
|
676
|
+
this.domain = null, k.usingDomains && ze.active && !(this instanceof ze.Domain) && (this.domain = ze.active), (!this._events || this._events === Object.getPrototypeOf(this)._events) && (this._events = new O(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
677
|
+
}, k.prototype.setMaxListeners = function(e) {
|
|
678
678
|
if (typeof e != "number" || e < 0 || isNaN(e)) throw TypeError("\"n\" argument must be a positive number");
|
|
679
679
|
return this._maxListeners = e, this;
|
|
680
680
|
};
|
|
681
|
-
function
|
|
682
|
-
return e._maxListeners === void 0 ?
|
|
681
|
+
function Be(e) {
|
|
682
|
+
return e._maxListeners === void 0 ? k.defaultMaxListeners : e._maxListeners;
|
|
683
683
|
}
|
|
684
|
-
|
|
685
|
-
return
|
|
684
|
+
k.prototype.getMaxListeners = function() {
|
|
685
|
+
return Be(this);
|
|
686
686
|
};
|
|
687
|
-
function
|
|
687
|
+
function Ve(e, t, n) {
|
|
688
688
|
if (t) e.call(n);
|
|
689
|
-
else for (var r = e.length, i =
|
|
689
|
+
else for (var r = e.length, i = Ze(e, r), a = 0; a < r; ++a) i[a].call(n);
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function He(e, t, n, r) {
|
|
692
692
|
if (t) e.call(n, r);
|
|
693
|
-
else for (var i = e.length, a =
|
|
693
|
+
else for (var i = e.length, a = Ze(e, i), o = 0; o < i; ++o) a[o].call(n, r);
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function Ue(e, t, n, r, i) {
|
|
696
696
|
if (t) e.call(n, r, i);
|
|
697
|
-
else for (var a = e.length, o =
|
|
697
|
+
else for (var a = e.length, o = Ze(e, a), s = 0; s < a; ++s) o[s].call(n, r, i);
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function We(e, t, n, r, i, a) {
|
|
700
700
|
if (t) e.call(n, r, i, a);
|
|
701
|
-
else for (var o = e.length, s =
|
|
701
|
+
else for (var o = e.length, s = Ze(e, o), c = 0; c < o; ++c) s[c].call(n, r, i, a);
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function Ge(e, t, n, r) {
|
|
704
704
|
if (t) e.apply(n, r);
|
|
705
|
-
else for (var i = e.length, a =
|
|
705
|
+
else for (var i = e.length, a = Ze(e, i), o = 0; o < i; ++o) a[o].apply(n, r);
|
|
706
706
|
}
|
|
707
|
-
|
|
707
|
+
k.prototype.emit = function(e) {
|
|
708
708
|
var t, n, r, i, a, o, s, c = e === "error";
|
|
709
709
|
if (o = this._events, o) c &&= o.error == null;
|
|
710
710
|
else if (!c) return !1;
|
|
@@ -721,60 +721,60 @@ A.prototype.emit = function(e) {
|
|
|
721
721
|
var u = typeof n == "function";
|
|
722
722
|
switch (r = arguments.length, r) {
|
|
723
723
|
case 1:
|
|
724
|
-
|
|
724
|
+
Ve(n, u, this);
|
|
725
725
|
break;
|
|
726
726
|
case 2:
|
|
727
|
-
|
|
727
|
+
He(n, u, this, arguments[1]);
|
|
728
728
|
break;
|
|
729
729
|
case 3:
|
|
730
|
-
|
|
730
|
+
Ue(n, u, this, arguments[1], arguments[2]);
|
|
731
731
|
break;
|
|
732
732
|
case 4:
|
|
733
|
-
|
|
733
|
+
We(n, u, this, arguments[1], arguments[2], arguments[3]);
|
|
734
734
|
break;
|
|
735
735
|
default:
|
|
736
736
|
for (i = Array(r - 1), a = 1; a < r; a++) i[a - 1] = arguments[a];
|
|
737
|
-
|
|
737
|
+
Ge(n, u, this, i);
|
|
738
738
|
}
|
|
739
739
|
return !0;
|
|
740
740
|
};
|
|
741
|
-
function
|
|
741
|
+
function Ke(e, t, n, r) {
|
|
742
742
|
var i, a, o;
|
|
743
743
|
if (typeof n != "function") throw TypeError("\"listener\" argument must be a function");
|
|
744
|
-
if (a = e._events, a ? (a.newListener && (e.emit("newListener", t, n.listener ? n.listener : n), a = e._events), o = a[t]) : (a = e._events = new
|
|
745
|
-
else if (typeof o == "function" ? o = a[t] = r ? [n, o] : [o, n] : r ? o.unshift(n) : o.push(n), !o.warned && (i =
|
|
744
|
+
if (a = e._events, a ? (a.newListener && (e.emit("newListener", t, n.listener ? n.listener : n), a = e._events), o = a[t]) : (a = e._events = new O(), e._eventsCount = 0), !o) o = a[t] = n, ++e._eventsCount;
|
|
745
|
+
else if (typeof o == "function" ? o = a[t] = r ? [n, o] : [o, n] : r ? o.unshift(n) : o.push(n), !o.warned && (i = Be(e), i && i > 0 && o.length > i)) {
|
|
746
746
|
o.warned = !0;
|
|
747
747
|
var s = /* @__PURE__ */ Error("Possible EventEmitter memory leak detected. " + o.length + " " + t + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
748
|
-
s.name = "MaxListenersExceededWarning", s.emitter = e, s.type = t, s.count = o.length,
|
|
748
|
+
s.name = "MaxListenersExceededWarning", s.emitter = e, s.type = t, s.count = o.length, qe(s);
|
|
749
749
|
}
|
|
750
750
|
return e;
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function qe(e) {
|
|
753
753
|
typeof console.warn == "function" ? console.warn(e) : console.log(e);
|
|
754
754
|
}
|
|
755
|
-
|
|
756
|
-
return
|
|
757
|
-
},
|
|
758
|
-
return
|
|
755
|
+
k.prototype.addListener = function(e, t) {
|
|
756
|
+
return Ke(this, e, t, !1);
|
|
757
|
+
}, k.prototype.on = k.prototype.addListener, k.prototype.prependListener = function(e, t) {
|
|
758
|
+
return Ke(this, e, t, !0);
|
|
759
759
|
};
|
|
760
|
-
function
|
|
760
|
+
function Je(e, t, n) {
|
|
761
761
|
var r = !1;
|
|
762
762
|
function i() {
|
|
763
763
|
e.removeListener(t, i), r || (r = !0, n.apply(e, arguments));
|
|
764
764
|
}
|
|
765
765
|
return i.listener = n, i;
|
|
766
766
|
}
|
|
767
|
-
|
|
767
|
+
k.prototype.once = function(e, t) {
|
|
768
768
|
if (typeof t != "function") throw TypeError("\"listener\" argument must be a function");
|
|
769
|
-
return this.on(e,
|
|
770
|
-
},
|
|
769
|
+
return this.on(e, Je(this, e, t)), this;
|
|
770
|
+
}, k.prototype.prependOnceListener = function(e, t) {
|
|
771
771
|
if (typeof t != "function") throw TypeError("\"listener\" argument must be a function");
|
|
772
|
-
return this.prependListener(e,
|
|
773
|
-
},
|
|
772
|
+
return this.prependListener(e, Je(this, e, t)), this;
|
|
773
|
+
}, k.prototype.removeListener = function(e, t) {
|
|
774
774
|
var n, r, i, a, o;
|
|
775
775
|
if (typeof t != "function") throw TypeError("\"listener\" argument must be a function");
|
|
776
776
|
if (r = this._events, !r || (n = r[e], !n)) return this;
|
|
777
|
-
if (n === t || n.listener && n.listener === t) --this._eventsCount === 0 ? this._events = new
|
|
777
|
+
if (n === t || n.listener && n.listener === t) --this._eventsCount === 0 ? this._events = new O() : (delete r[e], r.removeListener && this.emit("removeListener", e, n.listener || t));
|
|
778
778
|
else if (typeof n != "function") {
|
|
779
779
|
for (i = -1, a = n.length; a-- > 0;) if (n[a] === t || n[a].listener && n[a].listener === t) {
|
|
780
780
|
o = n[a].listener, i = a;
|
|
@@ -782,32 +782,32 @@ A.prototype.once = function(e, t) {
|
|
|
782
782
|
}
|
|
783
783
|
if (i < 0) return this;
|
|
784
784
|
if (n.length === 1) {
|
|
785
|
-
if (n[0] = void 0, --this._eventsCount === 0) return this._events = new
|
|
785
|
+
if (n[0] = void 0, --this._eventsCount === 0) return this._events = new O(), this;
|
|
786
786
|
delete r[e];
|
|
787
|
-
} else
|
|
787
|
+
} else Xe(n, i);
|
|
788
788
|
r.removeListener && this.emit("removeListener", e, o || t);
|
|
789
789
|
}
|
|
790
790
|
return this;
|
|
791
|
-
},
|
|
791
|
+
}, k.prototype.removeAllListeners = function(e) {
|
|
792
792
|
var t, n = this._events;
|
|
793
793
|
if (!n) return this;
|
|
794
|
-
if (!n.removeListener) return arguments.length === 0 ? (this._events = new
|
|
794
|
+
if (!n.removeListener) return arguments.length === 0 ? (this._events = new O(), this._eventsCount = 0) : n[e] && (--this._eventsCount === 0 ? this._events = new O() : delete n[e]), this;
|
|
795
795
|
if (arguments.length === 0) {
|
|
796
796
|
for (var r = Object.keys(n), i = 0, a; i < r.length; ++i) a = r[i], a !== "removeListener" && this.removeAllListeners(a);
|
|
797
|
-
return this.removeAllListeners("removeListener"), this._events = new
|
|
797
|
+
return this.removeAllListeners("removeListener"), this._events = new O(), this._eventsCount = 0, this;
|
|
798
798
|
}
|
|
799
799
|
if (t = n[e], typeof t == "function") this.removeListener(e, t);
|
|
800
800
|
else if (t) do
|
|
801
801
|
this.removeListener(e, t[t.length - 1]);
|
|
802
802
|
while (t[0]);
|
|
803
803
|
return this;
|
|
804
|
-
},
|
|
804
|
+
}, k.prototype.listeners = function(e) {
|
|
805
805
|
var t, n, r = this._events;
|
|
806
|
-
return r ? (t = r[e], n = t ? typeof t == "function" ? [t.listener || t] :
|
|
807
|
-
},
|
|
808
|
-
return typeof e.listenerCount == "function" ? e.listenerCount(t) :
|
|
809
|
-
},
|
|
810
|
-
function
|
|
806
|
+
return r ? (t = r[e], n = t ? typeof t == "function" ? [t.listener || t] : Qe(t) : []) : n = [], n;
|
|
807
|
+
}, k.listenerCount = function(e, t) {
|
|
808
|
+
return typeof e.listenerCount == "function" ? e.listenerCount(t) : Ye.call(e, t);
|
|
809
|
+
}, k.prototype.listenerCount = Ye;
|
|
810
|
+
function Ye(e) {
|
|
811
811
|
var t = this._events;
|
|
812
812
|
if (t) {
|
|
813
813
|
var n = t[e];
|
|
@@ -816,84 +816,84 @@ function Je(e) {
|
|
|
816
816
|
}
|
|
817
817
|
return 0;
|
|
818
818
|
}
|
|
819
|
-
|
|
819
|
+
k.prototype.eventNames = function() {
|
|
820
820
|
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
|
|
821
821
|
};
|
|
822
|
-
function
|
|
822
|
+
function Xe(e, t) {
|
|
823
823
|
for (var n = t, r = n + 1, i = e.length; r < i; n += 1, r += 1) e[n] = e[r];
|
|
824
824
|
e.pop();
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function Ze(e, t) {
|
|
827
827
|
for (var n = Array(t); t--;) n[t] = e[t];
|
|
828
828
|
return n;
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function Qe(e) {
|
|
831
831
|
for (var t = Array(e.length), n = 0; n < t.length; ++n) t[n] = e[n].listener || e[n];
|
|
832
832
|
return t;
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function $e() {
|
|
835
835
|
throw Error("setTimeout has not been defined");
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function et() {
|
|
838
838
|
throw Error("clearTimeout has not been defined");
|
|
839
839
|
}
|
|
840
|
-
var
|
|
841
|
-
typeof e.setTimeout == "function" && (
|
|
842
|
-
function
|
|
843
|
-
if (
|
|
844
|
-
if ((
|
|
840
|
+
var A = $e, j = et;
|
|
841
|
+
typeof e.setTimeout == "function" && (A = setTimeout), typeof e.clearTimeout == "function" && (j = clearTimeout);
|
|
842
|
+
function tt(e) {
|
|
843
|
+
if (A === setTimeout) return setTimeout(e, 0);
|
|
844
|
+
if ((A === $e || !A) && setTimeout) return A = setTimeout, setTimeout(e, 0);
|
|
845
845
|
try {
|
|
846
|
-
return
|
|
846
|
+
return A(e, 0);
|
|
847
847
|
} catch {
|
|
848
848
|
try {
|
|
849
|
-
return
|
|
849
|
+
return A.call(null, e, 0);
|
|
850
850
|
} catch {
|
|
851
|
-
return
|
|
851
|
+
return A.call(this, e, 0);
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
854
|
}
|
|
855
|
-
function
|
|
856
|
-
if (
|
|
857
|
-
if ((
|
|
855
|
+
function nt(e) {
|
|
856
|
+
if (j === clearTimeout) return clearTimeout(e);
|
|
857
|
+
if ((j === et || !j) && clearTimeout) return j = clearTimeout, clearTimeout(e);
|
|
858
858
|
try {
|
|
859
|
-
return
|
|
859
|
+
return j(e);
|
|
860
860
|
} catch {
|
|
861
861
|
try {
|
|
862
|
-
return
|
|
862
|
+
return j.call(null, e);
|
|
863
863
|
} catch {
|
|
864
|
-
return
|
|
864
|
+
return j.call(this, e);
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
|
-
var
|
|
869
|
-
function
|
|
870
|
-
|
|
868
|
+
var M = [], N = !1, P, rt = -1;
|
|
869
|
+
function it() {
|
|
870
|
+
N && P && (N = !1, P.length ? M = P.concat(M) : rt = -1, M.length && at());
|
|
871
871
|
}
|
|
872
|
-
function
|
|
873
|
-
if (!
|
|
874
|
-
var e =
|
|
875
|
-
|
|
876
|
-
for (var t =
|
|
877
|
-
for (
|
|
878
|
-
|
|
872
|
+
function at() {
|
|
873
|
+
if (!N) {
|
|
874
|
+
var e = tt(it);
|
|
875
|
+
N = !0;
|
|
876
|
+
for (var t = M.length; t;) {
|
|
877
|
+
for (P = M, M = []; ++rt < t;) P && P[rt].run();
|
|
878
|
+
rt = -1, t = M.length;
|
|
879
879
|
}
|
|
880
|
-
|
|
880
|
+
P = null, N = !1, nt(e);
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function F(e) {
|
|
884
884
|
var t = Array(arguments.length - 1);
|
|
885
885
|
if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
|
|
886
|
-
|
|
886
|
+
M.push(new ot(e, t)), M.length === 1 && !N && tt(at);
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function ot(e, t) {
|
|
889
889
|
this.fun = e, this.array = t;
|
|
890
890
|
}
|
|
891
|
-
|
|
891
|
+
ot.prototype.run = function() {
|
|
892
892
|
this.fun.apply(null, this.array);
|
|
893
893
|
};
|
|
894
|
-
var
|
|
895
|
-
|
|
896
|
-
var
|
|
894
|
+
var st = {}, ct = e.performance || {};
|
|
895
|
+
ct.now || ct.mozNow || ct.msNow || ct.oNow || ct.webkitNow;
|
|
896
|
+
var lt = { env: st }, I = typeof Object.create == "function" ? function(e, t) {
|
|
897
897
|
e.super_ = t, e.prototype = Object.create(t.prototype, { constructor: {
|
|
898
898
|
value: e,
|
|
899
899
|
enumerable: !1,
|
|
@@ -904,13 +904,13 @@ var ot = { env: at }, z = typeof Object.create == "function" ? function(e, t) {
|
|
|
904
904
|
e.super_ = t;
|
|
905
905
|
var n = function() {};
|
|
906
906
|
n.prototype = t.prototype, e.prototype = new n(), e.prototype.constructor = e;
|
|
907
|
-
},
|
|
908
|
-
function
|
|
909
|
-
if (!
|
|
910
|
-
for (var t = [], n = 0; n < arguments.length; n++) t.push(
|
|
907
|
+
}, ut = /%[sdj%]/g;
|
|
908
|
+
function dt(e) {
|
|
909
|
+
if (!kt(e)) {
|
|
910
|
+
for (var t = [], n = 0; n < arguments.length; n++) t.push(L(arguments[n]));
|
|
911
911
|
return t.join(" ");
|
|
912
912
|
}
|
|
913
|
-
for (var n = 1, r = arguments, i = r.length, a = String(e).replace(
|
|
913
|
+
for (var n = 1, r = arguments, i = r.length, a = String(e).replace(ut, function(e) {
|
|
914
914
|
if (e === "%%") return "%";
|
|
915
915
|
if (n >= i) return e;
|
|
916
916
|
switch (e) {
|
|
@@ -923,45 +923,45 @@ function ct(e) {
|
|
|
923
923
|
}
|
|
924
924
|
default: return e;
|
|
925
925
|
}
|
|
926
|
-
}), o = r[n]; n < i; o = r[++n])
|
|
926
|
+
}), o = r[n]; n < i; o = r[++n]) Dt(o) || !jt(o) ? a += " " + o : a += " " + L(o);
|
|
927
927
|
return a;
|
|
928
928
|
}
|
|
929
|
-
function
|
|
930
|
-
if (
|
|
931
|
-
return
|
|
929
|
+
function ft(t, n) {
|
|
930
|
+
if (R(e.process)) return function() {
|
|
931
|
+
return ft(t, n).apply(this, arguments);
|
|
932
932
|
};
|
|
933
|
-
if (
|
|
933
|
+
if (lt.noDeprecation === !0) return t;
|
|
934
934
|
var r = !1;
|
|
935
935
|
function i() {
|
|
936
936
|
if (!r) {
|
|
937
|
-
if (
|
|
938
|
-
|
|
937
|
+
if (lt.throwDeprecation) throw Error(n);
|
|
938
|
+
lt.traceDeprecation ? console.trace(n) : console.error(n), r = !0;
|
|
939
939
|
}
|
|
940
940
|
return t.apply(this, arguments);
|
|
941
941
|
}
|
|
942
942
|
return i;
|
|
943
943
|
}
|
|
944
|
-
var
|
|
945
|
-
function
|
|
946
|
-
if (
|
|
947
|
-
if (RegExp("\\b" + e + "\\b", "i").test(
|
|
944
|
+
var pt = {}, mt;
|
|
945
|
+
function ht(e) {
|
|
946
|
+
if (R(mt) && (mt = lt.env.NODE_DEBUG || ""), e = e.toUpperCase(), !pt[e]) {
|
|
947
|
+
if (RegExp("\\b" + e + "\\b", "i").test(mt)) {
|
|
948
948
|
var t = 0;
|
|
949
|
-
|
|
950
|
-
var n =
|
|
949
|
+
pt[e] = function() {
|
|
950
|
+
var n = dt.apply(null, arguments);
|
|
951
951
|
console.error("%s %d: %s", e, t, n);
|
|
952
952
|
};
|
|
953
|
-
} else
|
|
953
|
+
} else pt[e] = function() {};
|
|
954
954
|
}
|
|
955
|
-
return
|
|
955
|
+
return pt[e];
|
|
956
956
|
}
|
|
957
|
-
function
|
|
957
|
+
function L(e, t) {
|
|
958
958
|
var n = {
|
|
959
959
|
seen: [],
|
|
960
|
-
stylize:
|
|
960
|
+
stylize: _t
|
|
961
961
|
};
|
|
962
|
-
return arguments.length >= 3 && (n.depth = arguments[2]), arguments.length >= 4 && (n.colors = arguments[3]),
|
|
962
|
+
return arguments.length >= 3 && (n.depth = arguments[2]), arguments.length >= 4 && (n.colors = arguments[3]), Et(t) ? n.showHidden = t : t && It(n, t), R(n.showHidden) && (n.showHidden = !1), R(n.depth) && (n.depth = 2), R(n.colors) && (n.colors = !1), R(n.customInspect) && (n.customInspect = !0), n.colors && (n.stylize = gt), yt(n, e, n.depth);
|
|
963
963
|
}
|
|
964
|
-
|
|
964
|
+
L.colors = {
|
|
965
965
|
bold: [1, 22],
|
|
966
966
|
italic: [3, 23],
|
|
967
967
|
underline: [4, 24],
|
|
@@ -975,7 +975,7 @@ B.colors = {
|
|
|
975
975
|
magenta: [35, 39],
|
|
976
976
|
red: [31, 39],
|
|
977
977
|
yellow: [33, 39]
|
|
978
|
-
},
|
|
978
|
+
}, L.styles = {
|
|
979
979
|
special: "cyan",
|
|
980
980
|
number: "yellow",
|
|
981
981
|
boolean: "yellow",
|
|
@@ -985,159 +985,159 @@ B.colors = {
|
|
|
985
985
|
date: "magenta",
|
|
986
986
|
regexp: "red"
|
|
987
987
|
};
|
|
988
|
-
function
|
|
989
|
-
var n =
|
|
990
|
-
return n ? "\x1B[" +
|
|
988
|
+
function gt(e, t) {
|
|
989
|
+
var n = L.styles[t];
|
|
990
|
+
return n ? "\x1B[" + L.colors[n][0] + "m" + e + "\x1B[" + L.colors[n][1] + "m" : e;
|
|
991
991
|
}
|
|
992
|
-
function
|
|
992
|
+
function _t(e, t) {
|
|
993
993
|
return e;
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function vt(e) {
|
|
996
996
|
var t = {};
|
|
997
997
|
return e.forEach(function(e, n) {
|
|
998
998
|
t[e] = !0;
|
|
999
999
|
}), t;
|
|
1000
1000
|
}
|
|
1001
|
-
function
|
|
1002
|
-
if (e.customInspect && t &&
|
|
1001
|
+
function yt(e, t, n) {
|
|
1002
|
+
if (e.customInspect && t && Pt(t.inspect) && t.inspect !== L && !(t.constructor && t.constructor.prototype === t)) {
|
|
1003
1003
|
var r = t.inspect(n, e);
|
|
1004
|
-
return
|
|
1004
|
+
return kt(r) || (r = yt(e, r, n)), r;
|
|
1005
1005
|
}
|
|
1006
|
-
var i =
|
|
1006
|
+
var i = bt(e, t);
|
|
1007
1007
|
if (i) return i;
|
|
1008
|
-
var a = Object.keys(t), o =
|
|
1009
|
-
if (e.showHidden && (a = Object.getOwnPropertyNames(t)),
|
|
1008
|
+
var a = Object.keys(t), o = vt(a);
|
|
1009
|
+
if (e.showHidden && (a = Object.getOwnPropertyNames(t)), Nt(t) && (a.indexOf("message") >= 0 || a.indexOf("description") >= 0)) return xt(t);
|
|
1010
1010
|
if (a.length === 0) {
|
|
1011
|
-
if (
|
|
1011
|
+
if (Pt(t)) {
|
|
1012
1012
|
var s = t.name ? ": " + t.name : "";
|
|
1013
1013
|
return e.stylize("[Function" + s + "]", "special");
|
|
1014
1014
|
}
|
|
1015
|
-
if (
|
|
1016
|
-
if (
|
|
1017
|
-
if (
|
|
1015
|
+
if (At(t)) return e.stylize(RegExp.prototype.toString.call(t), "regexp");
|
|
1016
|
+
if (Mt(t)) return e.stylize(Date.prototype.toString.call(t), "date");
|
|
1017
|
+
if (Nt(t)) return xt(t);
|
|
1018
1018
|
}
|
|
1019
1019
|
var c = "", l = !1, u = ["{", "}"];
|
|
1020
|
-
if (
|
|
1021
|
-
if (n < 0) return
|
|
1020
|
+
if (Tt(t) && (l = !0, u = ["[", "]"]), Pt(t) && (c = " [Function" + (t.name ? ": " + t.name : "") + "]"), At(t) && (c = " " + RegExp.prototype.toString.call(t)), Mt(t) && (c = " " + Date.prototype.toUTCString.call(t)), Nt(t) && (c = " " + xt(t)), a.length === 0 && (!l || t.length == 0)) return u[0] + c + u[1];
|
|
1021
|
+
if (n < 0) return At(t) ? e.stylize(RegExp.prototype.toString.call(t), "regexp") : e.stylize("[Object]", "special");
|
|
1022
1022
|
e.seen.push(t);
|
|
1023
|
-
var d = l ?
|
|
1024
|
-
return
|
|
1023
|
+
var d = l ? St(e, t, n, o, a) : a.map(function(r) {
|
|
1024
|
+
return Ct(e, t, n, o, r, l);
|
|
1025
1025
|
});
|
|
1026
|
-
return e.seen.pop(),
|
|
1026
|
+
return e.seen.pop(), wt(d, c, u);
|
|
1027
1027
|
}
|
|
1028
|
-
function
|
|
1029
|
-
if (
|
|
1030
|
-
if (
|
|
1028
|
+
function bt(e, t) {
|
|
1029
|
+
if (R(t)) return e.stylize("undefined", "undefined");
|
|
1030
|
+
if (kt(t)) {
|
|
1031
1031
|
var n = "'" + JSON.stringify(t).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, "\"") + "'";
|
|
1032
1032
|
return e.stylize(n, "string");
|
|
1033
1033
|
}
|
|
1034
|
-
if (
|
|
1035
|
-
if (
|
|
1036
|
-
if (
|
|
1034
|
+
if (Ot(t)) return e.stylize("" + t, "number");
|
|
1035
|
+
if (Et(t)) return e.stylize("" + t, "boolean");
|
|
1036
|
+
if (Dt(t)) return e.stylize("null", "null");
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function xt(e) {
|
|
1039
1039
|
return "[" + Error.prototype.toString.call(e) + "]";
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1042
|
-
for (var a = [], o = 0, s = t.length; o < s; ++o)
|
|
1041
|
+
function St(e, t, n, r, i) {
|
|
1042
|
+
for (var a = [], o = 0, s = t.length; o < s; ++o) Lt(t, String(o)) ? a.push(Ct(e, t, n, r, String(o), !0)) : a.push("");
|
|
1043
1043
|
return i.forEach(function(i) {
|
|
1044
|
-
i.match(/^\d+$/) || a.push(
|
|
1044
|
+
i.match(/^\d+$/) || a.push(Ct(e, t, n, r, i, !0));
|
|
1045
1045
|
}), a;
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function Ct(e, t, n, r, i, a) {
|
|
1048
1048
|
var o, s, c = Object.getOwnPropertyDescriptor(t, i) || { value: t[i] };
|
|
1049
|
-
if (c.get ? s = c.set ? e.stylize("[Getter/Setter]", "special") : e.stylize("[Getter]", "special") : c.set && (s = e.stylize("[Setter]", "special")),
|
|
1049
|
+
if (c.get ? s = c.set ? e.stylize("[Getter/Setter]", "special") : e.stylize("[Getter]", "special") : c.set && (s = e.stylize("[Setter]", "special")), Lt(r, i) || (o = "[" + i + "]"), s || (e.seen.indexOf(c.value) < 0 ? (s = Dt(n) ? yt(e, c.value, null) : yt(e, c.value, n - 1), s.indexOf("\n") > -1 && (s = a ? s.split("\n").map(function(e) {
|
|
1050
1050
|
return " " + e;
|
|
1051
1051
|
}).join("\n").substr(2) : "\n" + s.split("\n").map(function(e) {
|
|
1052
1052
|
return " " + e;
|
|
1053
|
-
}).join("\n"))) : s = e.stylize("[Circular]", "special")),
|
|
1053
|
+
}).join("\n"))) : s = e.stylize("[Circular]", "special")), R(o)) {
|
|
1054
1054
|
if (a && i.match(/^\d+$/)) return s;
|
|
1055
1055
|
o = JSON.stringify("" + i), o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (o = o.substr(1, o.length - 2), o = e.stylize(o, "name")) : (o = o.replace(/'/g, "\\'").replace(/\\"/g, "\"").replace(/(^"|"$)/g, "'"), o = e.stylize(o, "string"));
|
|
1056
1056
|
}
|
|
1057
1057
|
return o + ": " + s;
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1059
|
+
function wt(e, t, n) {
|
|
1060
1060
|
return e.reduce(function(e, t) {
|
|
1061
1061
|
return t.indexOf("\n"), e + t.replace(/\u001b\[\d\d?m/g, "").length + 1;
|
|
1062
1062
|
}, 0) > 60 ? n[0] + (t === "" ? "" : t + "\n ") + " " + e.join(",\n ") + " " + n[1] : n[0] + t + " " + e.join(", ") + " " + n[1];
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1064
|
+
function Tt(e) {
|
|
1065
1065
|
return Array.isArray(e);
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1067
|
+
function Et(e) {
|
|
1068
1068
|
return typeof e == "boolean";
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Dt(e) {
|
|
1071
1071
|
return e === null;
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function Ot(e) {
|
|
1074
1074
|
return typeof e == "number";
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1076
|
+
function kt(e) {
|
|
1077
1077
|
return typeof e == "string";
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function R(e) {
|
|
1080
1080
|
return e === void 0;
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1083
|
-
return
|
|
1082
|
+
function At(e) {
|
|
1083
|
+
return jt(e) && Ft(e) === "[object RegExp]";
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function jt(e) {
|
|
1086
1086
|
return typeof e == "object" && !!e;
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1089
|
-
return
|
|
1088
|
+
function Mt(e) {
|
|
1089
|
+
return jt(e) && Ft(e) === "[object Date]";
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1092
|
-
return
|
|
1091
|
+
function Nt(e) {
|
|
1092
|
+
return jt(e) && (Ft(e) === "[object Error]" || e instanceof Error);
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function Pt(e) {
|
|
1095
1095
|
return typeof e == "function";
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1097
|
+
function Ft(e) {
|
|
1098
1098
|
return Object.prototype.toString.call(e);
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1101
|
-
if (!t || !
|
|
1100
|
+
function It(e, t) {
|
|
1101
|
+
if (!t || !jt(t)) return e;
|
|
1102
1102
|
for (var n = Object.keys(t), r = n.length; r--;) e[n[r]] = t[n[r]];
|
|
1103
1103
|
return e;
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function Lt(e, t) {
|
|
1106
1106
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function z() {
|
|
1109
1109
|
this.head = null, this.tail = null, this.length = 0;
|
|
1110
1110
|
}
|
|
1111
|
-
|
|
1111
|
+
z.prototype.push = function(e) {
|
|
1112
1112
|
var t = {
|
|
1113
1113
|
data: e,
|
|
1114
1114
|
next: null
|
|
1115
1115
|
};
|
|
1116
1116
|
this.length > 0 ? this.tail.next = t : this.head = t, this.tail = t, ++this.length;
|
|
1117
|
-
},
|
|
1117
|
+
}, z.prototype.unshift = function(e) {
|
|
1118
1118
|
var t = {
|
|
1119
1119
|
data: e,
|
|
1120
1120
|
next: this.head
|
|
1121
1121
|
};
|
|
1122
1122
|
this.length === 0 && (this.tail = t), this.head = t, ++this.length;
|
|
1123
|
-
},
|
|
1123
|
+
}, z.prototype.shift = function() {
|
|
1124
1124
|
if (this.length !== 0) {
|
|
1125
1125
|
var e = this.head.data;
|
|
1126
1126
|
return this.head = this.length === 1 ? this.tail = null : this.head.next, --this.length, e;
|
|
1127
1127
|
}
|
|
1128
|
-
},
|
|
1128
|
+
}, z.prototype.clear = function() {
|
|
1129
1129
|
this.head = this.tail = null, this.length = 0;
|
|
1130
|
-
},
|
|
1130
|
+
}, z.prototype.join = function(e) {
|
|
1131
1131
|
if (this.length === 0) return "";
|
|
1132
1132
|
for (var t = this.head, n = "" + t.data; t = t.next;) n += e + t.data;
|
|
1133
1133
|
return n;
|
|
1134
|
-
},
|
|
1134
|
+
}, z.prototype.concat = function(e) {
|
|
1135
1135
|
if (this.length === 0) return _.alloc(0);
|
|
1136
1136
|
if (this.length === 1) return this.head.data;
|
|
1137
1137
|
for (var t = _.allocUnsafe(e >>> 0), n = this.head, r = 0; n;) n.data.copy(t, r), r += n.data.length, n = n.next;
|
|
1138
1138
|
return t;
|
|
1139
1139
|
};
|
|
1140
|
-
var
|
|
1140
|
+
var Rt = _.isEncoding || function(e) {
|
|
1141
1141
|
switch (e && e.toLowerCase()) {
|
|
1142
1142
|
case "hex":
|
|
1143
1143
|
case "utf8":
|
|
@@ -1153,28 +1153,28 @@ var Pt = _.isEncoding || function(e) {
|
|
|
1153
1153
|
default: return !1;
|
|
1154
1154
|
}
|
|
1155
1155
|
};
|
|
1156
|
-
function
|
|
1157
|
-
if (e && !
|
|
1156
|
+
function zt(e) {
|
|
1157
|
+
if (e && !Rt(e)) throw Error("Unknown encoding: " + e);
|
|
1158
1158
|
}
|
|
1159
|
-
function
|
|
1160
|
-
switch (this.encoding = (e || "utf8").toLowerCase().replace(/[-_]/, ""),
|
|
1159
|
+
function Bt(e) {
|
|
1160
|
+
switch (this.encoding = (e || "utf8").toLowerCase().replace(/[-_]/, ""), zt(e), this.encoding) {
|
|
1161
1161
|
case "utf8":
|
|
1162
1162
|
this.surrogateSize = 3;
|
|
1163
1163
|
break;
|
|
1164
1164
|
case "ucs2":
|
|
1165
1165
|
case "utf16le":
|
|
1166
|
-
this.surrogateSize = 2, this.detectIncompleteChar =
|
|
1166
|
+
this.surrogateSize = 2, this.detectIncompleteChar = Ht;
|
|
1167
1167
|
break;
|
|
1168
1168
|
case "base64":
|
|
1169
|
-
this.surrogateSize = 3, this.detectIncompleteChar =
|
|
1169
|
+
this.surrogateSize = 3, this.detectIncompleteChar = Ut;
|
|
1170
1170
|
break;
|
|
1171
1171
|
default:
|
|
1172
|
-
this.write =
|
|
1172
|
+
this.write = Vt;
|
|
1173
1173
|
return;
|
|
1174
1174
|
}
|
|
1175
1175
|
this.charBuffer = new _(6), this.charReceived = 0, this.charLength = 0;
|
|
1176
1176
|
}
|
|
1177
|
-
|
|
1177
|
+
Bt.prototype.write = function(e) {
|
|
1178
1178
|
for (var t = ""; this.charLength;) {
|
|
1179
1179
|
var n = e.length >= this.charLength - this.charReceived ? this.charLength - this.charReceived : e.length;
|
|
1180
1180
|
if (e.copy(this.charBuffer, this.charReceived, 0, n), this.charReceived += n, this.charReceived < this.charLength) return "";
|
|
@@ -1196,7 +1196,7 @@ W.prototype.write = function(e) {
|
|
|
1196
1196
|
return this.charLength += a, this.charReceived += a, this.charBuffer.copy(this.charBuffer, a, 0, a), e.copy(this.charBuffer, 0, 0, a), t.substring(0, i);
|
|
1197
1197
|
}
|
|
1198
1198
|
return t;
|
|
1199
|
-
},
|
|
1199
|
+
}, Bt.prototype.detectIncompleteChar = function(e) {
|
|
1200
1200
|
for (var t = e.length >= 3 ? 3 : e.length; t > 0; t--) {
|
|
1201
1201
|
var n = e[e.length - t];
|
|
1202
1202
|
if (t == 1 && n >> 5 == 6) {
|
|
@@ -1213,7 +1213,7 @@ W.prototype.write = function(e) {
|
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
1215
|
this.charReceived = t;
|
|
1216
|
-
},
|
|
1216
|
+
}, Bt.prototype.end = function(e) {
|
|
1217
1217
|
var t = "";
|
|
1218
1218
|
if (e && e.length && (t = this.write(e)), this.charReceived) {
|
|
1219
1219
|
var n = this.charReceived, r = this.charBuffer, i = this.encoding;
|
|
@@ -1221,47 +1221,47 @@ W.prototype.write = function(e) {
|
|
|
1221
1221
|
}
|
|
1222
1222
|
return t;
|
|
1223
1223
|
};
|
|
1224
|
-
function
|
|
1224
|
+
function Vt(e) {
|
|
1225
1225
|
return e.toString(this.encoding);
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function Ht(e) {
|
|
1228
1228
|
this.charReceived = e.length % 2, this.charLength = this.charReceived ? 2 : 0;
|
|
1229
1229
|
}
|
|
1230
|
-
function
|
|
1230
|
+
function Ut(e) {
|
|
1231
1231
|
this.charReceived = e.length % 3, this.charLength = this.charReceived ? 3 : 0;
|
|
1232
1232
|
}
|
|
1233
|
-
|
|
1234
|
-
var
|
|
1235
|
-
|
|
1236
|
-
function
|
|
1233
|
+
V.ReadableState = Kt;
|
|
1234
|
+
var B = ht("stream");
|
|
1235
|
+
I(V, k);
|
|
1236
|
+
function Wt(e, t, n) {
|
|
1237
1237
|
if (typeof e.prependListener == "function") return e.prependListener(t, n);
|
|
1238
1238
|
!e._events || !e._events[t] ? e.on(t, n) : Array.isArray(e._events[t]) ? e._events[t].unshift(n) : e._events[t] = [n, e._events[t]];
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1240
|
+
function Gt(e, t) {
|
|
1241
1241
|
return e.listeners(t).length;
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1244
|
-
e ||= {}, this.objectMode = !!e.objectMode, t instanceof
|
|
1243
|
+
function Kt(e, t) {
|
|
1244
|
+
e ||= {}, this.objectMode = !!e.objectMode, t instanceof U && (this.objectMode = this.objectMode || !!e.readableObjectMode);
|
|
1245
1245
|
var n = e.highWaterMark, r = this.objectMode ? 16 : 16384;
|
|
1246
|
-
this.highWaterMark = n || n === 0 ? n : r, this.highWaterMark = ~~this.highWaterMark, this.buffer = new
|
|
1246
|
+
this.highWaterMark = n || n === 0 ? n : r, this.highWaterMark = ~~this.highWaterMark, this.buffer = new z(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.defaultEncoding = e.defaultEncoding || "utf8", this.ranOut = !1, this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, e.encoding && (this.decoder = new Bt(e.encoding), this.encoding = e.encoding);
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1249
|
-
if (!(this instanceof
|
|
1250
|
-
this._readableState = new
|
|
1248
|
+
function V(e) {
|
|
1249
|
+
if (!(this instanceof V)) return new V(e);
|
|
1250
|
+
this._readableState = new Kt(e, this), this.readable = !0, e && typeof e.read == "function" && (this._read = e.read), k.call(this);
|
|
1251
1251
|
}
|
|
1252
|
-
|
|
1252
|
+
V.prototype.push = function(e, t) {
|
|
1253
1253
|
var n = this._readableState;
|
|
1254
|
-
return !n.objectMode && typeof e == "string" && (t ||= n.defaultEncoding, t !== n.encoding && (e = _.from(e, t), t = "")),
|
|
1255
|
-
},
|
|
1254
|
+
return !n.objectMode && typeof e == "string" && (t ||= n.defaultEncoding, t !== n.encoding && (e = _.from(e, t), t = "")), qt(this, n, e, t, !1);
|
|
1255
|
+
}, V.prototype.unshift = function(e) {
|
|
1256
1256
|
var t = this._readableState;
|
|
1257
|
-
return
|
|
1258
|
-
},
|
|
1257
|
+
return qt(this, t, e, "", !0);
|
|
1258
|
+
}, V.prototype.isPaused = function() {
|
|
1259
1259
|
return this._readableState.flowing === !1;
|
|
1260
1260
|
};
|
|
1261
|
-
function
|
|
1262
|
-
var a =
|
|
1261
|
+
function qt(e, t, n, r, i) {
|
|
1262
|
+
var a = Qt(t, n);
|
|
1263
1263
|
if (a) e.emit("error", a);
|
|
1264
|
-
else if (n === null) t.reading = !1,
|
|
1264
|
+
else if (n === null) t.reading = !1, $t(e, t);
|
|
1265
1265
|
else if (t.objectMode || n && n.length > 0) {
|
|
1266
1266
|
if (t.ended && !i) {
|
|
1267
1267
|
var o = /* @__PURE__ */ Error("stream.push() after EOF");
|
|
@@ -1271,64 +1271,64 @@ function Ht(e, t, n, r, i) {
|
|
|
1271
1271
|
e.emit("error", s);
|
|
1272
1272
|
} else {
|
|
1273
1273
|
var c;
|
|
1274
|
-
t.decoder && !i && !r && (n = t.decoder.write(n), c = !t.objectMode && n.length === 0), i || (t.reading = !1), c || (t.flowing && t.length === 0 && !t.sync ? (e.emit("data", n), e.read(0)) : (t.length += t.objectMode ? 1 : n.length, i ? t.buffer.unshift(n) : t.buffer.push(n), t.needReadable &&
|
|
1274
|
+
t.decoder && !i && !r && (n = t.decoder.write(n), c = !t.objectMode && n.length === 0), i || (t.reading = !1), c || (t.flowing && t.length === 0 && !t.sync ? (e.emit("data", n), e.read(0)) : (t.length += t.objectMode ? 1 : n.length, i ? t.buffer.unshift(n) : t.buffer.push(n), t.needReadable && en(e))), nn(e, t);
|
|
1275
1275
|
}
|
|
1276
1276
|
} else i || (t.reading = !1);
|
|
1277
|
-
return
|
|
1277
|
+
return Jt(t);
|
|
1278
1278
|
}
|
|
1279
|
-
function
|
|
1279
|
+
function Jt(e) {
|
|
1280
1280
|
return !e.ended && (e.needReadable || e.length < e.highWaterMark || e.length === 0);
|
|
1281
1281
|
}
|
|
1282
|
-
|
|
1283
|
-
return this._readableState.decoder = new
|
|
1282
|
+
V.prototype.setEncoding = function(e) {
|
|
1283
|
+
return this._readableState.decoder = new Bt(e), this._readableState.encoding = e, this;
|
|
1284
1284
|
};
|
|
1285
|
-
var
|
|
1286
|
-
function
|
|
1287
|
-
return e >=
|
|
1285
|
+
var Yt = 8388608;
|
|
1286
|
+
function Xt(e) {
|
|
1287
|
+
return e >= Yt ? e = Yt : (e--, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e++), e;
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1290
|
-
return e <= 0 || t.length === 0 && t.ended ? 0 : t.objectMode ? 1 : e === e ? (e > t.highWaterMark && (t.highWaterMark =
|
|
1289
|
+
function Zt(e, t) {
|
|
1290
|
+
return e <= 0 || t.length === 0 && t.ended ? 0 : t.objectMode ? 1 : e === e ? (e > t.highWaterMark && (t.highWaterMark = Xt(e)), e <= t.length ? e : t.ended ? t.length : (t.needReadable = !0, 0)) : t.flowing && t.length ? t.buffer.head.data.length : t.length;
|
|
1291
1291
|
}
|
|
1292
|
-
|
|
1293
|
-
|
|
1292
|
+
V.prototype.read = function(e) {
|
|
1293
|
+
B("read", e), e = parseInt(e, 10);
|
|
1294
1294
|
var t = this._readableState, n = e;
|
|
1295
|
-
if (e !== 0 && (t.emittedReadable = !1), e === 0 && t.needReadable && (t.length >= t.highWaterMark || t.ended)) return
|
|
1296
|
-
if (e =
|
|
1295
|
+
if (e !== 0 && (t.emittedReadable = !1), e === 0 && t.needReadable && (t.length >= t.highWaterMark || t.ended)) return B("read: emitReadable", t.length, t.ended), t.length === 0 && t.ended ? mn(this) : en(this), null;
|
|
1296
|
+
if (e = Zt(e, t), e === 0 && t.ended) return t.length === 0 && mn(this), null;
|
|
1297
1297
|
var r = t.needReadable;
|
|
1298
|
-
|
|
1299
|
-
var i = e > 0 ?
|
|
1300
|
-
return i === null ? (t.needReadable = !0, e = 0) : t.length -= e, t.length === 0 && (t.ended || (t.needReadable = !0), n !== e && t.ended &&
|
|
1298
|
+
B("need readable", r), (t.length === 0 || t.length - e < t.highWaterMark) && (r = !0, B("length less than watermark", r)), t.ended || t.reading ? (r = !1, B("reading or ended", r)) : r && (B("do read"), t.reading = !0, t.sync = !0, t.length === 0 && (t.needReadable = !0), this._read(t.highWaterMark), t.sync = !1, t.reading || (e = Zt(n, t)));
|
|
1299
|
+
var i = e > 0 ? un(e, t) : null;
|
|
1300
|
+
return i === null ? (t.needReadable = !0, e = 0) : t.length -= e, t.length === 0 && (t.ended || (t.needReadable = !0), n !== e && t.ended && mn(this)), i !== null && this.emit("data", i), i;
|
|
1301
1301
|
};
|
|
1302
|
-
function
|
|
1302
|
+
function Qt(e, t) {
|
|
1303
1303
|
var n = null;
|
|
1304
|
-
return !
|
|
1304
|
+
return !D(t) && typeof t != "string" && t != null && !e.objectMode && (n = /* @__PURE__ */ TypeError("Invalid non-string/buffer chunk")), n;
|
|
1305
1305
|
}
|
|
1306
|
-
function
|
|
1306
|
+
function $t(e, t) {
|
|
1307
1307
|
if (!t.ended) {
|
|
1308
1308
|
if (t.decoder) {
|
|
1309
1309
|
var n = t.decoder.end();
|
|
1310
1310
|
n && n.length && (t.buffer.push(n), t.length += t.objectMode ? 1 : n.length);
|
|
1311
1311
|
}
|
|
1312
|
-
t.ended = !0,
|
|
1312
|
+
t.ended = !0, en(e);
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function en(e) {
|
|
1316
1316
|
var t = e._readableState;
|
|
1317
|
-
t.needReadable = !1, t.emittedReadable || (
|
|
1317
|
+
t.needReadable = !1, t.emittedReadable || (B("emitReadable", t.flowing), t.emittedReadable = !0, t.sync ? F(tn, e) : tn(e));
|
|
1318
1318
|
}
|
|
1319
|
-
function
|
|
1320
|
-
|
|
1319
|
+
function tn(e) {
|
|
1320
|
+
B("emit readable"), e.emit("readable"), ln(e);
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1323
|
-
t.readingMore || (t.readingMore = !0,
|
|
1322
|
+
function nn(e, t) {
|
|
1323
|
+
t.readingMore || (t.readingMore = !0, F(rn, e, t));
|
|
1324
1324
|
}
|
|
1325
|
-
function
|
|
1326
|
-
for (var n = t.length; !t.reading && !t.flowing && !t.ended && t.length < t.highWaterMark && (
|
|
1325
|
+
function rn(e, t) {
|
|
1326
|
+
for (var n = t.length; !t.reading && !t.flowing && !t.ended && t.length < t.highWaterMark && (B("maybeReadMore read 0"), e.read(0), n !== t.length);) n = t.length;
|
|
1327
1327
|
t.readingMore = !1;
|
|
1328
1328
|
}
|
|
1329
|
-
|
|
1329
|
+
V.prototype._read = function(e) {
|
|
1330
1330
|
this.emit("error", /* @__PURE__ */ Error("not implemented"));
|
|
1331
|
-
},
|
|
1331
|
+
}, V.prototype.pipe = function(e, t) {
|
|
1332
1332
|
var n = this, r = this._readableState;
|
|
1333
1333
|
switch (r.pipesCount) {
|
|
1334
1334
|
case 0:
|
|
@@ -1339,50 +1339,50 @@ K.prototype._read = function(e) {
|
|
|
1339
1339
|
break;
|
|
1340
1340
|
default: r.pipes.push(e);
|
|
1341
1341
|
}
|
|
1342
|
-
r.pipesCount += 1,
|
|
1342
|
+
r.pipesCount += 1, B("pipe count=%d opts=%j", r.pipesCount, t);
|
|
1343
1343
|
var i = !t || t.end !== !1 ? o : l;
|
|
1344
|
-
r.endEmitted ?
|
|
1344
|
+
r.endEmitted ? F(i) : n.once("end", i), e.on("unpipe", a);
|
|
1345
1345
|
function a(e) {
|
|
1346
|
-
|
|
1346
|
+
B("onunpipe"), e === n && l();
|
|
1347
1347
|
}
|
|
1348
1348
|
function o() {
|
|
1349
|
-
|
|
1349
|
+
B("onend"), e.end();
|
|
1350
1350
|
}
|
|
1351
|
-
var s =
|
|
1351
|
+
var s = an(n);
|
|
1352
1352
|
e.on("drain", s);
|
|
1353
1353
|
var c = !1;
|
|
1354
1354
|
function l() {
|
|
1355
|
-
|
|
1355
|
+
B("cleanup"), e.removeListener("close", p), e.removeListener("finish", m), e.removeListener("drain", s), e.removeListener("error", f), e.removeListener("unpipe", a), n.removeListener("end", o), n.removeListener("end", l), n.removeListener("data", d), c = !0, r.awaitDrain && (!e._writableState || e._writableState.needDrain) && s();
|
|
1356
1356
|
}
|
|
1357
1357
|
var u = !1;
|
|
1358
1358
|
n.on("data", d);
|
|
1359
1359
|
function d(t) {
|
|
1360
|
-
|
|
1360
|
+
B("ondata"), u = !1, !1 === e.write(t) && !u && ((r.pipesCount === 1 && r.pipes === e || r.pipesCount > 1 && _n(r.pipes, e) !== -1) && !c && (B("false write response, pause", n._readableState.awaitDrain), n._readableState.awaitDrain++, u = !0), n.pause());
|
|
1361
1361
|
}
|
|
1362
1362
|
function f(t) {
|
|
1363
|
-
|
|
1363
|
+
B("onerror", t), h(), e.removeListener("error", f), Gt(e, "error") === 0 && e.emit("error", t);
|
|
1364
1364
|
}
|
|
1365
|
-
|
|
1365
|
+
Wt(e, "error", f);
|
|
1366
1366
|
function p() {
|
|
1367
1367
|
e.removeListener("finish", m), h();
|
|
1368
1368
|
}
|
|
1369
1369
|
e.once("close", p);
|
|
1370
1370
|
function m() {
|
|
1371
|
-
|
|
1371
|
+
B("onfinish"), e.removeListener("close", p), h();
|
|
1372
1372
|
}
|
|
1373
1373
|
e.once("finish", m);
|
|
1374
1374
|
function h() {
|
|
1375
|
-
|
|
1375
|
+
B("unpipe"), n.unpipe(e);
|
|
1376
1376
|
}
|
|
1377
|
-
return e.emit("pipe", n), r.flowing || (
|
|
1377
|
+
return e.emit("pipe", n), r.flowing || (B("pipe resume"), n.resume()), e;
|
|
1378
1378
|
};
|
|
1379
|
-
function
|
|
1379
|
+
function an(e) {
|
|
1380
1380
|
return function() {
|
|
1381
1381
|
var t = e._readableState;
|
|
1382
|
-
|
|
1382
|
+
B("pipeOnDrain", t.awaitDrain), t.awaitDrain && t.awaitDrain--, t.awaitDrain === 0 && e.listeners("data").length && (t.flowing = !0, ln(e));
|
|
1383
1383
|
};
|
|
1384
1384
|
}
|
|
1385
|
-
|
|
1385
|
+
V.prototype.unpipe = function(e) {
|
|
1386
1386
|
var t = this._readableState;
|
|
1387
1387
|
if (t.pipesCount === 0) return this;
|
|
1388
1388
|
if (t.pipesCount === 1) return e && e !== t.pipes ? this : (e ||= t.pipes, t.pipes = null, t.pipesCount = 0, t.flowing = !1, e && e.emit("unpipe", this), this);
|
|
@@ -1392,53 +1392,53 @@ K.prototype.unpipe = function(e) {
|
|
|
1392
1392
|
for (var i = 0; i < r; i++) n[i].emit("unpipe", this);
|
|
1393
1393
|
return this;
|
|
1394
1394
|
}
|
|
1395
|
-
var a =
|
|
1395
|
+
var a = _n(t.pipes, e);
|
|
1396
1396
|
return a === -1 ? this : (t.pipes.splice(a, 1), --t.pipesCount, t.pipesCount === 1 && (t.pipes = t.pipes[0]), e.emit("unpipe", this), this);
|
|
1397
|
-
},
|
|
1398
|
-
var n =
|
|
1397
|
+
}, V.prototype.on = function(e, t) {
|
|
1398
|
+
var n = k.prototype.on.call(this, e, t);
|
|
1399
1399
|
if (e === "data") this._readableState.flowing !== !1 && this.resume();
|
|
1400
1400
|
else if (e === "readable") {
|
|
1401
1401
|
var r = this._readableState;
|
|
1402
|
-
!r.endEmitted && !r.readableListening && (r.readableListening = r.needReadable = !0, r.emittedReadable = !1, r.reading ? r.length &&
|
|
1402
|
+
!r.endEmitted && !r.readableListening && (r.readableListening = r.needReadable = !0, r.emittedReadable = !1, r.reading ? r.length && en(this) : F(on, this));
|
|
1403
1403
|
}
|
|
1404
1404
|
return n;
|
|
1405
|
-
},
|
|
1406
|
-
function
|
|
1407
|
-
|
|
1405
|
+
}, V.prototype.addListener = V.prototype.on;
|
|
1406
|
+
function on(e) {
|
|
1407
|
+
B("readable nexttick read 0"), e.read(0);
|
|
1408
1408
|
}
|
|
1409
|
-
|
|
1409
|
+
V.prototype.resume = function() {
|
|
1410
1410
|
var e = this._readableState;
|
|
1411
|
-
return e.flowing || (
|
|
1411
|
+
return e.flowing || (B("resume"), e.flowing = !0, sn(this, e)), this;
|
|
1412
1412
|
};
|
|
1413
|
-
function
|
|
1414
|
-
t.resumeScheduled || (t.resumeScheduled = !0,
|
|
1413
|
+
function sn(e, t) {
|
|
1414
|
+
t.resumeScheduled || (t.resumeScheduled = !0, F(cn, e, t));
|
|
1415
1415
|
}
|
|
1416
|
-
function
|
|
1417
|
-
t.reading || (
|
|
1416
|
+
function cn(e, t) {
|
|
1417
|
+
t.reading || (B("resume read 0"), e.read(0)), t.resumeScheduled = !1, t.awaitDrain = 0, e.emit("resume"), ln(e), t.flowing && !t.reading && e.read(0);
|
|
1418
1418
|
}
|
|
1419
|
-
|
|
1420
|
-
return
|
|
1419
|
+
V.prototype.pause = function() {
|
|
1420
|
+
return B("call pause flowing=%j", this._readableState.flowing), !1 !== this._readableState.flowing && (B("pause"), this._readableState.flowing = !1, this.emit("pause")), this;
|
|
1421
1421
|
};
|
|
1422
|
-
function
|
|
1422
|
+
function ln(e) {
|
|
1423
1423
|
var t = e._readableState;
|
|
1424
|
-
for (
|
|
1424
|
+
for (B("flow", t.flowing); t.flowing && e.read() !== null;);
|
|
1425
1425
|
}
|
|
1426
|
-
|
|
1426
|
+
V.prototype.wrap = function(e) {
|
|
1427
1427
|
var t = this._readableState, n = !1, r = this;
|
|
1428
1428
|
for (var i in e.on("end", function() {
|
|
1429
|
-
if (
|
|
1429
|
+
if (B("wrapped end"), t.decoder && !t.ended) {
|
|
1430
1430
|
var e = t.decoder.end();
|
|
1431
1431
|
e && e.length && r.push(e);
|
|
1432
1432
|
}
|
|
1433
1433
|
r.push(null);
|
|
1434
1434
|
}), e.on("data", function(i) {
|
|
1435
|
-
|
|
1435
|
+
B("wrapped data"), t.decoder && (i = t.decoder.write(i)), !(t.objectMode && i == null) && (t.objectMode || i && i.length) && (r.push(i) || (n = !0, e.pause()));
|
|
1436
1436
|
}), e) this[i] === void 0 && typeof e[i] == "function" && (this[i] = function(t) {
|
|
1437
1437
|
return function() {
|
|
1438
1438
|
return e[t].apply(e, arguments);
|
|
1439
1439
|
};
|
|
1440
1440
|
}(i));
|
|
1441
|
-
return
|
|
1441
|
+
return gn([
|
|
1442
1442
|
"error",
|
|
1443
1443
|
"close",
|
|
1444
1444
|
"destroy",
|
|
@@ -1447,19 +1447,19 @@ K.prototype.wrap = function(e) {
|
|
|
1447
1447
|
], function(t) {
|
|
1448
1448
|
e.on(t, r.emit.bind(r, t));
|
|
1449
1449
|
}), r._read = function(t) {
|
|
1450
|
-
|
|
1450
|
+
B("wrapped _read", t), n && (n = !1, e.resume());
|
|
1451
1451
|
}, r;
|
|
1452
|
-
},
|
|
1453
|
-
function
|
|
1452
|
+
}, V._fromList = un;
|
|
1453
|
+
function un(e, t) {
|
|
1454
1454
|
if (t.length === 0) return null;
|
|
1455
1455
|
var n;
|
|
1456
|
-
return t.objectMode ? n = t.buffer.shift() : !e || e >= t.length ? (n = t.decoder ? t.buffer.join("") : t.buffer.length === 1 ? t.buffer.head.data : t.buffer.concat(t.length), t.buffer.clear()) : n =
|
|
1456
|
+
return t.objectMode ? n = t.buffer.shift() : !e || e >= t.length ? (n = t.decoder ? t.buffer.join("") : t.buffer.length === 1 ? t.buffer.head.data : t.buffer.concat(t.length), t.buffer.clear()) : n = dn(e, t.buffer, t.decoder), n;
|
|
1457
1457
|
}
|
|
1458
|
-
function
|
|
1458
|
+
function dn(e, t, n) {
|
|
1459
1459
|
var r;
|
|
1460
|
-
return e < t.head.data.length ? (r = t.head.data.slice(0, e), t.head.data = t.head.data.slice(e)) : r = e === t.head.data.length ? t.shift() : n ?
|
|
1460
|
+
return e < t.head.data.length ? (r = t.head.data.slice(0, e), t.head.data = t.head.data.slice(e)) : r = e === t.head.data.length ? t.shift() : n ? fn(e, t) : pn(e, t), r;
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1462
|
+
function fn(e, t) {
|
|
1463
1463
|
var n = t.head, r = 1, i = n.data;
|
|
1464
1464
|
for (e -= i.length; n = n.next;) {
|
|
1465
1465
|
var a = n.data, o = e > a.length ? a.length : e;
|
|
@@ -1471,7 +1471,7 @@ function sn(e, t) {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
return t.length -= r, i;
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1474
|
+
function pn(e, t) {
|
|
1475
1475
|
var n = _.allocUnsafe(e), r = t.head, i = 1;
|
|
1476
1476
|
for (r.data.copy(n), e -= r.data.length; r = r.next;) {
|
|
1477
1477
|
var a = r.data, o = e > a.length ? a.length : e;
|
|
@@ -1483,66 +1483,66 @@ function cn(e, t) {
|
|
|
1483
1483
|
}
|
|
1484
1484
|
return t.length -= i, n;
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function mn(e) {
|
|
1487
1487
|
var t = e._readableState;
|
|
1488
1488
|
if (t.length > 0) throw Error("\"endReadable()\" called on non-empty stream");
|
|
1489
|
-
t.endEmitted || (t.ended = !0,
|
|
1489
|
+
t.endEmitted || (t.ended = !0, F(hn, t, e));
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1491
|
+
function hn(e, t) {
|
|
1492
1492
|
!e.endEmitted && e.length === 0 && (e.endEmitted = !0, t.readable = !1, t.emit("end"));
|
|
1493
1493
|
}
|
|
1494
|
-
function
|
|
1494
|
+
function gn(e, t) {
|
|
1495
1495
|
for (var n = 0, r = e.length; n < r; n++) t(e[n], n);
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1497
|
+
function _n(e, t) {
|
|
1498
1498
|
for (var n = 0, r = e.length; n < r; n++) if (e[n] === t) return n;
|
|
1499
1499
|
return -1;
|
|
1500
1500
|
}
|
|
1501
|
-
|
|
1502
|
-
function
|
|
1503
|
-
function
|
|
1501
|
+
H.WritableState = bn, I(H, k);
|
|
1502
|
+
function vn() {}
|
|
1503
|
+
function yn(e, t, n) {
|
|
1504
1504
|
this.chunk = e, this.encoding = t, this.callback = n, this.next = null;
|
|
1505
1505
|
}
|
|
1506
|
-
function
|
|
1507
|
-
Object.defineProperty(this, "buffer", { get:
|
|
1506
|
+
function bn(e, t) {
|
|
1507
|
+
Object.defineProperty(this, "buffer", { get: ft(function() {
|
|
1508
1508
|
return this.getBuffer();
|
|
1509
|
-
}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.") }), e ||= {}, this.objectMode = !!e.objectMode, t instanceof
|
|
1509
|
+
}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.") }), e ||= {}, this.objectMode = !!e.objectMode, t instanceof U && (this.objectMode = this.objectMode || !!e.writableObjectMode);
|
|
1510
1510
|
var n = e.highWaterMark, r = this.objectMode ? 16 : 16384;
|
|
1511
1511
|
this.highWaterMark = n || n === 0 ? n : r, this.highWaterMark = ~~this.highWaterMark, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1;
|
|
1512
1512
|
var i = e.decodeStrings === !1;
|
|
1513
1513
|
this.decodeStrings = !i, this.defaultEncoding = e.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(e) {
|
|
1514
|
-
|
|
1515
|
-
}, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new
|
|
1514
|
+
On(t, e);
|
|
1515
|
+
}, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new In(this);
|
|
1516
1516
|
}
|
|
1517
|
-
|
|
1517
|
+
bn.prototype.getBuffer = function() {
|
|
1518
1518
|
for (var e = this.bufferedRequest, t = []; e;) t.push(e), e = e.next;
|
|
1519
1519
|
return t;
|
|
1520
1520
|
};
|
|
1521
|
-
function
|
|
1522
|
-
if (!(this instanceof
|
|
1523
|
-
this._writableState = new
|
|
1521
|
+
function H(e) {
|
|
1522
|
+
if (!(this instanceof H) && !(this instanceof U)) return new H(e);
|
|
1523
|
+
this._writableState = new bn(e, this), this.writable = !0, e && (typeof e.write == "function" && (this._write = e.write), typeof e.writev == "function" && (this._writev = e.writev)), k.call(this);
|
|
1524
1524
|
}
|
|
1525
|
-
|
|
1525
|
+
H.prototype.pipe = function() {
|
|
1526
1526
|
this.emit("error", /* @__PURE__ */ Error("Cannot pipe, not readable"));
|
|
1527
1527
|
};
|
|
1528
|
-
function
|
|
1528
|
+
function xn(e, t) {
|
|
1529
1529
|
var n = /* @__PURE__ */ Error("write after end");
|
|
1530
|
-
e.emit("error", n),
|
|
1530
|
+
e.emit("error", n), F(t, n);
|
|
1531
1531
|
}
|
|
1532
|
-
function
|
|
1532
|
+
function Sn(e, t, n, r) {
|
|
1533
1533
|
var i = !0, a = !1;
|
|
1534
|
-
return n === null ? a = /* @__PURE__ */ TypeError("May not write null values to stream") : !_.isBuffer(n) && typeof n != "string" && n !== void 0 && !t.objectMode && (a = /* @__PURE__ */ TypeError("Invalid non-string/buffer chunk")), a && (e.emit("error", a),
|
|
1534
|
+
return n === null ? a = /* @__PURE__ */ TypeError("May not write null values to stream") : !_.isBuffer(n) && typeof n != "string" && n !== void 0 && !t.objectMode && (a = /* @__PURE__ */ TypeError("Invalid non-string/buffer chunk")), a && (e.emit("error", a), F(r, a), i = !1), i;
|
|
1535
1535
|
}
|
|
1536
|
-
|
|
1536
|
+
H.prototype.write = function(e, t, n) {
|
|
1537
1537
|
var r = this._writableState, i = !1;
|
|
1538
|
-
return typeof t == "function" && (n = t, t = null), _.isBuffer(e) ? t = "buffer" : t ||= r.defaultEncoding, typeof n != "function" && (n =
|
|
1539
|
-
},
|
|
1538
|
+
return typeof t == "function" && (n = t, t = null), _.isBuffer(e) ? t = "buffer" : t ||= r.defaultEncoding, typeof n != "function" && (n = vn), r.ended ? xn(this, n) : Sn(this, r, e, n) && (r.pendingcb++, i = wn(this, r, e, t, n)), i;
|
|
1539
|
+
}, H.prototype.cork = function() {
|
|
1540
1540
|
var e = this._writableState;
|
|
1541
1541
|
e.corked++;
|
|
1542
|
-
},
|
|
1542
|
+
}, H.prototype.uncork = function() {
|
|
1543
1543
|
var e = this._writableState;
|
|
1544
|
-
e.corked && (e.corked--, !e.writing && !e.corked && !e.finished && !e.bufferProcessing && e.bufferedRequest &&
|
|
1545
|
-
},
|
|
1544
|
+
e.corked && (e.corked--, !e.writing && !e.corked && !e.finished && !e.bufferProcessing && e.bufferedRequest && jn(this, e));
|
|
1545
|
+
}, H.prototype.setDefaultEncoding = function(e) {
|
|
1546
1546
|
if (typeof e == "string" && (e = e.toLowerCase()), !([
|
|
1547
1547
|
"hex",
|
|
1548
1548
|
"utf8",
|
|
@@ -1558,80 +1558,80 @@ q.prototype.write = function(e, t, n) {
|
|
|
1558
1558
|
].indexOf((e + "").toLowerCase()) > -1)) throw TypeError("Unknown encoding: " + e);
|
|
1559
1559
|
return this._writableState.defaultEncoding = e, this;
|
|
1560
1560
|
};
|
|
1561
|
-
function
|
|
1561
|
+
function Cn(e, t, n) {
|
|
1562
1562
|
return !e.objectMode && e.decodeStrings !== !1 && typeof t == "string" && (t = _.from(t, n)), t;
|
|
1563
1563
|
}
|
|
1564
|
-
function
|
|
1565
|
-
n =
|
|
1564
|
+
function wn(e, t, n, r, i) {
|
|
1565
|
+
n = Cn(t, n, r), _.isBuffer(n) && (r = "buffer");
|
|
1566
1566
|
var a = t.objectMode ? 1 : n.length;
|
|
1567
1567
|
t.length += a;
|
|
1568
1568
|
var o = t.length < t.highWaterMark;
|
|
1569
1569
|
if (o || (t.needDrain = !0), t.writing || t.corked) {
|
|
1570
1570
|
var s = t.lastBufferedRequest;
|
|
1571
|
-
t.lastBufferedRequest = new
|
|
1572
|
-
} else
|
|
1571
|
+
t.lastBufferedRequest = new yn(n, r, i), s ? s.next = t.lastBufferedRequest : t.bufferedRequest = t.lastBufferedRequest, t.bufferedRequestCount += 1;
|
|
1572
|
+
} else Tn(e, t, !1, a, n, r, i);
|
|
1573
1573
|
return o;
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1575
|
+
function Tn(e, t, n, r, i, a, o) {
|
|
1576
1576
|
t.writelen = r, t.writecb = o, t.writing = !0, t.sync = !0, n ? e._writev(i, t.onwrite) : e._write(i, a, t.onwrite), t.sync = !1;
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1579
|
-
--t.pendingcb, n ?
|
|
1578
|
+
function En(e, t, n, r, i) {
|
|
1579
|
+
--t.pendingcb, n ? F(i, r) : i(r), e._writableState.errorEmitted = !0, e.emit("error", r);
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1581
|
+
function Dn(e) {
|
|
1582
1582
|
e.writing = !1, e.writecb = null, e.length -= e.writelen, e.writelen = 0;
|
|
1583
1583
|
}
|
|
1584
|
-
function
|
|
1584
|
+
function On(e, t) {
|
|
1585
1585
|
var n = e._writableState, r = n.sync, i = n.writecb;
|
|
1586
|
-
if (
|
|
1586
|
+
if (Dn(n), t) En(e, n, r, t, i);
|
|
1587
1587
|
else {
|
|
1588
|
-
var a =
|
|
1589
|
-
!a && !n.corked && !n.bufferProcessing && n.bufferedRequest &&
|
|
1588
|
+
var a = Mn(n);
|
|
1589
|
+
!a && !n.corked && !n.bufferProcessing && n.bufferedRequest && jn(e, n), r ? F(kn, e, n, a, i) : kn(e, n, a, i);
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
1592
|
-
function
|
|
1593
|
-
n ||
|
|
1592
|
+
function kn(e, t, n, r) {
|
|
1593
|
+
n || An(e, t), t.pendingcb--, r(), Pn(e, t);
|
|
1594
1594
|
}
|
|
1595
|
-
function
|
|
1595
|
+
function An(e, t) {
|
|
1596
1596
|
t.length === 0 && t.needDrain && (t.needDrain = !1, e.emit("drain"));
|
|
1597
1597
|
}
|
|
1598
|
-
function
|
|
1598
|
+
function jn(e, t) {
|
|
1599
1599
|
t.bufferProcessing = !0;
|
|
1600
1600
|
var n = t.bufferedRequest;
|
|
1601
1601
|
if (e._writev && n && n.next) {
|
|
1602
1602
|
var r = t.bufferedRequestCount, i = Array(r), a = t.corkedRequestsFree;
|
|
1603
1603
|
a.entry = n;
|
|
1604
1604
|
for (var o = 0; n;) i[o] = n, n = n.next, o += 1;
|
|
1605
|
-
|
|
1605
|
+
Tn(e, t, !0, t.length, i, "", a.finish), t.pendingcb++, t.lastBufferedRequest = null, a.next ? (t.corkedRequestsFree = a.next, a.next = null) : t.corkedRequestsFree = new In(t);
|
|
1606
1606
|
} else {
|
|
1607
1607
|
for (; n;) {
|
|
1608
1608
|
var s = n.chunk, c = n.encoding, l = n.callback;
|
|
1609
|
-
if (
|
|
1609
|
+
if (Tn(e, t, !1, t.objectMode ? 1 : s.length, s, c, l), n = n.next, t.writing) break;
|
|
1610
1610
|
}
|
|
1611
1611
|
n === null && (t.lastBufferedRequest = null);
|
|
1612
1612
|
}
|
|
1613
1613
|
t.bufferedRequestCount = 0, t.bufferedRequest = n, t.bufferProcessing = !1;
|
|
1614
1614
|
}
|
|
1615
|
-
|
|
1615
|
+
H.prototype._write = function(e, t, n) {
|
|
1616
1616
|
n(/* @__PURE__ */ Error("not implemented"));
|
|
1617
|
-
},
|
|
1617
|
+
}, H.prototype._writev = null, H.prototype.end = function(e, t, n) {
|
|
1618
1618
|
var r = this._writableState;
|
|
1619
|
-
typeof e == "function" ? (n = e, e = null, t = null) : typeof t == "function" && (n = t, t = null), e != null && this.write(e, t), r.corked && (r.corked = 1, this.uncork()), !r.ending && !r.finished &&
|
|
1619
|
+
typeof e == "function" ? (n = e, e = null, t = null) : typeof t == "function" && (n = t, t = null), e != null && this.write(e, t), r.corked && (r.corked = 1, this.uncork()), !r.ending && !r.finished && Fn(this, r, n);
|
|
1620
1620
|
};
|
|
1621
|
-
function
|
|
1621
|
+
function Mn(e) {
|
|
1622
1622
|
return e.ending && e.length === 0 && e.bufferedRequest === null && !e.finished && !e.writing;
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1624
|
+
function Nn(e, t) {
|
|
1625
1625
|
t.prefinished || (t.prefinished = !0, e.emit("prefinish"));
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1628
|
-
var n =
|
|
1629
|
-
return n && (t.pendingcb === 0 ? (
|
|
1627
|
+
function Pn(e, t) {
|
|
1628
|
+
var n = Mn(t);
|
|
1629
|
+
return n && (t.pendingcb === 0 ? (Nn(e, t), t.finished = !0, e.emit("finish")) : Nn(e, t)), n;
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1632
|
-
t.ending = !0,
|
|
1631
|
+
function Fn(e, t, n) {
|
|
1632
|
+
t.ending = !0, Pn(e, t), n && (t.finished ? F(n) : e.once("finish", n)), t.ended = !0, e.writable = !1;
|
|
1633
1633
|
}
|
|
1634
|
-
function
|
|
1634
|
+
function In(e) {
|
|
1635
1635
|
var t = this;
|
|
1636
1636
|
this.next = null, this.entry = null, this.finish = function(n) {
|
|
1637
1637
|
var r = t.entry;
|
|
@@ -1642,28 +1642,28 @@ function jn(e) {
|
|
|
1642
1642
|
e.corkedRequestsFree ? e.corkedRequestsFree.next = t : e.corkedRequestsFree = t;
|
|
1643
1643
|
};
|
|
1644
1644
|
}
|
|
1645
|
-
|
|
1646
|
-
for (var
|
|
1647
|
-
var
|
|
1648
|
-
|
|
1645
|
+
I(U, V);
|
|
1646
|
+
for (var Ln = Object.keys(H.prototype), Rn = 0; Rn < Ln.length; Rn++) {
|
|
1647
|
+
var zn = Ln[Rn];
|
|
1648
|
+
U.prototype[zn] || (U.prototype[zn] = H.prototype[zn]);
|
|
1649
1649
|
}
|
|
1650
|
-
function
|
|
1651
|
-
if (!(this instanceof
|
|
1652
|
-
|
|
1650
|
+
function U(e) {
|
|
1651
|
+
if (!(this instanceof U)) return new U(e);
|
|
1652
|
+
V.call(this, e), H.call(this, e), e && e.readable === !1 && (this.readable = !1), e && e.writable === !1 && (this.writable = !1), this.allowHalfOpen = !0, e && e.allowHalfOpen === !1 && (this.allowHalfOpen = !1), this.once("end", Bn);
|
|
1653
1653
|
}
|
|
1654
|
-
function
|
|
1655
|
-
this.allowHalfOpen || this._writableState.ended ||
|
|
1654
|
+
function Bn() {
|
|
1655
|
+
this.allowHalfOpen || this._writableState.ended || F(Vn, this);
|
|
1656
1656
|
}
|
|
1657
|
-
function
|
|
1657
|
+
function Vn(e) {
|
|
1658
1658
|
e.end();
|
|
1659
1659
|
}
|
|
1660
|
-
|
|
1661
|
-
function
|
|
1660
|
+
I(W, U);
|
|
1661
|
+
function Hn(e) {
|
|
1662
1662
|
this.afterTransform = function(t, n) {
|
|
1663
|
-
return
|
|
1663
|
+
return Un(e, t, n);
|
|
1664
1664
|
}, this.needTransform = !1, this.transforming = !1, this.writecb = null, this.writechunk = null, this.writeencoding = null;
|
|
1665
1665
|
}
|
|
1666
|
-
function
|
|
1666
|
+
function Un(e, t, n) {
|
|
1667
1667
|
var r = e._transformState;
|
|
1668
1668
|
r.transforming = !1;
|
|
1669
1669
|
var i = r.writecb;
|
|
@@ -1672,49 +1672,49 @@ function Rn(e, t, n) {
|
|
|
1672
1672
|
var a = e._readableState;
|
|
1673
1673
|
a.reading = !1, (a.needReadable || a.length < a.highWaterMark) && e._read(a.highWaterMark);
|
|
1674
1674
|
}
|
|
1675
|
-
function
|
|
1676
|
-
if (!(this instanceof
|
|
1677
|
-
|
|
1675
|
+
function W(e) {
|
|
1676
|
+
if (!(this instanceof W)) return new W(e);
|
|
1677
|
+
U.call(this, e), this._transformState = new Hn(this);
|
|
1678
1678
|
var t = this;
|
|
1679
1679
|
this._readableState.needReadable = !0, this._readableState.sync = !1, e && (typeof e.transform == "function" && (this._transform = e.transform), typeof e.flush == "function" && (this._flush = e.flush)), this.once("prefinish", function() {
|
|
1680
1680
|
typeof this._flush == "function" ? this._flush(function(e) {
|
|
1681
|
-
|
|
1682
|
-
}) :
|
|
1681
|
+
Wn(t, e);
|
|
1682
|
+
}) : Wn(t);
|
|
1683
1683
|
});
|
|
1684
1684
|
}
|
|
1685
|
-
|
|
1686
|
-
return this._transformState.needTransform = !1,
|
|
1687
|
-
},
|
|
1685
|
+
W.prototype.push = function(e, t) {
|
|
1686
|
+
return this._transformState.needTransform = !1, U.prototype.push.call(this, e, t);
|
|
1687
|
+
}, W.prototype._transform = function(e, t, n) {
|
|
1688
1688
|
throw Error("Not implemented");
|
|
1689
|
-
},
|
|
1689
|
+
}, W.prototype._write = function(e, t, n) {
|
|
1690
1690
|
var r = this._transformState;
|
|
1691
1691
|
if (r.writecb = n, r.writechunk = e, r.writeencoding = t, !r.transforming) {
|
|
1692
1692
|
var i = this._readableState;
|
|
1693
1693
|
(r.needTransform || i.needReadable || i.length < i.highWaterMark) && this._read(i.highWaterMark);
|
|
1694
1694
|
}
|
|
1695
|
-
},
|
|
1695
|
+
}, W.prototype._read = function(e) {
|
|
1696
1696
|
var t = this._transformState;
|
|
1697
1697
|
t.writechunk !== null && t.writecb && !t.transforming ? (t.transforming = !0, this._transform(t.writechunk, t.writeencoding, t.afterTransform)) : t.needTransform = !0;
|
|
1698
1698
|
};
|
|
1699
|
-
function
|
|
1699
|
+
function Wn(e, t) {
|
|
1700
1700
|
if (t) return e.emit("error", t);
|
|
1701
1701
|
var n = e._writableState, r = e._transformState;
|
|
1702
1702
|
if (n.length) throw Error("Calling transform done when ws.length != 0");
|
|
1703
1703
|
if (r.transforming) throw Error("Calling transform done when still transforming");
|
|
1704
1704
|
return e.push(null);
|
|
1705
1705
|
}
|
|
1706
|
-
|
|
1707
|
-
function
|
|
1708
|
-
if (!(this instanceof
|
|
1709
|
-
|
|
1706
|
+
I(Gn, W);
|
|
1707
|
+
function Gn(e) {
|
|
1708
|
+
if (!(this instanceof Gn)) return new Gn(e);
|
|
1709
|
+
W.call(this, e);
|
|
1710
1710
|
}
|
|
1711
|
-
|
|
1711
|
+
Gn.prototype._transform = function(e, t, n) {
|
|
1712
1712
|
n(null, e);
|
|
1713
|
-
},
|
|
1714
|
-
function
|
|
1715
|
-
|
|
1713
|
+
}, I(G, k), G.Readable = V, G.Writable = H, G.Duplex = U, G.Transform = W, G.PassThrough = Gn, G.Stream = G;
|
|
1714
|
+
function G() {
|
|
1715
|
+
k.call(this);
|
|
1716
1716
|
}
|
|
1717
|
-
|
|
1717
|
+
G.prototype.pipe = function(e, t) {
|
|
1718
1718
|
var n = this;
|
|
1719
1719
|
function r(t) {
|
|
1720
1720
|
e.writable && !1 === e.write(t) && n.pause && n.pause();
|
|
@@ -1732,7 +1732,7 @@ Z.prototype.pipe = function(e, t) {
|
|
|
1732
1732
|
a || (a = !0, typeof e.destroy == "function" && e.destroy());
|
|
1733
1733
|
}
|
|
1734
1734
|
function c(e) {
|
|
1735
|
-
if (l(),
|
|
1735
|
+
if (l(), k.listenerCount(this, "error") === 0) throw e;
|
|
1736
1736
|
}
|
|
1737
1737
|
n.on("error", c), e.on("error", c);
|
|
1738
1738
|
function l() {
|
|
@@ -1740,42 +1740,42 @@ Z.prototype.pipe = function(e, t) {
|
|
|
1740
1740
|
}
|
|
1741
1741
|
return n.on("end", l), n.on("close", l), e.on("close", l), e.emit("pipe", n), e;
|
|
1742
1742
|
};
|
|
1743
|
-
var
|
|
1743
|
+
var Kn = function(e) {
|
|
1744
1744
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1745
|
-
},
|
|
1745
|
+
}, K = class e extends Error {
|
|
1746
1746
|
constructor(t, n, r, ...i) {
|
|
1747
1747
|
Array.isArray(n) && (n = n.join(" ").trim()), super(n), Error.captureStackTrace !== void 0 && Error.captureStackTrace(this, e), this.code = t;
|
|
1748
1748
|
for (let e of i) for (let t in e) {
|
|
1749
1749
|
let n = e[t];
|
|
1750
|
-
this[t] =
|
|
1750
|
+
this[t] = D(n) ? n.toString(r.encoding) : n == null ? n : JSON.parse(JSON.stringify(n));
|
|
1751
1751
|
}
|
|
1752
1752
|
}
|
|
1753
|
-
},
|
|
1753
|
+
}, qn = function(e) {
|
|
1754
1754
|
let t = [];
|
|
1755
1755
|
for (let n = 0, r = e.length; n < r; n++) {
|
|
1756
1756
|
let r = e[n];
|
|
1757
1757
|
if (r == null || r === !1) t[n] = { disabled: !0 };
|
|
1758
1758
|
else if (typeof r == "string" || typeof r == "number") t[n] = { name: `${r}` };
|
|
1759
|
-
else if (
|
|
1760
|
-
if (typeof r.name != "string") throw new
|
|
1759
|
+
else if (Kn(r)) {
|
|
1760
|
+
if (typeof r.name != "string") throw new K("CSV_OPTION_COLUMNS_MISSING_NAME", [
|
|
1761
1761
|
"Option columns missing name:",
|
|
1762
1762
|
`property "name" is required at position ${n}`,
|
|
1763
1763
|
"when column is an object literal"
|
|
1764
1764
|
]);
|
|
1765
1765
|
t[n] = r;
|
|
1766
|
-
} else throw new
|
|
1766
|
+
} else throw new K("CSV_INVALID_COLUMN_DEFINITION", [
|
|
1767
1767
|
"Invalid column definition:",
|
|
1768
1768
|
"expect a string or a literal object,",
|
|
1769
1769
|
`got ${JSON.stringify(r)} at position ${n}`
|
|
1770
1770
|
]);
|
|
1771
1771
|
}
|
|
1772
1772
|
return t;
|
|
1773
|
-
},
|
|
1773
|
+
}, Jn = class {
|
|
1774
1774
|
constructor(e = 100) {
|
|
1775
1775
|
this.size = e, this.length = 0, this.buf = _.allocUnsafe(e);
|
|
1776
1776
|
}
|
|
1777
1777
|
prepend(e) {
|
|
1778
|
-
if (
|
|
1778
|
+
if (D(e)) {
|
|
1779
1779
|
let t = this.length + e.length;
|
|
1780
1780
|
if (t >= this.size && (this.resize(), t >= this.size)) throw Error("INVALID_BUFFER_STATE");
|
|
1781
1781
|
let n = this.buf;
|
|
@@ -1809,7 +1809,7 @@ var Bn = function(e) {
|
|
|
1809
1809
|
reset() {
|
|
1810
1810
|
this.length = 0;
|
|
1811
1811
|
}
|
|
1812
|
-
},
|
|
1812
|
+
}, Yn = function(e) {
|
|
1813
1813
|
let t = [
|
|
1814
1814
|
32,
|
|
1815
1815
|
9,
|
|
@@ -1851,15 +1851,15 @@ var Bn = function(e) {
|
|
|
1851
1851
|
error: void 0,
|
|
1852
1852
|
enabled: e.from_line === 1,
|
|
1853
1853
|
escaping: !1,
|
|
1854
|
-
escapeIsQuote:
|
|
1854
|
+
escapeIsQuote: D(e.escape) && D(e.quote) && _.compare(e.escape, e.quote) === 0,
|
|
1855
1855
|
expectedRecordLength: Array.isArray(e.columns) ? e.columns.length : void 0,
|
|
1856
|
-
field: new
|
|
1856
|
+
field: new Jn(20),
|
|
1857
1857
|
firstLineToHeaders: e.cast_first_line_to_header,
|
|
1858
1858
|
needMoreDataSize: Math.max(e.comment === null ? 0 : e.comment.length, ...e.delimiter ? e.delimiter.map((e) => e.length) : [], +!!e.delimiter_auto, e.quote === null ? 0 : e.quote.length, ...t.map((e) => e.length)),
|
|
1859
1859
|
previousBuf: void 0,
|
|
1860
1860
|
quoting: !1,
|
|
1861
1861
|
stop: !1,
|
|
1862
|
-
rawBuffer: new
|
|
1862
|
+
rawBuffer: new Jn(100),
|
|
1863
1863
|
record: [],
|
|
1864
1864
|
recordHasError: !1,
|
|
1865
1865
|
record_length: 0,
|
|
@@ -1870,29 +1870,29 @@ var Bn = function(e) {
|
|
|
1870
1870
|
timchars: t,
|
|
1871
1871
|
timcharFirstBytes: n
|
|
1872
1872
|
};
|
|
1873
|
-
},
|
|
1873
|
+
}, Xn = function(e) {
|
|
1874
1874
|
return e.replace(/([A-Z])/g, function(e, t) {
|
|
1875
1875
|
return "_" + t.toLowerCase();
|
|
1876
1876
|
});
|
|
1877
|
-
},
|
|
1877
|
+
}, Zn = function(e) {
|
|
1878
1878
|
let t = {};
|
|
1879
|
-
for (let n in e) t[
|
|
1879
|
+
for (let n in e) t[Xn(n)] = e[n];
|
|
1880
1880
|
if (t.encoding === void 0 || t.encoding === !0) t.encoding = "utf8";
|
|
1881
1881
|
else if (t.encoding === null || t.encoding === !1) t.encoding = null;
|
|
1882
|
-
else if (typeof t.encoding != "string" && t.encoding !== null) throw new
|
|
1882
|
+
else if (typeof t.encoding != "string" && t.encoding !== null) throw new K("CSV_INVALID_OPTION_ENCODING", [
|
|
1883
1883
|
"Invalid option encoding:",
|
|
1884
1884
|
"encoding must be a string or null to return a buffer,",
|
|
1885
1885
|
`got ${JSON.stringify(t.encoding)}`
|
|
1886
1886
|
], t);
|
|
1887
1887
|
if (t.bom === void 0 || t.bom === null || t.bom === !1) t.bom = !1;
|
|
1888
|
-
else if (t.bom !== !0) throw new
|
|
1888
|
+
else if (t.bom !== !0) throw new K("CSV_INVALID_OPTION_BOM", [
|
|
1889
1889
|
"Invalid option bom:",
|
|
1890
1890
|
"bom must be true,",
|
|
1891
1891
|
`got ${JSON.stringify(t.bom)}`
|
|
1892
1892
|
], t);
|
|
1893
1893
|
if (t.cast_function = null, t.cast === void 0 || t.cast === null || t.cast === !1 || t.cast === "") t.cast = void 0;
|
|
1894
1894
|
else if (typeof t.cast == "function") t.cast_function = t.cast, t.cast = !0;
|
|
1895
|
-
else if (t.cast !== !0) throw new
|
|
1895
|
+
else if (t.cast !== !0) throw new K("CSV_INVALID_OPTION_CAST", [
|
|
1896
1896
|
"Invalid option cast:",
|
|
1897
1897
|
"cast must be true or a function,",
|
|
1898
1898
|
`got ${JSON.stringify(t.cast)}`
|
|
@@ -1902,42 +1902,42 @@ var Bn = function(e) {
|
|
|
1902
1902
|
let t = Date.parse(e);
|
|
1903
1903
|
return isNaN(t) ? e : new Date(t);
|
|
1904
1904
|
};
|
|
1905
|
-
else if (typeof t.cast_date != "function") throw new
|
|
1905
|
+
else if (typeof t.cast_date != "function") throw new K("CSV_INVALID_OPTION_CAST_DATE", [
|
|
1906
1906
|
"Invalid option cast_date:",
|
|
1907
1907
|
"cast_date must be true or a function,",
|
|
1908
1908
|
`got ${JSON.stringify(t.cast_date)}`
|
|
1909
1909
|
], t);
|
|
1910
1910
|
if (t.cast_first_line_to_header = void 0, t.columns === !0) t.cast_first_line_to_header = void 0;
|
|
1911
1911
|
else if (typeof t.columns == "function") t.cast_first_line_to_header = t.columns, t.columns = !0;
|
|
1912
|
-
else if (Array.isArray(t.columns)) t.columns =
|
|
1912
|
+
else if (Array.isArray(t.columns)) t.columns = qn(t.columns);
|
|
1913
1913
|
else if (t.columns === void 0 || t.columns === null || t.columns === !1) t.columns = !1;
|
|
1914
|
-
else throw new
|
|
1914
|
+
else throw new K("CSV_INVALID_OPTION_COLUMNS", [
|
|
1915
1915
|
"Invalid option columns:",
|
|
1916
1916
|
"expect an array, a function or true,",
|
|
1917
1917
|
`got ${JSON.stringify(t.columns)}`
|
|
1918
1918
|
], t);
|
|
1919
1919
|
if (t.group_columns_by_name === void 0 || t.group_columns_by_name === null || t.group_columns_by_name === !1) t.group_columns_by_name = !1;
|
|
1920
|
-
else if (t.group_columns_by_name !== !0) throw new
|
|
1920
|
+
else if (t.group_columns_by_name !== !0) throw new K("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME", [
|
|
1921
1921
|
"Invalid option group_columns_by_name:",
|
|
1922
1922
|
"expect an boolean,",
|
|
1923
1923
|
`got ${JSON.stringify(t.group_columns_by_name)}`
|
|
1924
1924
|
], t);
|
|
1925
|
-
else if (t.columns === !1) throw new
|
|
1925
|
+
else if (t.columns === !1) throw new K("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME", ["Invalid option group_columns_by_name:", "the `columns` mode must be activated."], t);
|
|
1926
1926
|
if (t.comment === void 0 || t.comment === null || t.comment === !1 || t.comment === "") t.comment = null;
|
|
1927
|
-
else if (typeof t.comment == "string" && (t.comment = _.from(t.comment, t.encoding)), !
|
|
1927
|
+
else if (typeof t.comment == "string" && (t.comment = _.from(t.comment, t.encoding)), !D(t.comment)) throw new K("CSV_INVALID_OPTION_COMMENT", [
|
|
1928
1928
|
"Invalid option comment:",
|
|
1929
1929
|
"comment must be a buffer or a string,",
|
|
1930
1930
|
`got ${JSON.stringify(t.comment)}`
|
|
1931
1931
|
], t);
|
|
1932
1932
|
if (t.comment_no_infix === void 0 || t.comment_no_infix === null || t.comment_no_infix === !1) t.comment_no_infix = !1;
|
|
1933
|
-
else if (t.comment_no_infix !== !0) throw new
|
|
1933
|
+
else if (t.comment_no_infix !== !0) throw new K("CSV_INVALID_OPTION_COMMENT", [
|
|
1934
1934
|
"Invalid option comment_no_infix:",
|
|
1935
1935
|
"value must be a boolean,",
|
|
1936
1936
|
`got ${JSON.stringify(t.comment_no_infix)}`
|
|
1937
1937
|
], t);
|
|
1938
1938
|
if (t.delimiter_auto === void 0 || t.delimiter_auto === null || t.delimiter_auto === !1) t.delimiter_auto = !1;
|
|
1939
1939
|
else if (t.delimiter_auto === !0) t.delimiter_auto = {};
|
|
1940
|
-
else if (!
|
|
1940
|
+
else if (!Kn(t.delimiter_auto)) throw new K("CSV_INVALID_OPTION_DELIMITER_AUTO", [
|
|
1941
1941
|
"Invalid option delimiter_auto:",
|
|
1942
1942
|
"delimiter_auto must be a boolean or a configuration object,",
|
|
1943
1943
|
`got ${JSON.stringify(t.delimiter_auto)}`
|
|
@@ -1952,19 +1952,19 @@ var Bn = function(e) {
|
|
|
1952
1952
|
46: 1.4,
|
|
1953
1953
|
47: 1.4
|
|
1954
1954
|
};
|
|
1955
|
-
else if (!
|
|
1955
|
+
else if (!Kn(t.delimiter_auto.preferred)) throw new K("CSV_INVALID_OPTION_DELIMITER_AUTO", [
|
|
1956
1956
|
"Invalid option delimiter_auto:",
|
|
1957
1957
|
"preferred must be an object,",
|
|
1958
1958
|
`got ${JSON.stringify(t.delimiter_auto.preferred)}`
|
|
1959
1959
|
], t);
|
|
1960
1960
|
if (t.delimiter_auto.score === void 0) t.delimiter_auto.score = (e, t) => (e.total - e.std) * (t.preferred[e.char_code] || 1);
|
|
1961
|
-
else if (typeof t.delimiter_auto.score != "function") throw new
|
|
1961
|
+
else if (typeof t.delimiter_auto.score != "function") throw new K("CSV_INVALID_OPTION_DELIMITER_AUTO", [
|
|
1962
1962
|
"Invalid option delimiter_auto:",
|
|
1963
1963
|
"score must be a function,",
|
|
1964
1964
|
`got ${JSON.stringify(t.delimiter_auto.score)}`
|
|
1965
1965
|
], t);
|
|
1966
1966
|
if (t.delimiter_auto.size === void 0) t.delimiter_auto.size = 2048;
|
|
1967
|
-
else if (typeof t.delimiter_auto.size != "number") throw new
|
|
1967
|
+
else if (typeof t.delimiter_auto.size != "number") throw new K("CSV_INVALID_OPTION_DELIMITER_AUTO", [
|
|
1968
1968
|
"Invalid option delimiter_auto:",
|
|
1969
1969
|
"size must be a number,",
|
|
1970
1970
|
`got ${JSON.stringify(t.delimiter_auto.size)}`
|
|
@@ -1972,13 +1972,13 @@ var Bn = function(e) {
|
|
|
1972
1972
|
}
|
|
1973
1973
|
let n = JSON.stringify(t.delimiter);
|
|
1974
1974
|
if (t.delimiter_auto !== !1 && (t.delimiter = []), Array.isArray(t.delimiter) || ((t.delimiter === void 0 || t.delimiter === null || t.delimiter === !1) && (t.delimiter = _.from(",", t.encoding)), t.delimiter = [t.delimiter]), t.delimiter = t.delimiter.map(function(e) {
|
|
1975
|
-
if (typeof e == "string" && (e = _.from(e, t.encoding)), !
|
|
1975
|
+
if (typeof e == "string" && (e = _.from(e, t.encoding)), !D(e) || e.length === 0) throw new K("CSV_INVALID_OPTION_DELIMITER", [
|
|
1976
1976
|
"Invalid option delimiter:",
|
|
1977
1977
|
"delimiter must be a non empty string or buffer or array of string|buffer,",
|
|
1978
1978
|
`got ${n}`
|
|
1979
1979
|
], t);
|
|
1980
1980
|
return e;
|
|
1981
|
-
}), t.escape === void 0 || t.escape === !0 ? t.escape = _.from("\"", t.encoding) : typeof t.escape == "string" ? t.escape = _.from(t.escape, t.encoding) : (t.escape === null || t.escape === !1) && (t.escape = null), t.escape !== null && !
|
|
1981
|
+
}), t.escape === void 0 || t.escape === !0 ? t.escape = _.from("\"", t.encoding) : typeof t.escape == "string" ? t.escape = _.from(t.escape, t.encoding) : (t.escape === null || t.escape === !1) && (t.escape = null), t.escape !== null && !D(t.escape)) throw Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(t.escape)}`);
|
|
1982
1982
|
if (t.from === void 0 || t.from === null) t.from = 1;
|
|
1983
1983
|
else if (typeof t.from == "string" && /\d+/.test(t.from) && (t.from = parseInt(t.from)), Number.isInteger(t.from)) {
|
|
1984
1984
|
if (t.from < 0) throw Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(e.from)}`);
|
|
@@ -1989,12 +1989,12 @@ var Bn = function(e) {
|
|
|
1989
1989
|
} else throw Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(e.from_line)}`);
|
|
1990
1990
|
if (t.ignore_last_delimiters === void 0 || t.ignore_last_delimiters === null) t.ignore_last_delimiters = !1;
|
|
1991
1991
|
else if (typeof t.ignore_last_delimiters == "number") t.ignore_last_delimiters = Math.floor(t.ignore_last_delimiters), t.ignore_last_delimiters === 0 && (t.ignore_last_delimiters = !1);
|
|
1992
|
-
else if (typeof t.ignore_last_delimiters != "boolean") throw new
|
|
1992
|
+
else if (typeof t.ignore_last_delimiters != "boolean") throw new K("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS", [
|
|
1993
1993
|
"Invalid option `ignore_last_delimiters`:",
|
|
1994
1994
|
"the value must be a boolean value or an integer,",
|
|
1995
1995
|
`got ${JSON.stringify(t.ignore_last_delimiters)}`
|
|
1996
1996
|
], t);
|
|
1997
|
-
if (t.ignore_last_delimiters === !0 && t.columns === !1) throw new
|
|
1997
|
+
if (t.ignore_last_delimiters === !0 && t.columns === !1) throw new K("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS", ["The option `ignore_last_delimiters`", "requires the activation of the `columns` option"], t);
|
|
1998
1998
|
if (t.info === void 0 || t.info === null || t.info === !1) t.info = !1;
|
|
1999
1999
|
else if (t.info !== !0) throw Error(`Invalid Option: info must be true, got ${JSON.stringify(t.info)}`);
|
|
2000
2000
|
if (t.max_record_size === void 0 || t.max_record_size === null || t.max_record_size === !1) t.max_record_size = 0;
|
|
@@ -2003,7 +2003,7 @@ var Bn = function(e) {
|
|
|
2003
2003
|
else throw Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(t.max_record_size)}`);
|
|
2004
2004
|
}
|
|
2005
2005
|
if (t.objname === void 0 || t.objname === null || t.objname === !1) t.objname = void 0;
|
|
2006
|
-
else if (
|
|
2006
|
+
else if (D(t.objname)) {
|
|
2007
2007
|
if (t.objname.length === 0) throw Error("Invalid Option: objname must be a non empty buffer");
|
|
2008
2008
|
t.encoding === null || (t.objname = t.objname.toString(t.encoding));
|
|
2009
2009
|
} else if (typeof t.objname == "string") {
|
|
@@ -2015,37 +2015,37 @@ var Bn = function(e) {
|
|
|
2015
2015
|
} else if (t.columns === !1) throw Error("Invalid Option: objname field must be combined with columns or be defined as an index");
|
|
2016
2016
|
}
|
|
2017
2017
|
if (t.on_record === void 0 || t.on_record === null) t.on_record = void 0;
|
|
2018
|
-
else if (typeof t.on_record != "function") throw new
|
|
2018
|
+
else if (typeof t.on_record != "function") throw new K("CSV_INVALID_OPTION_ON_RECORD", [
|
|
2019
2019
|
"Invalid option `on_record`:",
|
|
2020
2020
|
"expect a function,",
|
|
2021
2021
|
`got ${JSON.stringify(t.on_record)}`
|
|
2022
2022
|
], t);
|
|
2023
2023
|
if (t.on_skip !== void 0 && t.on_skip !== null && typeof t.on_skip != "function") throw Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(t.on_skip)}`);
|
|
2024
2024
|
if (t.quote === null || t.quote === !1 || t.quote === "") t.quote = null;
|
|
2025
|
-
else if (t.quote === void 0 || t.quote === !0 ? t.quote = _.from("\"", t.encoding) : typeof t.quote == "string" && (t.quote = _.from(t.quote, t.encoding)), !
|
|
2025
|
+
else if (t.quote === void 0 || t.quote === !0 ? t.quote = _.from("\"", t.encoding) : typeof t.quote == "string" && (t.quote = _.from(t.quote, t.encoding)), !D(t.quote)) throw Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(t.quote)}`);
|
|
2026
2026
|
if (t.raw === void 0 || t.raw === null || t.raw === !1) t.raw = !1;
|
|
2027
2027
|
else if (t.raw !== !0) throw Error(`Invalid Option: raw must be true, got ${JSON.stringify(t.raw)}`);
|
|
2028
2028
|
if (t.record_delimiter === void 0) t.record_delimiter = [];
|
|
2029
|
-
else if (typeof t.record_delimiter == "string" ||
|
|
2030
|
-
if (t.record_delimiter.length === 0) throw new
|
|
2029
|
+
else if (typeof t.record_delimiter == "string" || D(t.record_delimiter)) {
|
|
2030
|
+
if (t.record_delimiter.length === 0) throw new K("CSV_INVALID_OPTION_RECORD_DELIMITER", [
|
|
2031
2031
|
"Invalid option `record_delimiter`:",
|
|
2032
2032
|
"value must be a non empty string or buffer,",
|
|
2033
2033
|
`got ${JSON.stringify(t.record_delimiter)}`
|
|
2034
2034
|
], t);
|
|
2035
2035
|
t.record_delimiter = [t.record_delimiter];
|
|
2036
|
-
} else if (!Array.isArray(t.record_delimiter)) throw new
|
|
2036
|
+
} else if (!Array.isArray(t.record_delimiter)) throw new K("CSV_INVALID_OPTION_RECORD_DELIMITER", [
|
|
2037
2037
|
"Invalid option `record_delimiter`:",
|
|
2038
2038
|
"value must be a string, a buffer or array of string|buffer,",
|
|
2039
2039
|
`got ${JSON.stringify(t.record_delimiter)}`
|
|
2040
2040
|
], t);
|
|
2041
2041
|
if (t.record_delimiter = t.record_delimiter.map(function(e, n) {
|
|
2042
|
-
if (typeof e != "string" && !
|
|
2042
|
+
if (typeof e != "string" && !D(e)) throw new K("CSV_INVALID_OPTION_RECORD_DELIMITER", [
|
|
2043
2043
|
"Invalid option `record_delimiter`:",
|
|
2044
2044
|
"value must be a string, a buffer or array of string|buffer",
|
|
2045
2045
|
`at index ${n},`,
|
|
2046
2046
|
`got ${JSON.stringify(e)}`
|
|
2047
2047
|
], t);
|
|
2048
|
-
if (e.length === 0) throw new
|
|
2048
|
+
if (e.length === 0) throw new K("CSV_INVALID_OPTION_RECORD_DELIMITER", [
|
|
2049
2049
|
"Invalid option `record_delimiter`:",
|
|
2050
2050
|
"value must be a non empty string or buffer",
|
|
2051
2051
|
`at index ${n},`,
|
|
@@ -2099,9 +2099,9 @@ var Bn = function(e) {
|
|
|
2099
2099
|
} else throw Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(e.to_line)}`);
|
|
2100
2100
|
}
|
|
2101
2101
|
return t;
|
|
2102
|
-
},
|
|
2103
|
-
t || ({delimiter_auto: t} =
|
|
2104
|
-
let t = [], n =
|
|
2102
|
+
}, Qn = function(e, t) {
|
|
2103
|
+
t || ({delimiter_auto: t} = Zn({ delimiter_auto: !0 })), typeof e == "string" && (e = _.from(e)), D(e) && (e = ((e) => {
|
|
2104
|
+
let t = [], n = rr({ delimiter: [] }).parse(e, !0, (e) => t.push(e), () => {});
|
|
2105
2105
|
if (n !== void 0) throw n;
|
|
2106
2106
|
return t;
|
|
2107
2107
|
})(e));
|
|
@@ -2112,25 +2112,25 @@ var Bn = function(e) {
|
|
|
2112
2112
|
n[i].lines[t] === void 0 && (n[i].lines[t] = 0), n[i].lines[t]++;
|
|
2113
2113
|
}
|
|
2114
2114
|
}), n.map((e, n) => {
|
|
2115
|
-
e.char_code = n, e.std =
|
|
2115
|
+
e.char_code = n, e.std = $n(e.lines), e.total = e.lines.reduce((e, t) => e + t, 0), e.preferred = !!t.preferred[n], e.score = t.score(e, t);
|
|
2116
2116
|
});
|
|
2117
2117
|
let r = n.reduce((e, t) => e.score > t.score ? e : t, {});
|
|
2118
2118
|
return String.fromCharCode(r.char_code);
|
|
2119
|
-
},
|
|
2119
|
+
}, $n = function(e) {
|
|
2120
2120
|
let t = e.length;
|
|
2121
2121
|
if (t === 0) return 0;
|
|
2122
2122
|
let n = e.reduce((e, t) => e + t) / t;
|
|
2123
2123
|
return Math.sqrt(e.map((e) => (e - n) ** 2).reduce((e, t) => e + t) / t);
|
|
2124
|
-
},
|
|
2124
|
+
}, er = function(e) {
|
|
2125
2125
|
return e.every((e) => e == null || e.toString && e.toString().trim() === "");
|
|
2126
|
-
},
|
|
2126
|
+
}, tr = 13, nr = 10, q = {
|
|
2127
2127
|
utf8: _.from([
|
|
2128
2128
|
239,
|
|
2129
2129
|
187,
|
|
2130
2130
|
191
|
|
2131
2131
|
]),
|
|
2132
2132
|
utf16le: _.from([255, 254])
|
|
2133
|
-
},
|
|
2133
|
+
}, rr = function(e = {}) {
|
|
2134
2134
|
let t = {
|
|
2135
2135
|
bytes: 0,
|
|
2136
2136
|
bytes_records: 0,
|
|
@@ -2139,47 +2139,47 @@ var Bn = function(e) {
|
|
|
2139
2139
|
invalid_field_length: 0,
|
|
2140
2140
|
lines: 1,
|
|
2141
2141
|
records: 0
|
|
2142
|
-
}, n =
|
|
2142
|
+
}, n = Zn(e);
|
|
2143
2143
|
return {
|
|
2144
2144
|
info: t,
|
|
2145
2145
|
original_options: e,
|
|
2146
2146
|
options: n,
|
|
2147
|
-
state:
|
|
2147
|
+
state: Yn(n),
|
|
2148
2148
|
__needMoreData: function(e, t, n) {
|
|
2149
2149
|
if (n) return !1;
|
|
2150
2150
|
let { encoding: r, escape: i, quote: a } = this.options, { quoting: o, needMoreDataSize: s, recordDelimiterMaxLength: c } = this.state;
|
|
2151
2151
|
return t - e - 1 < Math.max(s, c === 0 ? _.from("\r\n", r).length : c, o ? (i === null ? 0 : i.length) + a.length : 0, o ? a.length + c : 0);
|
|
2152
2152
|
},
|
|
2153
2153
|
parse: function(e, t, n, r) {
|
|
2154
|
-
let { bom: i, comment_no_infix: a, delimiter_auto: o, encoding: s, from_line: c, ltrim: l, max_record_size: u, raw: d, relax_quotes: f, rtrim: p, skip_empty_lines: m, to: h, to_line: g } = this.options, { comment: v, escape: y, quote: b, record_delimiter: x } = this.options, { bomSkipped: ee, delimiterDiscovered: te, delimiterBufPrevious:
|
|
2154
|
+
let { bom: i, comment_no_infix: a, delimiter_auto: o, encoding: s, from_line: c, ltrim: l, max_record_size: u, raw: d, relax_quotes: f, rtrim: p, skip_empty_lines: m, to: h, to_line: g } = this.options, { comment: v, escape: y, quote: b, record_delimiter: x } = this.options, { bomSkipped: ee, delimiterDiscovered: te, delimiterBufPrevious: ne, rawBuffer: re, escapeIsQuote: ie } = this.state;
|
|
2155
2155
|
if (!te && o) {
|
|
2156
2156
|
let n;
|
|
2157
|
-
if (n =
|
|
2157
|
+
if (n = ne === void 0 ? e : ne !== void 0 && e === void 0 ? ne : _.concat([ne, e]), e = void 0, t || n.length > o.size) this.options.delimiter = [_.from(Qn(n, this.options.delimiter_auto))], this.state.previousBuf = n, this.state.delimiterBufPrevious = void 0, this.state.delimiterDiscovered = !0;
|
|
2158
2158
|
else {
|
|
2159
2159
|
this.state.delimiterBufPrevious = n;
|
|
2160
2160
|
return;
|
|
2161
2161
|
}
|
|
2162
2162
|
}
|
|
2163
|
-
let { previousBuf:
|
|
2164
|
-
if (
|
|
2163
|
+
let { previousBuf: S } = this.state, C;
|
|
2164
|
+
if (S === void 0) {
|
|
2165
2165
|
if (e === void 0) {
|
|
2166
2166
|
r();
|
|
2167
2167
|
return;
|
|
2168
2168
|
}
|
|
2169
|
-
|
|
2170
|
-
} else
|
|
2169
|
+
C = e;
|
|
2170
|
+
} else C = S !== void 0 && e === void 0 ? S : _.concat([S, e]);
|
|
2171
2171
|
if (ee === !1) {
|
|
2172
2172
|
if (i === !1) this.state.bomSkipped = !0;
|
|
2173
|
-
else if (
|
|
2173
|
+
else if (C.length < 3) {
|
|
2174
2174
|
if (t === !1) {
|
|
2175
|
-
this.state.previousBuf =
|
|
2175
|
+
this.state.previousBuf = C;
|
|
2176
2176
|
return;
|
|
2177
2177
|
}
|
|
2178
2178
|
} else {
|
|
2179
|
-
for (let e in
|
|
2180
|
-
let t =
|
|
2181
|
-
this.state.bufBytesStart += t,
|
|
2182
|
-
let n =
|
|
2179
|
+
for (let e in q) if (q[e].compare(C, 0, q[e].length) === 0) {
|
|
2180
|
+
let t = q[e].length;
|
|
2181
|
+
this.state.bufBytesStart += t, C = C.slice(t);
|
|
2182
|
+
let n = Zn({
|
|
2183
2183
|
...this.original_options,
|
|
2184
2184
|
encoding: e
|
|
2185
2185
|
});
|
|
@@ -2190,36 +2190,36 @@ var Bn = function(e) {
|
|
|
2190
2190
|
this.state.bomSkipped = !0;
|
|
2191
2191
|
}
|
|
2192
2192
|
}
|
|
2193
|
-
let
|
|
2194
|
-
for (;
|
|
2193
|
+
let ae = C.length, w = 0;
|
|
2194
|
+
for (; w < ae && !this.__needMoreData(w, ae, t); w++) {
|
|
2195
2195
|
if (this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1), g !== -1 && this.info.lines > g) {
|
|
2196
2196
|
this.state.stop = !0, r();
|
|
2197
2197
|
return;
|
|
2198
2198
|
}
|
|
2199
|
-
this.state.quoting === !1 && x.length === 0 && this.__autoDiscoverRecordDelimiter(
|
|
2200
|
-
let e = w
|
|
2201
|
-
if (d === !0 &&
|
|
2199
|
+
this.state.quoting === !1 && x.length === 0 && this.__autoDiscoverRecordDelimiter(C, w) && (x = this.options.record_delimiter);
|
|
2200
|
+
let e = C[w];
|
|
2201
|
+
if (d === !0 && re.append(e), (e === tr || e === nr) && this.state.wasRowDelimiter === !1 && (this.state.wasRowDelimiter = !0), this.state.escaping === !0) this.state.escaping = !1;
|
|
2202
2202
|
else {
|
|
2203
|
-
if (y !== null && this.state.quoting === !0 && this.__isEscape(
|
|
2204
|
-
if (
|
|
2205
|
-
if (this.__isQuote(
|
|
2206
|
-
this.state.escaping = !0,
|
|
2203
|
+
if (y !== null && this.state.quoting === !0 && this.__isEscape(C, w, e) && w + y.length < ae) {
|
|
2204
|
+
if (ie) {
|
|
2205
|
+
if (this.__isQuote(C, w + y.length)) {
|
|
2206
|
+
this.state.escaping = !0, w += y.length - 1;
|
|
2207
2207
|
continue;
|
|
2208
2208
|
}
|
|
2209
2209
|
} else {
|
|
2210
|
-
this.state.escaping = !0,
|
|
2210
|
+
this.state.escaping = !0, w += y.length - 1;
|
|
2211
2211
|
continue;
|
|
2212
2212
|
}
|
|
2213
2213
|
}
|
|
2214
|
-
if (this.state.commenting === !1 && this.__isQuote(
|
|
2214
|
+
if (this.state.commenting === !1 && this.__isQuote(C, w)) {
|
|
2215
2215
|
if (this.state.quoting === !0) {
|
|
2216
|
-
let t = w
|
|
2217
|
-
if (y !== null && this.__isEscape(
|
|
2216
|
+
let t = C[w + b.length], n = p && this.__isCharTrimable(C, w + b.length), r = v !== null && this.__compareBytes(v, C, w + b.length, t), i = this.__isDelimiter(C, w + b.length, t), a = x.length === 0 ? this.__autoDiscoverRecordDelimiter(C, w + b.length) : this.__isRecordDelimiter(t, C, w + b.length);
|
|
2217
|
+
if (y !== null && this.__isEscape(C, w, e) && this.__isQuote(C, w + y.length)) w += y.length - 1;
|
|
2218
2218
|
else if (!t || i || a || r || n) {
|
|
2219
|
-
this.state.quoting = !1, this.state.wasQuoting = !0,
|
|
2219
|
+
this.state.quoting = !1, this.state.wasQuoting = !0, w += b.length - 1;
|
|
2220
2220
|
continue;
|
|
2221
2221
|
} else if (f === !1) {
|
|
2222
|
-
let e = this.__error(new
|
|
2222
|
+
let e = this.__error(new K("CSV_INVALID_CLOSING_QUOTE", [
|
|
2223
2223
|
"Invalid Closing Quote:",
|
|
2224
2224
|
`got "${String.fromCharCode(t)}"`,
|
|
2225
2225
|
`at line ${this.info.lines}`,
|
|
@@ -2227,10 +2227,10 @@ var Bn = function(e) {
|
|
|
2227
2227
|
"(if activated) or comment"
|
|
2228
2228
|
], this.options, this.__infoField()));
|
|
2229
2229
|
if (e !== void 0) return e;
|
|
2230
|
-
} else this.state.quoting = !1, this.state.wasQuoting = !0, this.state.field.prepend(b),
|
|
2230
|
+
} else this.state.quoting = !1, this.state.wasQuoting = !0, this.state.field.prepend(b), w += b.length - 1;
|
|
2231
2231
|
} else if (this.state.field.length !== 0) {
|
|
2232
2232
|
if (f === !1) {
|
|
2233
|
-
let e = this.__infoField(), t = Object.keys(
|
|
2233
|
+
let e = this.__infoField(), t = Object.keys(q).map((e) => q[e].equals(this.state.field.toString()) ? e : !1).filter(Boolean)[0], n = this.__error(new K("INVALID_OPENING_QUOTE", [
|
|
2234
2234
|
"Invalid Opening Quote:",
|
|
2235
2235
|
`a quote is found on field ${JSON.stringify(e.column)} at line ${e.lines}, value is ${JSON.stringify(this.state.field.toString(s))}`,
|
|
2236
2236
|
t ? `(${t} bom)` : void 0
|
|
@@ -2238,27 +2238,27 @@ var Bn = function(e) {
|
|
|
2238
2238
|
if (n !== void 0) return n;
|
|
2239
2239
|
}
|
|
2240
2240
|
} else {
|
|
2241
|
-
this.state.quoting = !0,
|
|
2241
|
+
this.state.quoting = !0, w += b.length - 1;
|
|
2242
2242
|
continue;
|
|
2243
2243
|
}
|
|
2244
2244
|
}
|
|
2245
2245
|
if (this.state.quoting === !1) {
|
|
2246
|
-
let t = this.__isRecordDelimiter(e,
|
|
2246
|
+
let t = this.__isRecordDelimiter(e, C, w);
|
|
2247
2247
|
if (t !== 0) {
|
|
2248
2248
|
if (this.state.commenting && this.state.wasQuoting === !1 && this.state.record.length === 0 && this.state.field.length === 0) this.info.comment_lines++;
|
|
2249
2249
|
else {
|
|
2250
2250
|
if (this.state.enabled === !1 && this.info.lines + +(this.state.wasRowDelimiter === !0) >= c) {
|
|
2251
|
-
this.state.enabled = !0, this.__resetField(), this.__resetRecord(),
|
|
2251
|
+
this.state.enabled = !0, this.__resetField(), this.__resetRecord(), w += t - 1;
|
|
2252
2252
|
continue;
|
|
2253
2253
|
}
|
|
2254
2254
|
if (m === !0 && this.state.wasQuoting === !1 && this.state.record.length === 0 && this.state.field.length === 0) {
|
|
2255
|
-
this.info.empty_lines++,
|
|
2255
|
+
this.info.empty_lines++, w += t - 1;
|
|
2256
2256
|
continue;
|
|
2257
2257
|
}
|
|
2258
|
-
this.info.bytes = this.state.bufBytesStart +
|
|
2258
|
+
this.info.bytes = this.state.bufBytesStart + w;
|
|
2259
2259
|
let e = this.__onField();
|
|
2260
2260
|
if (e !== void 0) return e;
|
|
2261
|
-
this.info.bytes = this.state.bufBytesStart +
|
|
2261
|
+
this.info.bytes = this.state.bufBytesStart + w + t;
|
|
2262
2262
|
let i = this.__onRecord(n);
|
|
2263
2263
|
if (i !== void 0) return i;
|
|
2264
2264
|
if (h !== -1 && this.info.records >= h) {
|
|
@@ -2266,54 +2266,54 @@ var Bn = function(e) {
|
|
|
2266
2266
|
return;
|
|
2267
2267
|
}
|
|
2268
2268
|
}
|
|
2269
|
-
this.state.commenting = !1,
|
|
2269
|
+
this.state.commenting = !1, w += t - 1;
|
|
2270
2270
|
continue;
|
|
2271
2271
|
}
|
|
2272
2272
|
if (this.state.commenting) continue;
|
|
2273
|
-
if (v !== null && (a === !1 || this.state.record.length === 0 && this.state.field.length === 0) && this.__compareBytes(v,
|
|
2273
|
+
if (v !== null && (a === !1 || this.state.record.length === 0 && this.state.field.length === 0) && this.__compareBytes(v, C, w, e) !== 0) {
|
|
2274
2274
|
this.state.commenting = !0;
|
|
2275
2275
|
continue;
|
|
2276
2276
|
}
|
|
2277
|
-
let i = this.__isDelimiter(
|
|
2277
|
+
let i = this.__isDelimiter(C, w, e);
|
|
2278
2278
|
if (i !== 0) {
|
|
2279
|
-
this.info.bytes = this.state.bufBytesStart +
|
|
2279
|
+
this.info.bytes = this.state.bufBytesStart + w;
|
|
2280
2280
|
let e = this.__onField();
|
|
2281
2281
|
if (e !== void 0) return e;
|
|
2282
|
-
|
|
2282
|
+
w += i - 1;
|
|
2283
2283
|
continue;
|
|
2284
2284
|
}
|
|
2285
2285
|
}
|
|
2286
2286
|
}
|
|
2287
|
-
if (this.state.commenting === !1 && u !== 0 && this.state.record_length + this.state.field.length > u) return this.__error(new
|
|
2287
|
+
if (this.state.commenting === !1 && u !== 0 && this.state.record_length + this.state.field.length > u) return this.__error(new K("CSV_MAX_RECORD_SIZE", [
|
|
2288
2288
|
"Max Record Size:",
|
|
2289
2289
|
"record exceed the maximum number of tolerated bytes",
|
|
2290
2290
|
`of ${u}`,
|
|
2291
2291
|
`at line ${this.info.lines}`
|
|
2292
2292
|
], this.options, this.__infoField()));
|
|
2293
|
-
let t = l === !1 || this.state.quoting === !0 || this.state.field.length !== 0 || !this.__isCharTrimable(
|
|
2293
|
+
let t = l === !1 || this.state.quoting === !0 || this.state.field.length !== 0 || !this.__isCharTrimable(C, w), i = p === !1 || this.state.wasQuoting === !1;
|
|
2294
2294
|
if (t === !0 && i === !0) this.state.field.append(e);
|
|
2295
|
-
else if (p === !0 && !this.__isCharTrimable(
|
|
2295
|
+
else if (p === !0 && !this.__isCharTrimable(C, w)) return this.__error(new K("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE", [
|
|
2296
2296
|
"Invalid Closing Quote:",
|
|
2297
2297
|
"found non trimable byte after quote",
|
|
2298
2298
|
`at line ${this.info.lines}`
|
|
2299
2299
|
], this.options, this.__infoField()));
|
|
2300
2300
|
else {
|
|
2301
|
-
t === !1 && (
|
|
2301
|
+
t === !1 && (w += this.__isCharTrimable(C, w) - 1);
|
|
2302
2302
|
continue;
|
|
2303
2303
|
}
|
|
2304
2304
|
}
|
|
2305
2305
|
if (t === !0) {
|
|
2306
2306
|
if (this.state.quoting === !0) {
|
|
2307
|
-
let e = this.__error(new
|
|
2307
|
+
let e = this.__error(new K("CSV_QUOTE_NOT_CLOSED", ["Quote Not Closed:", `the parsing is finished with an opening quote at line ${this.info.lines}`], this.options, this.__infoField()));
|
|
2308
2308
|
if (e !== void 0) return e;
|
|
2309
2309
|
} else if (this.state.wasQuoting === !0 || this.state.record.length !== 0 || this.state.field.length !== 0) {
|
|
2310
|
-
this.info.bytes = this.state.bufBytesStart +
|
|
2310
|
+
this.info.bytes = this.state.bufBytesStart + w;
|
|
2311
2311
|
let e = this.__onField();
|
|
2312
2312
|
if (e !== void 0) return e;
|
|
2313
2313
|
let t = this.__onRecord(n);
|
|
2314
2314
|
if (t !== void 0) return t;
|
|
2315
2315
|
} else this.state.wasRowDelimiter === !0 ? this.info.empty_lines++ : this.state.commenting === !0 && this.info.comment_lines++;
|
|
2316
|
-
} else this.state.bufBytesStart +=
|
|
2316
|
+
} else this.state.bufBytesStart += w, this.state.previousBuf = C.slice(w);
|
|
2317
2317
|
this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1);
|
|
2318
2318
|
},
|
|
2319
2319
|
__onRecord: function(e) {
|
|
@@ -2321,18 +2321,18 @@ var Bn = function(e) {
|
|
|
2321
2321
|
if (d === !1) return this.__resetRecord();
|
|
2322
2322
|
let p = f.length;
|
|
2323
2323
|
if (t === !0) {
|
|
2324
|
-
if (u === !0 &&
|
|
2324
|
+
if (u === !0 && er(f)) {
|
|
2325
2325
|
this.__resetRecord();
|
|
2326
2326
|
return;
|
|
2327
2327
|
}
|
|
2328
2328
|
return this.__firstLineToColumns(f);
|
|
2329
2329
|
}
|
|
2330
2330
|
if (t === !1 && this.info.records === 0 && (this.state.expectedRecordLength = p), p !== this.state.expectedRecordLength) {
|
|
2331
|
-
let e = t === !1 ? new
|
|
2331
|
+
let e = t === !1 ? new K("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH", [
|
|
2332
2332
|
"Invalid Record Length:",
|
|
2333
2333
|
`expect ${this.state.expectedRecordLength},`,
|
|
2334
2334
|
`got ${p} on line ${this.info.lines}`
|
|
2335
|
-
], this.options, this.__infoField(), { record: f }) : new
|
|
2335
|
+
], this.options, this.__infoField(), { record: f }) : new K("CSV_RECORD_INCONSISTENT_COLUMNS", [
|
|
2336
2336
|
"Invalid Record Length:",
|
|
2337
2337
|
`columns length is ${t.length},`,
|
|
2338
2338
|
`got ${p} on line ${this.info.lines}`
|
|
@@ -2343,7 +2343,7 @@ var Bn = function(e) {
|
|
|
2343
2343
|
if (t) return t;
|
|
2344
2344
|
}
|
|
2345
2345
|
}
|
|
2346
|
-
if (u === !0 &&
|
|
2346
|
+
if (u === !0 && er(f)) {
|
|
2347
2347
|
this.__resetRecord();
|
|
2348
2348
|
return;
|
|
2349
2349
|
}
|
|
@@ -2382,12 +2382,12 @@ var Bn = function(e) {
|
|
|
2382
2382
|
let { firstLineToHeaders: t } = this.state;
|
|
2383
2383
|
try {
|
|
2384
2384
|
let n = t === void 0 ? e : t.call(null, e);
|
|
2385
|
-
if (!Array.isArray(n)) return this.__error(new
|
|
2385
|
+
if (!Array.isArray(n)) return this.__error(new K("CSV_INVALID_COLUMN_MAPPING", [
|
|
2386
2386
|
"Invalid Column Mapping:",
|
|
2387
2387
|
"expect an array from column function,",
|
|
2388
2388
|
`got ${JSON.stringify(n)}`
|
|
2389
2389
|
], this.options, this.__infoField(), { headers: n }));
|
|
2390
|
-
let r =
|
|
2390
|
+
let r = qn(n);
|
|
2391
2391
|
this.state.expectedRecordLength = r.length, this.options.columns = r, this.__resetRecord();
|
|
2392
2392
|
return;
|
|
2393
2393
|
} catch (e) {
|
|
@@ -2551,13 +2551,13 @@ var Bn = function(e) {
|
|
|
2551
2551
|
};
|
|
2552
2552
|
}
|
|
2553
2553
|
};
|
|
2554
|
-
},
|
|
2554
|
+
}, ir = class extends W {
|
|
2555
2555
|
constructor(e = {}) {
|
|
2556
2556
|
super({
|
|
2557
2557
|
readableObjectMode: !0,
|
|
2558
2558
|
...e,
|
|
2559
2559
|
encoding: null
|
|
2560
|
-
}), this.api =
|
|
2560
|
+
}), this.api = rr({
|
|
2561
2561
|
on_skip: (e, t) => {
|
|
2562
2562
|
this.emit("skip", e, t);
|
|
2563
2563
|
},
|
|
@@ -2580,16 +2580,16 @@ var Bn = function(e) {
|
|
|
2580
2580
|
this.push(null), this.on("end", this.destroy);
|
|
2581
2581
|
}));
|
|
2582
2582
|
}
|
|
2583
|
-
},
|
|
2583
|
+
}, ar = function() {
|
|
2584
2584
|
let e, t, n;
|
|
2585
2585
|
for (let r in arguments) {
|
|
2586
2586
|
let i = arguments[r], a = typeof i;
|
|
2587
|
-
if (e === void 0 && (typeof i == "string" ||
|
|
2588
|
-
else if (t === void 0 &&
|
|
2587
|
+
if (e === void 0 && (typeof i == "string" || D(i))) e = i;
|
|
2588
|
+
else if (t === void 0 && Kn(i)) t = i;
|
|
2589
2589
|
else if (n === void 0 && a === "function") n = i;
|
|
2590
|
-
else throw new
|
|
2590
|
+
else throw new K("CSV_INVALID_ARGUMENT", ["Invalid argument:", `got ${JSON.stringify(i)} at index ${r}`], t || {});
|
|
2591
2591
|
}
|
|
2592
|
-
let r = new
|
|
2592
|
+
let r = new ir(t);
|
|
2593
2593
|
if (n) {
|
|
2594
2594
|
let e = t === void 0 || t.objname === void 0 ? [] : Object.create(null);
|
|
2595
2595
|
r.on("readable", function() {
|
|
@@ -2608,32 +2608,387 @@ var Bn = function(e) {
|
|
|
2608
2608
|
typeof setImmediate == "function" ? setImmediate(t) : setTimeout(t, 0);
|
|
2609
2609
|
}
|
|
2610
2610
|
return r;
|
|
2611
|
-
}
|
|
2611
|
+
};
|
|
2612
|
+
//#endregion
|
|
2613
|
+
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared.es.js
|
|
2614
|
+
function J(e) {
|
|
2615
|
+
return new Map(Object.entries(e));
|
|
2616
|
+
}
|
|
2617
|
+
var or = {
|
|
2618
|
+
lang: void 0,
|
|
2619
|
+
message: void 0,
|
|
2620
|
+
abortEarly: void 0,
|
|
2621
|
+
abortPipeEarly: void 0
|
|
2622
|
+
};
|
|
2623
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2624
|
+
function sr(e) {
|
|
2625
|
+
return e ? {
|
|
2626
|
+
lang: e?.lang ?? void 0,
|
|
2627
|
+
message: e?.message,
|
|
2628
|
+
abortEarly: e?.abortEarly ?? void 0,
|
|
2629
|
+
abortPipeEarly: e?.abortPipeEarly ?? void 0
|
|
2630
|
+
} : or;
|
|
2631
|
+
}
|
|
2632
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2633
|
+
function cr(e) {
|
|
2634
|
+
let t = typeof e;
|
|
2635
|
+
return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
|
|
2636
|
+
}
|
|
2637
|
+
function Y(e, t, n, r, i) {
|
|
2638
|
+
let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? /* @__PURE__ */ cr(a), c = {
|
|
2639
|
+
kind: e.kind,
|
|
2640
|
+
type: e.type,
|
|
2641
|
+
input: a,
|
|
2642
|
+
expected: o,
|
|
2643
|
+
received: s,
|
|
2644
|
+
message: `Invalid ${t}: ${o ? `Expected ${o} but r` : "R"}eceived ${s}`,
|
|
2645
|
+
requirement: e.requirement,
|
|
2646
|
+
path: i?.path,
|
|
2647
|
+
issues: i?.issues,
|
|
2648
|
+
lang: r.lang,
|
|
2649
|
+
abortEarly: r.abortEarly,
|
|
2650
|
+
abortPipeEarly: r.abortPipeEarly
|
|
2651
|
+
}, l = e.kind === "schema", u = i?.message ?? e.message ?? (e.reference, c.lang, void 0) ?? (l ? (c.lang, void 0) : null) ?? r.message ?? (c.lang, void 0);
|
|
2652
|
+
u !== void 0 && (c.message = typeof u == "function" ? u(c) : u), l && (n.typed = !1), n.issues ? n.issues.push(c) : n.issues = [c];
|
|
2653
|
+
}
|
|
2654
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2655
|
+
function lr(e, t) {
|
|
2656
|
+
return e === t || Number.isNaN(e) && Number.isNaN(t);
|
|
2657
|
+
}
|
|
2658
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2659
|
+
function ur(e, t) {
|
|
2660
|
+
let n = [...new Set(e)];
|
|
2661
|
+
return n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? "never";
|
|
2662
|
+
}
|
|
2663
|
+
function X(e) {
|
|
2664
|
+
return e["~standard"] = {
|
|
2665
|
+
version: 1,
|
|
2666
|
+
vendor: "valibot",
|
|
2667
|
+
validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */ sr())
|
|
2668
|
+
}, e;
|
|
2669
|
+
}
|
|
2670
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2671
|
+
function dr(e, t, n) {
|
|
2672
|
+
return typeof e.fallback == "function" ? e.fallback(t, n) : e.fallback;
|
|
2673
|
+
}
|
|
2674
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2675
|
+
function fr(e, t, n) {
|
|
2676
|
+
return typeof e.default == "function" ? e.default(t, n) : e.default;
|
|
2677
|
+
}
|
|
2678
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2679
|
+
function pr(e, t) {
|
|
2680
|
+
return X({
|
|
2681
|
+
kind: "schema",
|
|
2682
|
+
type: "literal",
|
|
2683
|
+
reference: pr,
|
|
2684
|
+
expects: /* @__PURE__ */ cr(e),
|
|
2685
|
+
async: !1,
|
|
2686
|
+
literal: e,
|
|
2687
|
+
message: t,
|
|
2688
|
+
"~run"(e, t) {
|
|
2689
|
+
return /* @__PURE__ */ lr(e.value, this.literal) ? e.typed = !0 : Y(this, "type", e, t), e;
|
|
2690
|
+
}
|
|
2691
|
+
});
|
|
2692
|
+
}
|
|
2693
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2694
|
+
function Z(e, t) {
|
|
2695
|
+
return X({
|
|
2696
|
+
kind: "schema",
|
|
2697
|
+
type: "nullable",
|
|
2698
|
+
reference: Z,
|
|
2699
|
+
expects: `(${e.expects} | null)`,
|
|
2700
|
+
async: !1,
|
|
2701
|
+
wrapped: e,
|
|
2702
|
+
default: t,
|
|
2703
|
+
"~run"(e, t) {
|
|
2704
|
+
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ fr(this, e, t)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
2705
|
+
}
|
|
2706
|
+
});
|
|
2707
|
+
}
|
|
2708
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2709
|
+
function mr(e) {
|
|
2710
|
+
return X({
|
|
2711
|
+
kind: "schema",
|
|
2712
|
+
type: "number",
|
|
2713
|
+
reference: mr,
|
|
2714
|
+
expects: "number",
|
|
2715
|
+
async: !1,
|
|
2716
|
+
message: e,
|
|
2717
|
+
"~run"(e, t) {
|
|
2718
|
+
return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 : Y(this, "type", e, t), e;
|
|
2719
|
+
}
|
|
2720
|
+
});
|
|
2721
|
+
}
|
|
2722
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2723
|
+
function hr(e, t) {
|
|
2724
|
+
return X({
|
|
2725
|
+
kind: "schema",
|
|
2726
|
+
type: "optional",
|
|
2727
|
+
reference: hr,
|
|
2728
|
+
expects: `(${e.expects} | undefined)`,
|
|
2729
|
+
async: !1,
|
|
2730
|
+
wrapped: e,
|
|
2731
|
+
default: t,
|
|
2732
|
+
"~run"(e, t) {
|
|
2733
|
+
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ fr(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
2734
|
+
}
|
|
2735
|
+
});
|
|
2736
|
+
}
|
|
2737
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2738
|
+
function gr(e, t) {
|
|
2739
|
+
return X({
|
|
2740
|
+
kind: "schema",
|
|
2741
|
+
type: "strict_object",
|
|
2742
|
+
reference: gr,
|
|
2743
|
+
expects: "Object",
|
|
2744
|
+
async: !1,
|
|
2745
|
+
entries: e,
|
|
2746
|
+
message: t,
|
|
2747
|
+
"~run"(e, t) {
|
|
2748
|
+
let n = e.value;
|
|
2749
|
+
if (n && typeof n == "object") {
|
|
2750
|
+
e.typed = !0, e.value = {};
|
|
2751
|
+
for (let r in this.entries) {
|
|
2752
|
+
let i = this.entries[r];
|
|
2753
|
+
if (r in n || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && i.default !== void 0) {
|
|
2754
|
+
let a = r in n ? n[r] : /* @__PURE__ */ fr(i), o = i["~run"]({ value: a }, t);
|
|
2755
|
+
if (o.issues) {
|
|
2756
|
+
let i = {
|
|
2757
|
+
type: "object",
|
|
2758
|
+
origin: "value",
|
|
2759
|
+
input: n,
|
|
2760
|
+
key: r,
|
|
2761
|
+
value: a
|
|
2762
|
+
};
|
|
2763
|
+
for (let t of o.issues) t.path ? t.path.unshift(i) : t.path = [i], e.issues?.push(t);
|
|
2764
|
+
if (e.issues ||= o.issues, t.abortEarly) {
|
|
2765
|
+
e.typed = !1;
|
|
2766
|
+
break;
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
o.typed || (e.typed = !1), e.value[r] = o.value;
|
|
2770
|
+
} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ dr(i);
|
|
2771
|
+
else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (Y(this, "key", e, t, {
|
|
2772
|
+
input: void 0,
|
|
2773
|
+
expected: `"${r}"`,
|
|
2774
|
+
path: [{
|
|
2775
|
+
type: "object",
|
|
2776
|
+
origin: "key",
|
|
2777
|
+
input: n,
|
|
2778
|
+
key: r,
|
|
2779
|
+
value: n[r]
|
|
2780
|
+
}]
|
|
2781
|
+
}), t.abortEarly)) break;
|
|
2782
|
+
}
|
|
2783
|
+
if (!e.issues || !t.abortEarly) {
|
|
2784
|
+
for (let r in n) if (!Object.prototype.hasOwnProperty.call(this.entries, r)) {
|
|
2785
|
+
Y(this, "key", e, t, {
|
|
2786
|
+
input: r,
|
|
2787
|
+
expected: "never",
|
|
2788
|
+
path: [{
|
|
2789
|
+
type: "object",
|
|
2790
|
+
origin: "key",
|
|
2791
|
+
input: n,
|
|
2792
|
+
key: r,
|
|
2793
|
+
value: n[r]
|
|
2794
|
+
}]
|
|
2795
|
+
});
|
|
2796
|
+
break;
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
} else Y(this, "type", e, t);
|
|
2800
|
+
return e;
|
|
2801
|
+
}
|
|
2802
|
+
});
|
|
2803
|
+
}
|
|
2804
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2805
|
+
function Q(e) {
|
|
2806
|
+
return X({
|
|
2807
|
+
kind: "schema",
|
|
2808
|
+
type: "string",
|
|
2809
|
+
reference: Q,
|
|
2810
|
+
expects: "string",
|
|
2811
|
+
async: !1,
|
|
2812
|
+
message: e,
|
|
2813
|
+
"~run"(e, t) {
|
|
2814
|
+
return typeof e.value == "string" ? e.typed = !0 : Y(this, "type", e, t), e;
|
|
2815
|
+
}
|
|
2816
|
+
});
|
|
2817
|
+
}
|
|
2818
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2819
|
+
function _r(e) {
|
|
2820
|
+
let t;
|
|
2821
|
+
if (e) for (let n of e) if (t) for (let e of n.issues) t.push(e);
|
|
2822
|
+
else t = n.issues;
|
|
2823
|
+
return t;
|
|
2824
|
+
}
|
|
2825
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2826
|
+
function vr(e, t) {
|
|
2827
|
+
return X({
|
|
2828
|
+
kind: "schema",
|
|
2829
|
+
type: "union",
|
|
2830
|
+
reference: vr,
|
|
2831
|
+
expects: /* @__PURE__ */ ur(e.map((e) => e.expects), "|"),
|
|
2832
|
+
async: !1,
|
|
2833
|
+
options: e,
|
|
2834
|
+
message: t,
|
|
2835
|
+
"~run"(e, t) {
|
|
2836
|
+
let n, r, i;
|
|
2837
|
+
for (let a of this.options) {
|
|
2838
|
+
let o = a["~run"]({ value: e.value }, t);
|
|
2839
|
+
if (o.typed) {
|
|
2840
|
+
if (o.issues) r ? r.push(o) : r = [o];
|
|
2841
|
+
else {
|
|
2842
|
+
n = o;
|
|
2843
|
+
break;
|
|
2844
|
+
}
|
|
2845
|
+
} else i ? i.push(o) : i = [o];
|
|
2846
|
+
}
|
|
2847
|
+
if (n) return n;
|
|
2848
|
+
if (r) {
|
|
2849
|
+
if (r.length === 1) return r[0];
|
|
2850
|
+
Y(this, "type", e, t, { issues: /* @__PURE__ */ _r(r) }), e.typed = !0;
|
|
2851
|
+
} else if (i?.length === 1) return i[0];
|
|
2852
|
+
else Y(this, "type", e, t, { issues: /* @__PURE__ */ _r(i) });
|
|
2853
|
+
return e;
|
|
2854
|
+
}
|
|
2855
|
+
});
|
|
2856
|
+
}
|
|
2857
|
+
var yr = {
|
|
2858
|
+
id: /* @__PURE__ */ Q(),
|
|
2859
|
+
label: /* @__PURE__ */ gr({
|
|
2860
|
+
en: /* @__PURE__ */ hr(/* @__PURE__ */ Q()),
|
|
2861
|
+
es: /* @__PURE__ */ hr(/* @__PURE__ */ Q())
|
|
2862
|
+
}),
|
|
2863
|
+
description: /* @__PURE__ */ gr({
|
|
2864
|
+
en: /* @__PURE__ */ hr(/* @__PURE__ */ Q()),
|
|
2865
|
+
es: /* @__PURE__ */ hr(/* @__PURE__ */ Q())
|
|
2866
|
+
}),
|
|
2867
|
+
icon: /* @__PURE__ */ Z(/* @__PURE__ */ Q()),
|
|
2868
|
+
iconDark: /* @__PURE__ */ Z(/* @__PURE__ */ Q())
|
|
2869
|
+
}, $ = (e) => /* @__PURE__ */ vr(e.map((e) => /* @__PURE__ */ pr(e))), br = $([
|
|
2870
|
+
"app",
|
|
2871
|
+
"connector",
|
|
2872
|
+
"connectorConnection",
|
|
2873
|
+
"context",
|
|
2874
|
+
"contextArea",
|
|
2875
|
+
"contextModel",
|
|
2876
|
+
"contextModelDimension",
|
|
2877
|
+
"contextModelDimensionHierarchy",
|
|
2878
|
+
"contextModelEntity",
|
|
2879
|
+
"contextModelEntityDataItem",
|
|
2880
|
+
"contextModelEntityEvent",
|
|
2881
|
+
"contextModelEntityPrimaryMeasure",
|
|
2882
|
+
"contextModelSecondaryMeasure",
|
|
2883
|
+
"cookbook",
|
|
2884
|
+
"cookbookRecipe",
|
|
2885
|
+
"dataView",
|
|
2886
|
+
"engine",
|
|
2887
|
+
"eventQuery",
|
|
2888
|
+
"presenter",
|
|
2889
|
+
"presenterPresentation",
|
|
2890
|
+
"tool"
|
|
2891
|
+
]), xr = $([
|
|
2892
|
+
"danger",
|
|
2893
|
+
"success",
|
|
2894
|
+
"warning"
|
|
2895
|
+
]), Sr = $([
|
|
2896
|
+
"alpha",
|
|
2897
|
+
"beta",
|
|
2898
|
+
"releaseCandidate",
|
|
2899
|
+
"generalAvailability"
|
|
2900
|
+
]), Cr = /* @__PURE__ */ gr({
|
|
2901
|
+
color: xr,
|
|
2902
|
+
label: /* @__PURE__ */ Q()
|
|
2903
|
+
}), wr = {
|
|
2904
|
+
...yr,
|
|
2905
|
+
typeId: br
|
|
2906
|
+
};
|
|
2907
|
+
({ ...wr });
|
|
2908
|
+
var Tr = {
|
|
2909
|
+
...wr,
|
|
2910
|
+
firstCreatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ mr()),
|
|
2911
|
+
lastUpdatedAt: /* @__PURE__ */ Z(/* @__PURE__ */ mr()),
|
|
2912
|
+
status: /* @__PURE__ */ Z(Cr),
|
|
2913
|
+
statusId: /* @__PURE__ */ Z(Sr)
|
|
2914
|
+
};
|
|
2915
|
+
({ ...Tr }), J({ en: "Data Positioning Events" }), J({ en: "Delimited Text" }), J({ en: "JSON" }), J({ en: "SPSS" }), J({ en: "XLSX" }), J({ en: "XML" }), J({ en: "Newline" }), J({ en: "Carriage Return" }), J({ en: "Carriage Return/Newline" }), J({ en: "Colon" }), J({ en: "Comma" }), J({ en: "Exclamation Mark" }), J({ en: "Record Separator" }), J({ en: "Semicolon" }), J({ en: "Space" }), J({ en: "Tab" }), J({ en: "Underscore" }), J({ en: "Unit Separator" }), J({ en: "Vertical Bar" }), $([
|
|
2916
|
+
"app",
|
|
2917
|
+
"engine",
|
|
2918
|
+
"connector",
|
|
2919
|
+
"cookbook",
|
|
2920
|
+
"presenter",
|
|
2921
|
+
"tool"
|
|
2922
|
+
]);
|
|
2923
|
+
var Er = {
|
|
2924
|
+
...Tr,
|
|
2925
|
+
vendorAccountURL: /* @__PURE__ */ Z(/* @__PURE__ */ Q()),
|
|
2926
|
+
vendorDocumentationURL: /* @__PURE__ */ Z(/* @__PURE__ */ Q()),
|
|
2927
|
+
vendorHomeURL: /* @__PURE__ */ Z(/* @__PURE__ */ Q()),
|
|
2928
|
+
version: /* @__PURE__ */ Q()
|
|
2929
|
+
};
|
|
2930
|
+
({ ...Er }), $([
|
|
2931
|
+
"abortOperation",
|
|
2932
|
+
"auditObjectContent",
|
|
2933
|
+
"createObject",
|
|
2934
|
+
"describeConnection",
|
|
2935
|
+
"dropObject",
|
|
2936
|
+
"findObject",
|
|
2937
|
+
"getInfo",
|
|
2938
|
+
"getReadableStream",
|
|
2939
|
+
"getRecord",
|
|
2940
|
+
"listNodes",
|
|
2941
|
+
"previewObject",
|
|
2942
|
+
"removeRecords",
|
|
2943
|
+
"retrieveChunks",
|
|
2944
|
+
"retrieveRecords",
|
|
2945
|
+
"upsertRecords"
|
|
2946
|
+
]), $([
|
|
2947
|
+
"application",
|
|
2948
|
+
"curatedDataset",
|
|
2949
|
+
"database",
|
|
2950
|
+
"fileStore"
|
|
2951
|
+
]), $([
|
|
2952
|
+
"bidirectional",
|
|
2953
|
+
"destination",
|
|
2954
|
+
"source",
|
|
2955
|
+
"unknown"
|
|
2956
|
+
]), $([
|
|
2957
|
+
"apiKey",
|
|
2958
|
+
"disabled",
|
|
2959
|
+
"oAuth2",
|
|
2960
|
+
"none"
|
|
2961
|
+
]), { ...Er }, $(["list"]), { ...Er }, $([
|
|
2962
|
+
"list",
|
|
2963
|
+
"render",
|
|
2964
|
+
"setColorMode"
|
|
2965
|
+
]), { ...Er };
|
|
2966
|
+
var Dr = 2048, Or = class extends Error {
|
|
2612
2967
|
data;
|
|
2613
2968
|
locator;
|
|
2614
2969
|
constructor(e, t, n, r) {
|
|
2615
2970
|
super(e, r), this.name = "DPUseError", this.data = n, this.locator = t;
|
|
2616
2971
|
}
|
|
2617
|
-
},
|
|
2972
|
+
}, kr = class extends Or {
|
|
2618
2973
|
constructor(e, t, n, r) {
|
|
2619
2974
|
super(e, t, n, r), this.name = "FetchError";
|
|
2620
2975
|
}
|
|
2621
2976
|
};
|
|
2622
|
-
async function
|
|
2977
|
+
async function Ar(e, t, n) {
|
|
2623
2978
|
let r = ` - ${e.statusText}`, i = `${t} Response status '${String(e.status)}${e.statusText ? r : ""}' received.`, a;
|
|
2624
2979
|
try {
|
|
2625
2980
|
a = await e.text();
|
|
2626
2981
|
} catch (e) {
|
|
2627
|
-
a = `<body unavailable: ${
|
|
2982
|
+
a = `<body unavailable: ${Mr(e).message}>`;
|
|
2628
2983
|
}
|
|
2629
|
-
return new
|
|
2984
|
+
return new kr(i, n, { body: Nr(a) });
|
|
2630
2985
|
}
|
|
2631
|
-
function
|
|
2986
|
+
function jr(e) {
|
|
2632
2987
|
try {
|
|
2633
2988
|
e();
|
|
2634
2989
|
} catch {}
|
|
2635
2990
|
}
|
|
2636
|
-
function
|
|
2991
|
+
function Mr(e) {
|
|
2637
2992
|
if (e instanceof Error) return e;
|
|
2638
2993
|
if (typeof e == "string") return Error(e);
|
|
2639
2994
|
if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint") return Error(String(e));
|
|
@@ -2645,19 +3000,19 @@ function ar(e) {
|
|
|
2645
3000
|
}
|
|
2646
3001
|
return /* @__PURE__ */ Error("Unknown error");
|
|
2647
3002
|
}
|
|
2648
|
-
function
|
|
2649
|
-
if (e != null && e !== "") return e.length >
|
|
3003
|
+
function Nr(e) {
|
|
3004
|
+
if (e != null && e !== "") return e.length > Dr ? `${e.slice(0, Dr)}... [truncated]` : e;
|
|
2650
3005
|
}
|
|
2651
3006
|
//#endregion
|
|
2652
3007
|
//#region src/index.ts
|
|
2653
|
-
var
|
|
3008
|
+
var Pr = {
|
|
2654
3009
|
bom: !1,
|
|
2655
3010
|
cast_date: !1,
|
|
2656
3011
|
columns: !1,
|
|
2657
3012
|
comment: "",
|
|
2658
3013
|
comment_no_infix: !1,
|
|
2659
3014
|
delimiter: ",",
|
|
2660
|
-
encoding: "
|
|
3015
|
+
encoding: "utf-8",
|
|
2661
3016
|
escape: "\"",
|
|
2662
3017
|
from: 1,
|
|
2663
3018
|
from_line: 1,
|
|
@@ -2679,30 +3034,30 @@ var sr = {
|
|
|
2679
3034
|
skip_records_with_error: !1,
|
|
2680
3035
|
to_line: -1,
|
|
2681
3036
|
trim: !1
|
|
2682
|
-
},
|
|
3037
|
+
}, Fr = 4, Ir = 1e4, Lr = class {
|
|
2683
3038
|
async parseStream(e, t, n, r, i) {
|
|
2684
3039
|
return new Promise((a, o) => {
|
|
2685
3040
|
let s, c, l, u = !1, d = !1, f = () => {
|
|
2686
3041
|
if (d) return;
|
|
2687
3042
|
d = !0;
|
|
2688
3043
|
let e = s;
|
|
2689
|
-
s = void 0, l = void 0, e != null && (
|
|
3044
|
+
s = void 0, l = void 0, e != null && (jr(() => e.removeAllListeners()), jr(() => e.end())), jr(() => void c?.cancel()), c = void 0;
|
|
2690
3045
|
};
|
|
2691
3046
|
r.signal.addEventListener("abort", f, { once: !0 });
|
|
2692
3047
|
let p = (e) => {
|
|
2693
3048
|
u || (u = !0, f(), r.signal.aborted || r.abort(e), o(e instanceof Error ? e : Error(String(e))));
|
|
2694
3049
|
};
|
|
2695
3050
|
(async () => {
|
|
2696
|
-
s =
|
|
2697
|
-
...
|
|
3051
|
+
s = ar({
|
|
3052
|
+
...Pr,
|
|
2698
3053
|
...t,
|
|
2699
3054
|
cast: (e, t) => ({
|
|
2700
3055
|
value: e,
|
|
2701
3056
|
wasValueQuoted: t.quoting
|
|
2702
3057
|
})
|
|
2703
|
-
}), l =
|
|
3058
|
+
}), l = Rr({
|
|
2704
3059
|
chunk: i,
|
|
2705
|
-
chunkSize: e.chunkSize ??
|
|
3060
|
+
chunkSize: e.chunkSize ?? Ir
|
|
2706
3061
|
}), s.on("readable", () => {
|
|
2707
3062
|
try {
|
|
2708
3063
|
if (s == null || l == null) return;
|
|
@@ -2717,10 +3072,10 @@ var sr = {
|
|
|
2717
3072
|
}), s.on("error", (e) => {
|
|
2718
3073
|
p(e);
|
|
2719
3074
|
}), s.on("end", () => {
|
|
2720
|
-
u || (l?.flush(), a(
|
|
3075
|
+
u || (l?.flush(), a(zr(s)));
|
|
2721
3076
|
});
|
|
2722
3077
|
let o = await fetch(encodeURI(n), { signal: r.signal });
|
|
2723
|
-
if (!o.ok || o.body == null) throw await
|
|
3078
|
+
if (!o.ok || o.body == null) throw await Ar(o, `Failed to fetch '${n}' file.`, "dpuse-connector-file-store-emulator|Connector|retrieve");
|
|
2724
3079
|
c = o.body.getReader();
|
|
2725
3080
|
let d = new TextDecoder(e.encodingId), f = await c.read();
|
|
2726
3081
|
for (; !f.done;) {
|
|
@@ -2738,7 +3093,7 @@ var sr = {
|
|
|
2738
3093
|
});
|
|
2739
3094
|
}
|
|
2740
3095
|
async parseText(e, t) {
|
|
2741
|
-
let n =
|
|
3096
|
+
let n = Br(e), { parsedRecords: r, valueDelimiterId: i } = await Vr(e, t);
|
|
2742
3097
|
return {
|
|
2743
3098
|
parsedRecords: r,
|
|
2744
3099
|
recordDelimiterId: n,
|
|
@@ -2746,11 +3101,11 @@ var sr = {
|
|
|
2746
3101
|
};
|
|
2747
3102
|
}
|
|
2748
3103
|
};
|
|
2749
|
-
function
|
|
3104
|
+
function Rr(e) {
|
|
2750
3105
|
let t = Math.max(1, Math.floor(e.chunkSize)), n = [], r = o(), i = 0, a = () => {
|
|
2751
3106
|
if (i === 0) return;
|
|
2752
3107
|
let t = r;
|
|
2753
|
-
t.length = i, r = o(), i = 0, e.chunk("parsingRecordArray", t), n.length <
|
|
3108
|
+
t.length = i, r = o(), i = 0, e.chunk("parsingRecordArray", t), n.length < Fr && n.push(t);
|
|
2754
3109
|
};
|
|
2755
3110
|
return {
|
|
2756
3111
|
flush: a,
|
|
@@ -2765,7 +3120,7 @@ function dr(e) {
|
|
|
2765
3120
|
return r.length = 0, r;
|
|
2766
3121
|
}
|
|
2767
3122
|
}
|
|
2768
|
-
function
|
|
3123
|
+
function zr(e) {
|
|
2769
3124
|
return {
|
|
2770
3125
|
byteCount: e?.info.bytes ?? -1,
|
|
2771
3126
|
commentLineCount: e?.info.comment_lines ?? -1,
|
|
@@ -2775,15 +3130,15 @@ function fr(e) {
|
|
|
2775
3130
|
recordCount: e?.info.records ?? -1
|
|
2776
3131
|
};
|
|
2777
3132
|
}
|
|
2778
|
-
function
|
|
3133
|
+
function Br(e) {
|
|
2779
3134
|
let t = (e.match(/\r\n/g) ?? []).length, n = (e.match(/(?<!\r)\n/g) ?? []).length, r = (e.match(/\r(?!\n)/g) ?? []).length;
|
|
2780
3135
|
return t >= n && t >= r ? "\r\n" : n >= t && n >= r ? "\n" : r >= t && r >= n ? "\r" : "\n";
|
|
2781
3136
|
}
|
|
2782
|
-
async function
|
|
3137
|
+
async function Vr(e, t) {
|
|
2783
3138
|
let n, r, i, a = [];
|
|
2784
3139
|
for (let o of t) try {
|
|
2785
|
-
let t = 0, s, c = 0, l = 0, u =
|
|
2786
|
-
...
|
|
3140
|
+
let t = 0, s, c = 0, l = 0, u = ar({
|
|
3141
|
+
...Pr,
|
|
2787
3142
|
cast: (e, t) => ({
|
|
2788
3143
|
value: e,
|
|
2789
3144
|
wasValueQuoted: t.quoting
|
|
@@ -2818,4 +3173,4 @@ async function mr(e, t) {
|
|
|
2818
3173
|
};
|
|
2819
3174
|
}
|
|
2820
3175
|
//#endregion
|
|
2821
|
-
export {
|
|
3176
|
+
export { Lr as Tool };
|