@wix/cli 1.1.56 → 1.1.57
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/build/{DevCommand-UW724BPF.js → DevCommand-K3JZ4XZC.js} +13 -14
- package/build/{DevCommand-UW724BPF.js.map → DevCommand-K3JZ4XZC.js.map} +1 -1
- package/build/{DevCommand-KMBUXAPT.js → DevCommand-NPU6T4GA.js} +76 -68
- package/build/DevCommand-NPU6T4GA.js.map +1 -0
- package/build/{LoginCommand-O4FKLPWK.js → LoginCommand-BP3RQHUM.js} +11 -11
- package/build/{LogoutCommand-KMWHOQSC.js → LogoutCommand-VT4QE44U.js} +7 -7
- package/build/{WhoamiCommand-VV6U2M2K.js → WhoamiCommand-KJFFYPZX.js} +4 -4
- package/build/{chunk-VO6LL5ZT.js → chunk-24HYCAK2.js} +2 -2
- package/build/{chunk-GH2E2TEQ.js → chunk-2AGM62L5.js} +54 -7
- package/build/chunk-2AGM62L5.js.map +1 -0
- package/build/{chunk-GOTVWNXA.js → chunk-3KIPOGXI.js} +4 -4
- package/build/{chunk-7M5ZGODY.js → chunk-3R4OZ46Z.js} +2 -2
- package/build/{chunk-NEB7POM3.js → chunk-53UCEZFU.js} +2 -1
- package/build/chunk-53UCEZFU.js.map +1 -0
- package/build/{chunk-ZS2473DH.js → chunk-6F2RSXHN.js} +9 -314
- package/build/chunk-6F2RSXHN.js.map +1 -0
- package/build/{chunk-XKFU2BID.js → chunk-BBGPRSAS.js} +6 -6
- package/build/{chunk-3UYDT5ZT.js → chunk-BHINMCY7.js} +324 -23
- package/build/chunk-BHINMCY7.js.map +1 -0
- package/build/{chunk-CPDU7PKL.js → chunk-E745NXJR.js} +5 -5
- package/build/{chunk-DYIK4YH5.js → chunk-FYXV3TNQ.js} +4 -4
- package/build/{chunk-JH6KT73W.js → chunk-H5EUIUDE.js} +5 -5
- package/build/chunk-IFQQVSBK.js +916 -0
- package/build/chunk-IFQQVSBK.js.map +1 -0
- package/build/{chunk-5PNAZQGU.js → chunk-IRLLAFTL.js} +4 -4
- package/build/{chunk-ZPPKJBJT.js → chunk-KOCJZPLK.js} +2 -2
- package/build/{chunk-GXCSUYZU.js → chunk-KTJ6X6GE.js} +3 -4
- package/build/chunk-KTJ6X6GE.js.map +1 -0
- package/build/{chunk-GPZPN63O.js → chunk-LC4NM6RL.js} +2 -2
- package/build/{chunk-M4NGCYAG.js → chunk-LOJ4G3VD.js} +2 -2
- package/build/{chunk-7LHODQ3J.js → chunk-MCPHB25P.js} +6 -6
- package/build/{chunk-DJCIQS36.js → chunk-MPSJ2YGQ.js} +3 -3
- package/build/{chunk-AMEYK6DR.js → chunk-NX7IBYFX.js} +2 -2
- package/build/{chunk-66PG2F54.js → chunk-QCM5RGPT.js} +3 -3
- package/build/{chunk-5EDABLPV.js → chunk-QZW5GTQF.js} +12 -17
- package/build/chunk-QZW5GTQF.js.map +1 -0
- package/build/{chunk-3TWSKTSG.js → chunk-U2IUPRKN.js} +6 -6
- package/build/{chunk-5LKWJCKW.js → chunk-U67ULUPY.js} +5 -5
- package/build/{chunk-7IO7SVY6.js → chunk-VIUQV2TZ.js} +5 -5
- package/build/{chunk-VDSGAA3D.js → chunk-WYEQRRT2.js} +24 -3
- package/build/chunk-WYEQRRT2.js.map +1 -0
- package/build/{chunk-7DJVGV7H.js → chunk-XTLJ4CAJ.js} +2 -2
- package/build/{chunk-VEDYEGSD.js → chunk-ZOWPPCOU.js} +3 -3
- package/build/{dev-SOVLJFOU.js → dev-P57SGFAA.js} +24 -86
- package/build/dev-P57SGFAA.js.map +1 -0
- package/build/index.js +376 -27
- package/build/index.js.map +1 -1
- package/build/{install-YBL67KU7.js → install-FKVCCLFF.js} +17 -19
- package/build/{install-YBL67KU7.js.map → install-FKVCCLFF.js.map} +1 -1
- package/build/{preview-H3FKN7RS.js → preview-7P7VNEUO.js} +18 -20
- package/build/{preview-H3FKN7RS.js.map → preview-7P7VNEUO.js.map} +1 -1
- package/build/{publish-3Q3XWGUY.js → publish-FA4OUDWG.js} +18 -20
- package/build/{publish-3Q3XWGUY.js.map → publish-FA4OUDWG.js.map} +1 -1
- package/build/{render-command-GEZFKQLP.js → render-command-NM3HNCRF.js} +10 -10
- package/build/{render-command-3PQMENAU.js → render-command-REKF5DLG.js} +11 -11
- package/build/{render-command-BCSOTFBB.js → render-command-VA3HCBMQ.js} +11 -11
- package/build/{run-command-YNCZR65O.js → run-command-ZLQ3PKCS.js} +8 -8
- package/build/{src-DMDBLATB.js → src-BMV74WCO.js} +3 -5
- package/build/{src-NRGIGSNZ.js → src-FSILLQWK.js} +7 -7
- package/build/{src-ZB5ULVF6.js → src-KDZNNJHV.js} +6 -6
- package/build/{src-QML4K6HI.js → src-Q3X5WF65.js} +5 -5
- package/build/{src-QC4COOON.js → src-SWWZQIWT.js} +6 -6
- package/build/{src-MLQVMO4G.js → src-YDZK3SDZ.js} +17 -17
- package/build/{sync-types-2Z3FKMXE.js → sync-types-GLTTFJMA.js} +13 -14
- package/build/{uninstall-PUGTRDQA.js → uninstall-HA7CE6JB.js} +16 -18
- package/build/{uninstall-PUGTRDQA.js.map → uninstall-HA7CE6JB.js.map} +1 -1
- package/package.json +2 -3
- package/build/DevCommand-KMBUXAPT.js.map +0 -1
- package/build/chunk-3UYDT5ZT.js.map +0 -1
- package/build/chunk-5EDABLPV.js.map +0 -1
- package/build/chunk-7AAFANVT.js +0 -3525
- package/build/chunk-7AAFANVT.js.map +0 -1
- package/build/chunk-CVEC37T5.js +0 -62
- package/build/chunk-CVEC37T5.js.map +0 -1
- package/build/chunk-GH2E2TEQ.js.map +0 -1
- package/build/chunk-GXCSUYZU.js.map +0 -1
- package/build/chunk-NEB7POM3.js.map +0 -1
- package/build/chunk-QLGRZABP.js +0 -363
- package/build/chunk-QLGRZABP.js.map +0 -1
- package/build/chunk-VDSGAA3D.js.map +0 -1
- package/build/chunk-ZS2473DH.js.map +0 -1
- package/build/dev-SOVLJFOU.js.map +0 -1
- /package/build/{LoginCommand-O4FKLPWK.js.map → LoginCommand-BP3RQHUM.js.map} +0 -0
- /package/build/{LogoutCommand-KMWHOQSC.js.map → LogoutCommand-VT4QE44U.js.map} +0 -0
- /package/build/{WhoamiCommand-VV6U2M2K.js.map → WhoamiCommand-KJFFYPZX.js.map} +0 -0
- /package/build/{chunk-VO6LL5ZT.js.map → chunk-24HYCAK2.js.map} +0 -0
- /package/build/{chunk-GOTVWNXA.js.map → chunk-3KIPOGXI.js.map} +0 -0
- /package/build/{chunk-7M5ZGODY.js.map → chunk-3R4OZ46Z.js.map} +0 -0
- /package/build/{chunk-XKFU2BID.js.map → chunk-BBGPRSAS.js.map} +0 -0
- /package/build/{chunk-CPDU7PKL.js.map → chunk-E745NXJR.js.map} +0 -0
- /package/build/{chunk-DYIK4YH5.js.map → chunk-FYXV3TNQ.js.map} +0 -0
- /package/build/{chunk-JH6KT73W.js.map → chunk-H5EUIUDE.js.map} +0 -0
- /package/build/{chunk-5PNAZQGU.js.map → chunk-IRLLAFTL.js.map} +0 -0
- /package/build/{chunk-ZPPKJBJT.js.map → chunk-KOCJZPLK.js.map} +0 -0
- /package/build/{chunk-GPZPN63O.js.map → chunk-LC4NM6RL.js.map} +0 -0
- /package/build/{chunk-M4NGCYAG.js.map → chunk-LOJ4G3VD.js.map} +0 -0
- /package/build/{chunk-7LHODQ3J.js.map → chunk-MCPHB25P.js.map} +0 -0
- /package/build/{chunk-DJCIQS36.js.map → chunk-MPSJ2YGQ.js.map} +0 -0
- /package/build/{chunk-AMEYK6DR.js.map → chunk-NX7IBYFX.js.map} +0 -0
- /package/build/{chunk-66PG2F54.js.map → chunk-QCM5RGPT.js.map} +0 -0
- /package/build/{chunk-3TWSKTSG.js.map → chunk-U2IUPRKN.js.map} +0 -0
- /package/build/{chunk-5LKWJCKW.js.map → chunk-U67ULUPY.js.map} +0 -0
- /package/build/{chunk-7IO7SVY6.js.map → chunk-VIUQV2TZ.js.map} +0 -0
- /package/build/{chunk-7DJVGV7H.js.map → chunk-XTLJ4CAJ.js.map} +0 -0
- /package/build/{chunk-VEDYEGSD.js.map → chunk-ZOWPPCOU.js.map} +0 -0
- /package/build/{render-command-GEZFKQLP.js.map → render-command-NM3HNCRF.js.map} +0 -0
- /package/build/{render-command-3PQMENAU.js.map → render-command-REKF5DLG.js.map} +0 -0
- /package/build/{render-command-BCSOTFBB.js.map → render-command-VA3HCBMQ.js.map} +0 -0
- /package/build/{run-command-YNCZR65O.js.map → run-command-ZLQ3PKCS.js.map} +0 -0
- /package/build/{src-DMDBLATB.js.map → src-BMV74WCO.js.map} +0 -0
- /package/build/{src-NRGIGSNZ.js.map → src-FSILLQWK.js.map} +0 -0
- /package/build/{src-ZB5ULVF6.js.map → src-KDZNNJHV.js.map} +0 -0
- /package/build/{src-QML4K6HI.js.map → src-Q3X5WF65.js.map} +0 -0
- /package/build/{src-QC4COOON.js.map → src-SWWZQIWT.js.map} +0 -0
- /package/build/{src-MLQVMO4G.js.map → src-YDZK3SDZ.js.map} +0 -0
- /package/build/{sync-types-2Z3FKMXE.js.map → sync-types-GLTTFJMA.js.map} +0 -0
package/build/chunk-7AAFANVT.js
DELETED
|
@@ -1,3525 +0,0 @@
|
|
|
1
|
-
import { createRequire as _createRequire } from 'node:module';
|
|
2
|
-
const require = _createRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
require_inherits
|
|
5
|
-
} from "./chunk-CVEC37T5.js";
|
|
6
|
-
import {
|
|
7
|
-
require_wcwidth
|
|
8
|
-
} from "./chunk-QLGRZABP.js";
|
|
9
|
-
import {
|
|
10
|
-
cli_cursor_default,
|
|
11
|
-
isUnicodeSupported,
|
|
12
|
-
require_cli_spinners,
|
|
13
|
-
source_default,
|
|
14
|
-
stripAnsi
|
|
15
|
-
} from "./chunk-ZS2473DH.js";
|
|
16
|
-
import {
|
|
17
|
-
__commonJS,
|
|
18
|
-
__require,
|
|
19
|
-
__toESM,
|
|
20
|
-
init_esm_shims
|
|
21
|
-
} from "./chunk-PYIAC2GK.js";
|
|
22
|
-
|
|
23
|
-
// ../../node_modules/readable-stream/lib/internal/streams/stream.js
|
|
24
|
-
var require_stream = __commonJS({
|
|
25
|
-
"../../node_modules/readable-stream/lib/internal/streams/stream.js"(exports, module) {
|
|
26
|
-
"use strict";
|
|
27
|
-
init_esm_shims();
|
|
28
|
-
module.exports = __require("stream");
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// ../../node_modules/readable-stream/lib/internal/streams/buffer_list.js
|
|
33
|
-
var require_buffer_list = __commonJS({
|
|
34
|
-
"../../node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports, module) {
|
|
35
|
-
"use strict";
|
|
36
|
-
init_esm_shims();
|
|
37
|
-
function ownKeys(object, enumerableOnly) {
|
|
38
|
-
var keys = Object.keys(object);
|
|
39
|
-
if (Object.getOwnPropertySymbols) {
|
|
40
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
41
|
-
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
42
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
43
|
-
});
|
|
44
|
-
keys.push.apply(keys, symbols);
|
|
45
|
-
}
|
|
46
|
-
return keys;
|
|
47
|
-
}
|
|
48
|
-
function _objectSpread(target) {
|
|
49
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
50
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
51
|
-
if (i % 2) {
|
|
52
|
-
ownKeys(Object(source), true).forEach(function(key) {
|
|
53
|
-
_defineProperty(target, key, source[key]);
|
|
54
|
-
});
|
|
55
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
56
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
57
|
-
} else {
|
|
58
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
59
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return target;
|
|
64
|
-
}
|
|
65
|
-
function _defineProperty(obj, key, value) {
|
|
66
|
-
if (key in obj) {
|
|
67
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
68
|
-
} else {
|
|
69
|
-
obj[key] = value;
|
|
70
|
-
}
|
|
71
|
-
return obj;
|
|
72
|
-
}
|
|
73
|
-
function _classCallCheck(instance, Constructor) {
|
|
74
|
-
if (!(instance instanceof Constructor)) {
|
|
75
|
-
throw new TypeError("Cannot call a class as a function");
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function _defineProperties(target, props) {
|
|
79
|
-
for (var i = 0; i < props.length; i++) {
|
|
80
|
-
var descriptor = props[i];
|
|
81
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
82
|
-
descriptor.configurable = true;
|
|
83
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
84
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
88
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
89
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
90
|
-
return Constructor;
|
|
91
|
-
}
|
|
92
|
-
var _require = __require("buffer");
|
|
93
|
-
var Buffer = _require.Buffer;
|
|
94
|
-
var _require2 = __require("util");
|
|
95
|
-
var inspect = _require2.inspect;
|
|
96
|
-
var custom = inspect && inspect.custom || "inspect";
|
|
97
|
-
function copyBuffer(src, target, offset) {
|
|
98
|
-
Buffer.prototype.copy.call(src, target, offset);
|
|
99
|
-
}
|
|
100
|
-
module.exports = /* @__PURE__ */ function() {
|
|
101
|
-
function BufferList() {
|
|
102
|
-
_classCallCheck(this, BufferList);
|
|
103
|
-
this.head = null;
|
|
104
|
-
this.tail = null;
|
|
105
|
-
this.length = 0;
|
|
106
|
-
}
|
|
107
|
-
_createClass(BufferList, [{
|
|
108
|
-
key: "push",
|
|
109
|
-
value: function push(v) {
|
|
110
|
-
var entry = {
|
|
111
|
-
data: v,
|
|
112
|
-
next: null
|
|
113
|
-
};
|
|
114
|
-
if (this.length > 0) this.tail.next = entry;
|
|
115
|
-
else this.head = entry;
|
|
116
|
-
this.tail = entry;
|
|
117
|
-
++this.length;
|
|
118
|
-
}
|
|
119
|
-
}, {
|
|
120
|
-
key: "unshift",
|
|
121
|
-
value: function unshift(v) {
|
|
122
|
-
var entry = {
|
|
123
|
-
data: v,
|
|
124
|
-
next: this.head
|
|
125
|
-
};
|
|
126
|
-
if (this.length === 0) this.tail = entry;
|
|
127
|
-
this.head = entry;
|
|
128
|
-
++this.length;
|
|
129
|
-
}
|
|
130
|
-
}, {
|
|
131
|
-
key: "shift",
|
|
132
|
-
value: function shift() {
|
|
133
|
-
if (this.length === 0) return;
|
|
134
|
-
var ret = this.head.data;
|
|
135
|
-
if (this.length === 1) this.head = this.tail = null;
|
|
136
|
-
else this.head = this.head.next;
|
|
137
|
-
--this.length;
|
|
138
|
-
return ret;
|
|
139
|
-
}
|
|
140
|
-
}, {
|
|
141
|
-
key: "clear",
|
|
142
|
-
value: function clear() {
|
|
143
|
-
this.head = this.tail = null;
|
|
144
|
-
this.length = 0;
|
|
145
|
-
}
|
|
146
|
-
}, {
|
|
147
|
-
key: "join",
|
|
148
|
-
value: function join(s) {
|
|
149
|
-
if (this.length === 0) return "";
|
|
150
|
-
var p = this.head;
|
|
151
|
-
var ret = "" + p.data;
|
|
152
|
-
while (p = p.next) {
|
|
153
|
-
ret += s + p.data;
|
|
154
|
-
}
|
|
155
|
-
return ret;
|
|
156
|
-
}
|
|
157
|
-
}, {
|
|
158
|
-
key: "concat",
|
|
159
|
-
value: function concat(n) {
|
|
160
|
-
if (this.length === 0) return Buffer.alloc(0);
|
|
161
|
-
var ret = Buffer.allocUnsafe(n >>> 0);
|
|
162
|
-
var p = this.head;
|
|
163
|
-
var i = 0;
|
|
164
|
-
while (p) {
|
|
165
|
-
copyBuffer(p.data, ret, i);
|
|
166
|
-
i += p.data.length;
|
|
167
|
-
p = p.next;
|
|
168
|
-
}
|
|
169
|
-
return ret;
|
|
170
|
-
}
|
|
171
|
-
// Consumes a specified amount of bytes or characters from the buffered data.
|
|
172
|
-
}, {
|
|
173
|
-
key: "consume",
|
|
174
|
-
value: function consume(n, hasStrings) {
|
|
175
|
-
var ret;
|
|
176
|
-
if (n < this.head.data.length) {
|
|
177
|
-
ret = this.head.data.slice(0, n);
|
|
178
|
-
this.head.data = this.head.data.slice(n);
|
|
179
|
-
} else if (n === this.head.data.length) {
|
|
180
|
-
ret = this.shift();
|
|
181
|
-
} else {
|
|
182
|
-
ret = hasStrings ? this._getString(n) : this._getBuffer(n);
|
|
183
|
-
}
|
|
184
|
-
return ret;
|
|
185
|
-
}
|
|
186
|
-
}, {
|
|
187
|
-
key: "first",
|
|
188
|
-
value: function first() {
|
|
189
|
-
return this.head.data;
|
|
190
|
-
}
|
|
191
|
-
// Consumes a specified amount of characters from the buffered data.
|
|
192
|
-
}, {
|
|
193
|
-
key: "_getString",
|
|
194
|
-
value: function _getString(n) {
|
|
195
|
-
var p = this.head;
|
|
196
|
-
var c = 1;
|
|
197
|
-
var ret = p.data;
|
|
198
|
-
n -= ret.length;
|
|
199
|
-
while (p = p.next) {
|
|
200
|
-
var str = p.data;
|
|
201
|
-
var nb = n > str.length ? str.length : n;
|
|
202
|
-
if (nb === str.length) ret += str;
|
|
203
|
-
else ret += str.slice(0, n);
|
|
204
|
-
n -= nb;
|
|
205
|
-
if (n === 0) {
|
|
206
|
-
if (nb === str.length) {
|
|
207
|
-
++c;
|
|
208
|
-
if (p.next) this.head = p.next;
|
|
209
|
-
else this.head = this.tail = null;
|
|
210
|
-
} else {
|
|
211
|
-
this.head = p;
|
|
212
|
-
p.data = str.slice(nb);
|
|
213
|
-
}
|
|
214
|
-
break;
|
|
215
|
-
}
|
|
216
|
-
++c;
|
|
217
|
-
}
|
|
218
|
-
this.length -= c;
|
|
219
|
-
return ret;
|
|
220
|
-
}
|
|
221
|
-
// Consumes a specified amount of bytes from the buffered data.
|
|
222
|
-
}, {
|
|
223
|
-
key: "_getBuffer",
|
|
224
|
-
value: function _getBuffer(n) {
|
|
225
|
-
var ret = Buffer.allocUnsafe(n);
|
|
226
|
-
var p = this.head;
|
|
227
|
-
var c = 1;
|
|
228
|
-
p.data.copy(ret);
|
|
229
|
-
n -= p.data.length;
|
|
230
|
-
while (p = p.next) {
|
|
231
|
-
var buf = p.data;
|
|
232
|
-
var nb = n > buf.length ? buf.length : n;
|
|
233
|
-
buf.copy(ret, ret.length - n, 0, nb);
|
|
234
|
-
n -= nb;
|
|
235
|
-
if (n === 0) {
|
|
236
|
-
if (nb === buf.length) {
|
|
237
|
-
++c;
|
|
238
|
-
if (p.next) this.head = p.next;
|
|
239
|
-
else this.head = this.tail = null;
|
|
240
|
-
} else {
|
|
241
|
-
this.head = p;
|
|
242
|
-
p.data = buf.slice(nb);
|
|
243
|
-
}
|
|
244
|
-
break;
|
|
245
|
-
}
|
|
246
|
-
++c;
|
|
247
|
-
}
|
|
248
|
-
this.length -= c;
|
|
249
|
-
return ret;
|
|
250
|
-
}
|
|
251
|
-
// Make sure the linked list only shows the minimal necessary information.
|
|
252
|
-
}, {
|
|
253
|
-
key: custom,
|
|
254
|
-
value: function value(_, options) {
|
|
255
|
-
return inspect(this, _objectSpread({}, options, {
|
|
256
|
-
// Only inspect one level.
|
|
257
|
-
depth: 0,
|
|
258
|
-
// It should not recurse.
|
|
259
|
-
customInspect: false
|
|
260
|
-
}));
|
|
261
|
-
}
|
|
262
|
-
}]);
|
|
263
|
-
return BufferList;
|
|
264
|
-
}();
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
// ../../node_modules/readable-stream/lib/internal/streams/destroy.js
|
|
269
|
-
var require_destroy = __commonJS({
|
|
270
|
-
"../../node_modules/readable-stream/lib/internal/streams/destroy.js"(exports, module) {
|
|
271
|
-
"use strict";
|
|
272
|
-
init_esm_shims();
|
|
273
|
-
function destroy(err, cb) {
|
|
274
|
-
var _this = this;
|
|
275
|
-
var readableDestroyed = this._readableState && this._readableState.destroyed;
|
|
276
|
-
var writableDestroyed = this._writableState && this._writableState.destroyed;
|
|
277
|
-
if (readableDestroyed || writableDestroyed) {
|
|
278
|
-
if (cb) {
|
|
279
|
-
cb(err);
|
|
280
|
-
} else if (err) {
|
|
281
|
-
if (!this._writableState) {
|
|
282
|
-
process.nextTick(emitErrorNT, this, err);
|
|
283
|
-
} else if (!this._writableState.errorEmitted) {
|
|
284
|
-
this._writableState.errorEmitted = true;
|
|
285
|
-
process.nextTick(emitErrorNT, this, err);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return this;
|
|
289
|
-
}
|
|
290
|
-
if (this._readableState) {
|
|
291
|
-
this._readableState.destroyed = true;
|
|
292
|
-
}
|
|
293
|
-
if (this._writableState) {
|
|
294
|
-
this._writableState.destroyed = true;
|
|
295
|
-
}
|
|
296
|
-
this._destroy(err || null, function(err2) {
|
|
297
|
-
if (!cb && err2) {
|
|
298
|
-
if (!_this._writableState) {
|
|
299
|
-
process.nextTick(emitErrorAndCloseNT, _this, err2);
|
|
300
|
-
} else if (!_this._writableState.errorEmitted) {
|
|
301
|
-
_this._writableState.errorEmitted = true;
|
|
302
|
-
process.nextTick(emitErrorAndCloseNT, _this, err2);
|
|
303
|
-
} else {
|
|
304
|
-
process.nextTick(emitCloseNT, _this);
|
|
305
|
-
}
|
|
306
|
-
} else if (cb) {
|
|
307
|
-
process.nextTick(emitCloseNT, _this);
|
|
308
|
-
cb(err2);
|
|
309
|
-
} else {
|
|
310
|
-
process.nextTick(emitCloseNT, _this);
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
return this;
|
|
314
|
-
}
|
|
315
|
-
function emitErrorAndCloseNT(self, err) {
|
|
316
|
-
emitErrorNT(self, err);
|
|
317
|
-
emitCloseNT(self);
|
|
318
|
-
}
|
|
319
|
-
function emitCloseNT(self) {
|
|
320
|
-
if (self._writableState && !self._writableState.emitClose) return;
|
|
321
|
-
if (self._readableState && !self._readableState.emitClose) return;
|
|
322
|
-
self.emit("close");
|
|
323
|
-
}
|
|
324
|
-
function undestroy() {
|
|
325
|
-
if (this._readableState) {
|
|
326
|
-
this._readableState.destroyed = false;
|
|
327
|
-
this._readableState.reading = false;
|
|
328
|
-
this._readableState.ended = false;
|
|
329
|
-
this._readableState.endEmitted = false;
|
|
330
|
-
}
|
|
331
|
-
if (this._writableState) {
|
|
332
|
-
this._writableState.destroyed = false;
|
|
333
|
-
this._writableState.ended = false;
|
|
334
|
-
this._writableState.ending = false;
|
|
335
|
-
this._writableState.finalCalled = false;
|
|
336
|
-
this._writableState.prefinished = false;
|
|
337
|
-
this._writableState.finished = false;
|
|
338
|
-
this._writableState.errorEmitted = false;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
function emitErrorNT(self, err) {
|
|
342
|
-
self.emit("error", err);
|
|
343
|
-
}
|
|
344
|
-
function errorOrDestroy(stream, err) {
|
|
345
|
-
var rState = stream._readableState;
|
|
346
|
-
var wState = stream._writableState;
|
|
347
|
-
if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);
|
|
348
|
-
else stream.emit("error", err);
|
|
349
|
-
}
|
|
350
|
-
module.exports = {
|
|
351
|
-
destroy,
|
|
352
|
-
undestroy,
|
|
353
|
-
errorOrDestroy
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
// ../../node_modules/readable-stream/errors.js
|
|
359
|
-
var require_errors = __commonJS({
|
|
360
|
-
"../../node_modules/readable-stream/errors.js"(exports, module) {
|
|
361
|
-
"use strict";
|
|
362
|
-
init_esm_shims();
|
|
363
|
-
var codes = {};
|
|
364
|
-
function createErrorType(code, message, Base) {
|
|
365
|
-
if (!Base) {
|
|
366
|
-
Base = Error;
|
|
367
|
-
}
|
|
368
|
-
function getMessage(arg1, arg2, arg3) {
|
|
369
|
-
if (typeof message === "string") {
|
|
370
|
-
return message;
|
|
371
|
-
} else {
|
|
372
|
-
return message(arg1, arg2, arg3);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
class NodeError extends Base {
|
|
376
|
-
constructor(arg1, arg2, arg3) {
|
|
377
|
-
super(getMessage(arg1, arg2, arg3));
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
NodeError.prototype.name = Base.name;
|
|
381
|
-
NodeError.prototype.code = code;
|
|
382
|
-
codes[code] = NodeError;
|
|
383
|
-
}
|
|
384
|
-
function oneOf(expected, thing) {
|
|
385
|
-
if (Array.isArray(expected)) {
|
|
386
|
-
const len = expected.length;
|
|
387
|
-
expected = expected.map((i) => String(i));
|
|
388
|
-
if (len > 2) {
|
|
389
|
-
return `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1];
|
|
390
|
-
} else if (len === 2) {
|
|
391
|
-
return `one of ${thing} ${expected[0]} or ${expected[1]}`;
|
|
392
|
-
} else {
|
|
393
|
-
return `of ${thing} ${expected[0]}`;
|
|
394
|
-
}
|
|
395
|
-
} else {
|
|
396
|
-
return `of ${thing} ${String(expected)}`;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
function startsWith(str, search, pos) {
|
|
400
|
-
return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
|
|
401
|
-
}
|
|
402
|
-
function endsWith(str, search, this_len) {
|
|
403
|
-
if (this_len === void 0 || this_len > str.length) {
|
|
404
|
-
this_len = str.length;
|
|
405
|
-
}
|
|
406
|
-
return str.substring(this_len - search.length, this_len) === search;
|
|
407
|
-
}
|
|
408
|
-
function includes(str, search, start) {
|
|
409
|
-
if (typeof start !== "number") {
|
|
410
|
-
start = 0;
|
|
411
|
-
}
|
|
412
|
-
if (start + search.length > str.length) {
|
|
413
|
-
return false;
|
|
414
|
-
} else {
|
|
415
|
-
return str.indexOf(search, start) !== -1;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) {
|
|
419
|
-
return 'The value "' + value + '" is invalid for option "' + name + '"';
|
|
420
|
-
}, TypeError);
|
|
421
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) {
|
|
422
|
-
let determiner;
|
|
423
|
-
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
424
|
-
determiner = "must not be";
|
|
425
|
-
expected = expected.replace(/^not /, "");
|
|
426
|
-
} else {
|
|
427
|
-
determiner = "must be";
|
|
428
|
-
}
|
|
429
|
-
let msg;
|
|
430
|
-
if (endsWith(name, " argument")) {
|
|
431
|
-
msg = `The ${name} ${determiner} ${oneOf(expected, "type")}`;
|
|
432
|
-
} else {
|
|
433
|
-
const type = includes(name, ".") ? "property" : "argument";
|
|
434
|
-
msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, "type")}`;
|
|
435
|
-
}
|
|
436
|
-
msg += `. Received type ${typeof actual}`;
|
|
437
|
-
return msg;
|
|
438
|
-
}, TypeError);
|
|
439
|
-
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
440
|
-
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) {
|
|
441
|
-
return "The " + name + " method is not implemented";
|
|
442
|
-
});
|
|
443
|
-
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
444
|
-
createErrorType("ERR_STREAM_DESTROYED", function(name) {
|
|
445
|
-
return "Cannot call " + name + " after a stream was destroyed";
|
|
446
|
-
});
|
|
447
|
-
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
448
|
-
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
449
|
-
createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
|
|
450
|
-
createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
|
|
451
|
-
createErrorType("ERR_UNKNOWN_ENCODING", function(arg) {
|
|
452
|
-
return "Unknown encoding: " + arg;
|
|
453
|
-
}, TypeError);
|
|
454
|
-
createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
|
|
455
|
-
module.exports.codes = codes;
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
|
|
459
|
-
// ../../node_modules/readable-stream/lib/internal/streams/state.js
|
|
460
|
-
var require_state = __commonJS({
|
|
461
|
-
"../../node_modules/readable-stream/lib/internal/streams/state.js"(exports, module) {
|
|
462
|
-
"use strict";
|
|
463
|
-
init_esm_shims();
|
|
464
|
-
var ERR_INVALID_OPT_VALUE = require_errors().codes.ERR_INVALID_OPT_VALUE;
|
|
465
|
-
function highWaterMarkFrom(options, isDuplex, duplexKey) {
|
|
466
|
-
return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
|
|
467
|
-
}
|
|
468
|
-
function getHighWaterMark(state, options, duplexKey, isDuplex) {
|
|
469
|
-
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
470
|
-
if (hwm != null) {
|
|
471
|
-
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
472
|
-
var name = isDuplex ? duplexKey : "highWaterMark";
|
|
473
|
-
throw new ERR_INVALID_OPT_VALUE(name, hwm);
|
|
474
|
-
}
|
|
475
|
-
return Math.floor(hwm);
|
|
476
|
-
}
|
|
477
|
-
return state.objectMode ? 16 : 16 * 1024;
|
|
478
|
-
}
|
|
479
|
-
module.exports = {
|
|
480
|
-
getHighWaterMark
|
|
481
|
-
};
|
|
482
|
-
}
|
|
483
|
-
});
|
|
484
|
-
|
|
485
|
-
// ../../node_modules/util-deprecate/node.js
|
|
486
|
-
var require_node = __commonJS({
|
|
487
|
-
"../../node_modules/util-deprecate/node.js"(exports, module) {
|
|
488
|
-
"use strict";
|
|
489
|
-
init_esm_shims();
|
|
490
|
-
module.exports = __require("util").deprecate;
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
|
|
494
|
-
// ../../node_modules/readable-stream/lib/_stream_writable.js
|
|
495
|
-
var require_stream_writable = __commonJS({
|
|
496
|
-
"../../node_modules/readable-stream/lib/_stream_writable.js"(exports, module) {
|
|
497
|
-
"use strict";
|
|
498
|
-
init_esm_shims();
|
|
499
|
-
module.exports = Writable;
|
|
500
|
-
function CorkedRequest(state) {
|
|
501
|
-
var _this = this;
|
|
502
|
-
this.next = null;
|
|
503
|
-
this.entry = null;
|
|
504
|
-
this.finish = function() {
|
|
505
|
-
onCorkedFinish(_this, state);
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
var Duplex;
|
|
509
|
-
Writable.WritableState = WritableState;
|
|
510
|
-
var internalUtil = {
|
|
511
|
-
deprecate: require_node()
|
|
512
|
-
};
|
|
513
|
-
var Stream = require_stream();
|
|
514
|
-
var Buffer = __require("buffer").Buffer;
|
|
515
|
-
var OurUint8Array = global.Uint8Array || function() {
|
|
516
|
-
};
|
|
517
|
-
function _uint8ArrayToBuffer(chunk) {
|
|
518
|
-
return Buffer.from(chunk);
|
|
519
|
-
}
|
|
520
|
-
function _isUint8Array(obj) {
|
|
521
|
-
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
522
|
-
}
|
|
523
|
-
var destroyImpl = require_destroy();
|
|
524
|
-
var _require = require_state();
|
|
525
|
-
var getHighWaterMark = _require.getHighWaterMark;
|
|
526
|
-
var _require$codes = require_errors().codes;
|
|
527
|
-
var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE;
|
|
528
|
-
var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
|
|
529
|
-
var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK;
|
|
530
|
-
var ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE;
|
|
531
|
-
var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
|
|
532
|
-
var ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES;
|
|
533
|
-
var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END;
|
|
534
|
-
var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
|
|
535
|
-
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
536
|
-
require_inherits()(Writable, Stream);
|
|
537
|
-
function nop() {
|
|
538
|
-
}
|
|
539
|
-
function WritableState(options, stream, isDuplex) {
|
|
540
|
-
Duplex = Duplex || require_stream_duplex();
|
|
541
|
-
options = options || {};
|
|
542
|
-
if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex;
|
|
543
|
-
this.objectMode = !!options.objectMode;
|
|
544
|
-
if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
|
|
545
|
-
this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex);
|
|
546
|
-
this.finalCalled = false;
|
|
547
|
-
this.needDrain = false;
|
|
548
|
-
this.ending = false;
|
|
549
|
-
this.ended = false;
|
|
550
|
-
this.finished = false;
|
|
551
|
-
this.destroyed = false;
|
|
552
|
-
var noDecode = options.decodeStrings === false;
|
|
553
|
-
this.decodeStrings = !noDecode;
|
|
554
|
-
this.defaultEncoding = options.defaultEncoding || "utf8";
|
|
555
|
-
this.length = 0;
|
|
556
|
-
this.writing = false;
|
|
557
|
-
this.corked = 0;
|
|
558
|
-
this.sync = true;
|
|
559
|
-
this.bufferProcessing = false;
|
|
560
|
-
this.onwrite = function(er) {
|
|
561
|
-
onwrite(stream, er);
|
|
562
|
-
};
|
|
563
|
-
this.writecb = null;
|
|
564
|
-
this.writelen = 0;
|
|
565
|
-
this.bufferedRequest = null;
|
|
566
|
-
this.lastBufferedRequest = null;
|
|
567
|
-
this.pendingcb = 0;
|
|
568
|
-
this.prefinished = false;
|
|
569
|
-
this.errorEmitted = false;
|
|
570
|
-
this.emitClose = options.emitClose !== false;
|
|
571
|
-
this.autoDestroy = !!options.autoDestroy;
|
|
572
|
-
this.bufferedRequestCount = 0;
|
|
573
|
-
this.corkedRequestsFree = new CorkedRequest(this);
|
|
574
|
-
}
|
|
575
|
-
WritableState.prototype.getBuffer = function getBuffer() {
|
|
576
|
-
var current = this.bufferedRequest;
|
|
577
|
-
var out = [];
|
|
578
|
-
while (current) {
|
|
579
|
-
out.push(current);
|
|
580
|
-
current = current.next;
|
|
581
|
-
}
|
|
582
|
-
return out;
|
|
583
|
-
};
|
|
584
|
-
(function() {
|
|
585
|
-
try {
|
|
586
|
-
Object.defineProperty(WritableState.prototype, "buffer", {
|
|
587
|
-
get: internalUtil.deprecate(function writableStateBufferGetter() {
|
|
588
|
-
return this.getBuffer();
|
|
589
|
-
}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
|
|
590
|
-
});
|
|
591
|
-
} catch (_) {
|
|
592
|
-
}
|
|
593
|
-
})();
|
|
594
|
-
var realHasInstance;
|
|
595
|
-
if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
|
|
596
|
-
realHasInstance = Function.prototype[Symbol.hasInstance];
|
|
597
|
-
Object.defineProperty(Writable, Symbol.hasInstance, {
|
|
598
|
-
value: function value(object) {
|
|
599
|
-
if (realHasInstance.call(this, object)) return true;
|
|
600
|
-
if (this !== Writable) return false;
|
|
601
|
-
return object && object._writableState instanceof WritableState;
|
|
602
|
-
}
|
|
603
|
-
});
|
|
604
|
-
} else {
|
|
605
|
-
realHasInstance = function realHasInstance2(object) {
|
|
606
|
-
return object instanceof this;
|
|
607
|
-
};
|
|
608
|
-
}
|
|
609
|
-
function Writable(options) {
|
|
610
|
-
Duplex = Duplex || require_stream_duplex();
|
|
611
|
-
var isDuplex = this instanceof Duplex;
|
|
612
|
-
if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
|
|
613
|
-
this._writableState = new WritableState(options, this, isDuplex);
|
|
614
|
-
this.writable = true;
|
|
615
|
-
if (options) {
|
|
616
|
-
if (typeof options.write === "function") this._write = options.write;
|
|
617
|
-
if (typeof options.writev === "function") this._writev = options.writev;
|
|
618
|
-
if (typeof options.destroy === "function") this._destroy = options.destroy;
|
|
619
|
-
if (typeof options.final === "function") this._final = options.final;
|
|
620
|
-
}
|
|
621
|
-
Stream.call(this);
|
|
622
|
-
}
|
|
623
|
-
Writable.prototype.pipe = function() {
|
|
624
|
-
errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
|
|
625
|
-
};
|
|
626
|
-
function writeAfterEnd(stream, cb) {
|
|
627
|
-
var er = new ERR_STREAM_WRITE_AFTER_END();
|
|
628
|
-
errorOrDestroy(stream, er);
|
|
629
|
-
process.nextTick(cb, er);
|
|
630
|
-
}
|
|
631
|
-
function validChunk(stream, state, chunk, cb) {
|
|
632
|
-
var er;
|
|
633
|
-
if (chunk === null) {
|
|
634
|
-
er = new ERR_STREAM_NULL_VALUES();
|
|
635
|
-
} else if (typeof chunk !== "string" && !state.objectMode) {
|
|
636
|
-
er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
|
|
637
|
-
}
|
|
638
|
-
if (er) {
|
|
639
|
-
errorOrDestroy(stream, er);
|
|
640
|
-
process.nextTick(cb, er);
|
|
641
|
-
return false;
|
|
642
|
-
}
|
|
643
|
-
return true;
|
|
644
|
-
}
|
|
645
|
-
Writable.prototype.write = function(chunk, encoding, cb) {
|
|
646
|
-
var state = this._writableState;
|
|
647
|
-
var ret = false;
|
|
648
|
-
var isBuf = !state.objectMode && _isUint8Array(chunk);
|
|
649
|
-
if (isBuf && !Buffer.isBuffer(chunk)) {
|
|
650
|
-
chunk = _uint8ArrayToBuffer(chunk);
|
|
651
|
-
}
|
|
652
|
-
if (typeof encoding === "function") {
|
|
653
|
-
cb = encoding;
|
|
654
|
-
encoding = null;
|
|
655
|
-
}
|
|
656
|
-
if (isBuf) encoding = "buffer";
|
|
657
|
-
else if (!encoding) encoding = state.defaultEncoding;
|
|
658
|
-
if (typeof cb !== "function") cb = nop;
|
|
659
|
-
if (state.ending) writeAfterEnd(this, cb);
|
|
660
|
-
else if (isBuf || validChunk(this, state, chunk, cb)) {
|
|
661
|
-
state.pendingcb++;
|
|
662
|
-
ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
|
|
663
|
-
}
|
|
664
|
-
return ret;
|
|
665
|
-
};
|
|
666
|
-
Writable.prototype.cork = function() {
|
|
667
|
-
this._writableState.corked++;
|
|
668
|
-
};
|
|
669
|
-
Writable.prototype.uncork = function() {
|
|
670
|
-
var state = this._writableState;
|
|
671
|
-
if (state.corked) {
|
|
672
|
-
state.corked--;
|
|
673
|
-
if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
|
|
674
|
-
}
|
|
675
|
-
};
|
|
676
|
-
Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
|
|
677
|
-
if (typeof encoding === "string") encoding = encoding.toLowerCase();
|
|
678
|
-
if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);
|
|
679
|
-
this._writableState.defaultEncoding = encoding;
|
|
680
|
-
return this;
|
|
681
|
-
};
|
|
682
|
-
Object.defineProperty(Writable.prototype, "writableBuffer", {
|
|
683
|
-
// making it explicit this property is not enumerable
|
|
684
|
-
// because otherwise some prototype manipulation in
|
|
685
|
-
// userland will fail
|
|
686
|
-
enumerable: false,
|
|
687
|
-
get: function get() {
|
|
688
|
-
return this._writableState && this._writableState.getBuffer();
|
|
689
|
-
}
|
|
690
|
-
});
|
|
691
|
-
function decodeChunk(state, chunk, encoding) {
|
|
692
|
-
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
|
|
693
|
-
chunk = Buffer.from(chunk, encoding);
|
|
694
|
-
}
|
|
695
|
-
return chunk;
|
|
696
|
-
}
|
|
697
|
-
Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
|
|
698
|
-
// making it explicit this property is not enumerable
|
|
699
|
-
// because otherwise some prototype manipulation in
|
|
700
|
-
// userland will fail
|
|
701
|
-
enumerable: false,
|
|
702
|
-
get: function get() {
|
|
703
|
-
return this._writableState.highWaterMark;
|
|
704
|
-
}
|
|
705
|
-
});
|
|
706
|
-
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
|
|
707
|
-
if (!isBuf) {
|
|
708
|
-
var newChunk = decodeChunk(state, chunk, encoding);
|
|
709
|
-
if (chunk !== newChunk) {
|
|
710
|
-
isBuf = true;
|
|
711
|
-
encoding = "buffer";
|
|
712
|
-
chunk = newChunk;
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
var len = state.objectMode ? 1 : chunk.length;
|
|
716
|
-
state.length += len;
|
|
717
|
-
var ret = state.length < state.highWaterMark;
|
|
718
|
-
if (!ret) state.needDrain = true;
|
|
719
|
-
if (state.writing || state.corked) {
|
|
720
|
-
var last = state.lastBufferedRequest;
|
|
721
|
-
state.lastBufferedRequest = {
|
|
722
|
-
chunk,
|
|
723
|
-
encoding,
|
|
724
|
-
isBuf,
|
|
725
|
-
callback: cb,
|
|
726
|
-
next: null
|
|
727
|
-
};
|
|
728
|
-
if (last) {
|
|
729
|
-
last.next = state.lastBufferedRequest;
|
|
730
|
-
} else {
|
|
731
|
-
state.bufferedRequest = state.lastBufferedRequest;
|
|
732
|
-
}
|
|
733
|
-
state.bufferedRequestCount += 1;
|
|
734
|
-
} else {
|
|
735
|
-
doWrite(stream, state, false, len, chunk, encoding, cb);
|
|
736
|
-
}
|
|
737
|
-
return ret;
|
|
738
|
-
}
|
|
739
|
-
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
|
|
740
|
-
state.writelen = len;
|
|
741
|
-
state.writecb = cb;
|
|
742
|
-
state.writing = true;
|
|
743
|
-
state.sync = true;
|
|
744
|
-
if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write"));
|
|
745
|
-
else if (writev) stream._writev(chunk, state.onwrite);
|
|
746
|
-
else stream._write(chunk, encoding, state.onwrite);
|
|
747
|
-
state.sync = false;
|
|
748
|
-
}
|
|
749
|
-
function onwriteError(stream, state, sync, er, cb) {
|
|
750
|
-
--state.pendingcb;
|
|
751
|
-
if (sync) {
|
|
752
|
-
process.nextTick(cb, er);
|
|
753
|
-
process.nextTick(finishMaybe, stream, state);
|
|
754
|
-
stream._writableState.errorEmitted = true;
|
|
755
|
-
errorOrDestroy(stream, er);
|
|
756
|
-
} else {
|
|
757
|
-
cb(er);
|
|
758
|
-
stream._writableState.errorEmitted = true;
|
|
759
|
-
errorOrDestroy(stream, er);
|
|
760
|
-
finishMaybe(stream, state);
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
function onwriteStateUpdate(state) {
|
|
764
|
-
state.writing = false;
|
|
765
|
-
state.writecb = null;
|
|
766
|
-
state.length -= state.writelen;
|
|
767
|
-
state.writelen = 0;
|
|
768
|
-
}
|
|
769
|
-
function onwrite(stream, er) {
|
|
770
|
-
var state = stream._writableState;
|
|
771
|
-
var sync = state.sync;
|
|
772
|
-
var cb = state.writecb;
|
|
773
|
-
if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK();
|
|
774
|
-
onwriteStateUpdate(state);
|
|
775
|
-
if (er) onwriteError(stream, state, sync, er, cb);
|
|
776
|
-
else {
|
|
777
|
-
var finished = needFinish(state) || stream.destroyed;
|
|
778
|
-
if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
|
|
779
|
-
clearBuffer(stream, state);
|
|
780
|
-
}
|
|
781
|
-
if (sync) {
|
|
782
|
-
process.nextTick(afterWrite, stream, state, finished, cb);
|
|
783
|
-
} else {
|
|
784
|
-
afterWrite(stream, state, finished, cb);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
function afterWrite(stream, state, finished, cb) {
|
|
789
|
-
if (!finished) onwriteDrain(stream, state);
|
|
790
|
-
state.pendingcb--;
|
|
791
|
-
cb();
|
|
792
|
-
finishMaybe(stream, state);
|
|
793
|
-
}
|
|
794
|
-
function onwriteDrain(stream, state) {
|
|
795
|
-
if (state.length === 0 && state.needDrain) {
|
|
796
|
-
state.needDrain = false;
|
|
797
|
-
stream.emit("drain");
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
function clearBuffer(stream, state) {
|
|
801
|
-
state.bufferProcessing = true;
|
|
802
|
-
var entry = state.bufferedRequest;
|
|
803
|
-
if (stream._writev && entry && entry.next) {
|
|
804
|
-
var l = state.bufferedRequestCount;
|
|
805
|
-
var buffer = new Array(l);
|
|
806
|
-
var holder = state.corkedRequestsFree;
|
|
807
|
-
holder.entry = entry;
|
|
808
|
-
var count = 0;
|
|
809
|
-
var allBuffers = true;
|
|
810
|
-
while (entry) {
|
|
811
|
-
buffer[count] = entry;
|
|
812
|
-
if (!entry.isBuf) allBuffers = false;
|
|
813
|
-
entry = entry.next;
|
|
814
|
-
count += 1;
|
|
815
|
-
}
|
|
816
|
-
buffer.allBuffers = allBuffers;
|
|
817
|
-
doWrite(stream, state, true, state.length, buffer, "", holder.finish);
|
|
818
|
-
state.pendingcb++;
|
|
819
|
-
state.lastBufferedRequest = null;
|
|
820
|
-
if (holder.next) {
|
|
821
|
-
state.corkedRequestsFree = holder.next;
|
|
822
|
-
holder.next = null;
|
|
823
|
-
} else {
|
|
824
|
-
state.corkedRequestsFree = new CorkedRequest(state);
|
|
825
|
-
}
|
|
826
|
-
state.bufferedRequestCount = 0;
|
|
827
|
-
} else {
|
|
828
|
-
while (entry) {
|
|
829
|
-
var chunk = entry.chunk;
|
|
830
|
-
var encoding = entry.encoding;
|
|
831
|
-
var cb = entry.callback;
|
|
832
|
-
var len = state.objectMode ? 1 : chunk.length;
|
|
833
|
-
doWrite(stream, state, false, len, chunk, encoding, cb);
|
|
834
|
-
entry = entry.next;
|
|
835
|
-
state.bufferedRequestCount--;
|
|
836
|
-
if (state.writing) {
|
|
837
|
-
break;
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
if (entry === null) state.lastBufferedRequest = null;
|
|
841
|
-
}
|
|
842
|
-
state.bufferedRequest = entry;
|
|
843
|
-
state.bufferProcessing = false;
|
|
844
|
-
}
|
|
845
|
-
Writable.prototype._write = function(chunk, encoding, cb) {
|
|
846
|
-
cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()"));
|
|
847
|
-
};
|
|
848
|
-
Writable.prototype._writev = null;
|
|
849
|
-
Writable.prototype.end = function(chunk, encoding, cb) {
|
|
850
|
-
var state = this._writableState;
|
|
851
|
-
if (typeof chunk === "function") {
|
|
852
|
-
cb = chunk;
|
|
853
|
-
chunk = null;
|
|
854
|
-
encoding = null;
|
|
855
|
-
} else if (typeof encoding === "function") {
|
|
856
|
-
cb = encoding;
|
|
857
|
-
encoding = null;
|
|
858
|
-
}
|
|
859
|
-
if (chunk !== null && chunk !== void 0) this.write(chunk, encoding);
|
|
860
|
-
if (state.corked) {
|
|
861
|
-
state.corked = 1;
|
|
862
|
-
this.uncork();
|
|
863
|
-
}
|
|
864
|
-
if (!state.ending) endWritable(this, state, cb);
|
|
865
|
-
return this;
|
|
866
|
-
};
|
|
867
|
-
Object.defineProperty(Writable.prototype, "writableLength", {
|
|
868
|
-
// making it explicit this property is not enumerable
|
|
869
|
-
// because otherwise some prototype manipulation in
|
|
870
|
-
// userland will fail
|
|
871
|
-
enumerable: false,
|
|
872
|
-
get: function get() {
|
|
873
|
-
return this._writableState.length;
|
|
874
|
-
}
|
|
875
|
-
});
|
|
876
|
-
function needFinish(state) {
|
|
877
|
-
return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
|
|
878
|
-
}
|
|
879
|
-
function callFinal(stream, state) {
|
|
880
|
-
stream._final(function(err) {
|
|
881
|
-
state.pendingcb--;
|
|
882
|
-
if (err) {
|
|
883
|
-
errorOrDestroy(stream, err);
|
|
884
|
-
}
|
|
885
|
-
state.prefinished = true;
|
|
886
|
-
stream.emit("prefinish");
|
|
887
|
-
finishMaybe(stream, state);
|
|
888
|
-
});
|
|
889
|
-
}
|
|
890
|
-
function prefinish(stream, state) {
|
|
891
|
-
if (!state.prefinished && !state.finalCalled) {
|
|
892
|
-
if (typeof stream._final === "function" && !state.destroyed) {
|
|
893
|
-
state.pendingcb++;
|
|
894
|
-
state.finalCalled = true;
|
|
895
|
-
process.nextTick(callFinal, stream, state);
|
|
896
|
-
} else {
|
|
897
|
-
state.prefinished = true;
|
|
898
|
-
stream.emit("prefinish");
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
function finishMaybe(stream, state) {
|
|
903
|
-
var need = needFinish(state);
|
|
904
|
-
if (need) {
|
|
905
|
-
prefinish(stream, state);
|
|
906
|
-
if (state.pendingcb === 0) {
|
|
907
|
-
state.finished = true;
|
|
908
|
-
stream.emit("finish");
|
|
909
|
-
if (state.autoDestroy) {
|
|
910
|
-
var rState = stream._readableState;
|
|
911
|
-
if (!rState || rState.autoDestroy && rState.endEmitted) {
|
|
912
|
-
stream.destroy();
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
return need;
|
|
918
|
-
}
|
|
919
|
-
function endWritable(stream, state, cb) {
|
|
920
|
-
state.ending = true;
|
|
921
|
-
finishMaybe(stream, state);
|
|
922
|
-
if (cb) {
|
|
923
|
-
if (state.finished) process.nextTick(cb);
|
|
924
|
-
else stream.once("finish", cb);
|
|
925
|
-
}
|
|
926
|
-
state.ended = true;
|
|
927
|
-
stream.writable = false;
|
|
928
|
-
}
|
|
929
|
-
function onCorkedFinish(corkReq, state, err) {
|
|
930
|
-
var entry = corkReq.entry;
|
|
931
|
-
corkReq.entry = null;
|
|
932
|
-
while (entry) {
|
|
933
|
-
var cb = entry.callback;
|
|
934
|
-
state.pendingcb--;
|
|
935
|
-
cb(err);
|
|
936
|
-
entry = entry.next;
|
|
937
|
-
}
|
|
938
|
-
state.corkedRequestsFree.next = corkReq;
|
|
939
|
-
}
|
|
940
|
-
Object.defineProperty(Writable.prototype, "destroyed", {
|
|
941
|
-
// making it explicit this property is not enumerable
|
|
942
|
-
// because otherwise some prototype manipulation in
|
|
943
|
-
// userland will fail
|
|
944
|
-
enumerable: false,
|
|
945
|
-
get: function get() {
|
|
946
|
-
if (this._writableState === void 0) {
|
|
947
|
-
return false;
|
|
948
|
-
}
|
|
949
|
-
return this._writableState.destroyed;
|
|
950
|
-
},
|
|
951
|
-
set: function set(value) {
|
|
952
|
-
if (!this._writableState) {
|
|
953
|
-
return;
|
|
954
|
-
}
|
|
955
|
-
this._writableState.destroyed = value;
|
|
956
|
-
}
|
|
957
|
-
});
|
|
958
|
-
Writable.prototype.destroy = destroyImpl.destroy;
|
|
959
|
-
Writable.prototype._undestroy = destroyImpl.undestroy;
|
|
960
|
-
Writable.prototype._destroy = function(err, cb) {
|
|
961
|
-
cb(err);
|
|
962
|
-
};
|
|
963
|
-
}
|
|
964
|
-
});
|
|
965
|
-
|
|
966
|
-
// ../../node_modules/readable-stream/lib/_stream_duplex.js
|
|
967
|
-
var require_stream_duplex = __commonJS({
|
|
968
|
-
"../../node_modules/readable-stream/lib/_stream_duplex.js"(exports, module) {
|
|
969
|
-
"use strict";
|
|
970
|
-
init_esm_shims();
|
|
971
|
-
var objectKeys = Object.keys || function(obj) {
|
|
972
|
-
var keys2 = [];
|
|
973
|
-
for (var key in obj) {
|
|
974
|
-
keys2.push(key);
|
|
975
|
-
}
|
|
976
|
-
return keys2;
|
|
977
|
-
};
|
|
978
|
-
module.exports = Duplex;
|
|
979
|
-
var Readable = require_stream_readable();
|
|
980
|
-
var Writable = require_stream_writable();
|
|
981
|
-
require_inherits()(Duplex, Readable);
|
|
982
|
-
{
|
|
983
|
-
keys = objectKeys(Writable.prototype);
|
|
984
|
-
for (v = 0; v < keys.length; v++) {
|
|
985
|
-
method = keys[v];
|
|
986
|
-
if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
var keys;
|
|
990
|
-
var method;
|
|
991
|
-
var v;
|
|
992
|
-
function Duplex(options) {
|
|
993
|
-
if (!(this instanceof Duplex)) return new Duplex(options);
|
|
994
|
-
Readable.call(this, options);
|
|
995
|
-
Writable.call(this, options);
|
|
996
|
-
this.allowHalfOpen = true;
|
|
997
|
-
if (options) {
|
|
998
|
-
if (options.readable === false) this.readable = false;
|
|
999
|
-
if (options.writable === false) this.writable = false;
|
|
1000
|
-
if (options.allowHalfOpen === false) {
|
|
1001
|
-
this.allowHalfOpen = false;
|
|
1002
|
-
this.once("end", onend);
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
|
|
1007
|
-
// making it explicit this property is not enumerable
|
|
1008
|
-
// because otherwise some prototype manipulation in
|
|
1009
|
-
// userland will fail
|
|
1010
|
-
enumerable: false,
|
|
1011
|
-
get: function get() {
|
|
1012
|
-
return this._writableState.highWaterMark;
|
|
1013
|
-
}
|
|
1014
|
-
});
|
|
1015
|
-
Object.defineProperty(Duplex.prototype, "writableBuffer", {
|
|
1016
|
-
// making it explicit this property is not enumerable
|
|
1017
|
-
// because otherwise some prototype manipulation in
|
|
1018
|
-
// userland will fail
|
|
1019
|
-
enumerable: false,
|
|
1020
|
-
get: function get() {
|
|
1021
|
-
return this._writableState && this._writableState.getBuffer();
|
|
1022
|
-
}
|
|
1023
|
-
});
|
|
1024
|
-
Object.defineProperty(Duplex.prototype, "writableLength", {
|
|
1025
|
-
// making it explicit this property is not enumerable
|
|
1026
|
-
// because otherwise some prototype manipulation in
|
|
1027
|
-
// userland will fail
|
|
1028
|
-
enumerable: false,
|
|
1029
|
-
get: function get() {
|
|
1030
|
-
return this._writableState.length;
|
|
1031
|
-
}
|
|
1032
|
-
});
|
|
1033
|
-
function onend() {
|
|
1034
|
-
if (this._writableState.ended) return;
|
|
1035
|
-
process.nextTick(onEndNT, this);
|
|
1036
|
-
}
|
|
1037
|
-
function onEndNT(self) {
|
|
1038
|
-
self.end();
|
|
1039
|
-
}
|
|
1040
|
-
Object.defineProperty(Duplex.prototype, "destroyed", {
|
|
1041
|
-
// making it explicit this property is not enumerable
|
|
1042
|
-
// because otherwise some prototype manipulation in
|
|
1043
|
-
// userland will fail
|
|
1044
|
-
enumerable: false,
|
|
1045
|
-
get: function get() {
|
|
1046
|
-
if (this._readableState === void 0 || this._writableState === void 0) {
|
|
1047
|
-
return false;
|
|
1048
|
-
}
|
|
1049
|
-
return this._readableState.destroyed && this._writableState.destroyed;
|
|
1050
|
-
},
|
|
1051
|
-
set: function set(value) {
|
|
1052
|
-
if (this._readableState === void 0 || this._writableState === void 0) {
|
|
1053
|
-
return;
|
|
1054
|
-
}
|
|
1055
|
-
this._readableState.destroyed = value;
|
|
1056
|
-
this._writableState.destroyed = value;
|
|
1057
|
-
}
|
|
1058
|
-
});
|
|
1059
|
-
}
|
|
1060
|
-
});
|
|
1061
|
-
|
|
1062
|
-
// ../../node_modules/safe-buffer/index.js
|
|
1063
|
-
var require_safe_buffer = __commonJS({
|
|
1064
|
-
"../../node_modules/safe-buffer/index.js"(exports, module) {
|
|
1065
|
-
"use strict";
|
|
1066
|
-
init_esm_shims();
|
|
1067
|
-
var buffer = __require("buffer");
|
|
1068
|
-
var Buffer = buffer.Buffer;
|
|
1069
|
-
function copyProps(src, dst) {
|
|
1070
|
-
for (var key in src) {
|
|
1071
|
-
dst[key] = src[key];
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
|
|
1075
|
-
module.exports = buffer;
|
|
1076
|
-
} else {
|
|
1077
|
-
copyProps(buffer, exports);
|
|
1078
|
-
exports.Buffer = SafeBuffer;
|
|
1079
|
-
}
|
|
1080
|
-
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
1081
|
-
return Buffer(arg, encodingOrOffset, length);
|
|
1082
|
-
}
|
|
1083
|
-
SafeBuffer.prototype = Object.create(Buffer.prototype);
|
|
1084
|
-
copyProps(Buffer, SafeBuffer);
|
|
1085
|
-
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
1086
|
-
if (typeof arg === "number") {
|
|
1087
|
-
throw new TypeError("Argument must not be a number");
|
|
1088
|
-
}
|
|
1089
|
-
return Buffer(arg, encodingOrOffset, length);
|
|
1090
|
-
};
|
|
1091
|
-
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
1092
|
-
if (typeof size !== "number") {
|
|
1093
|
-
throw new TypeError("Argument must be a number");
|
|
1094
|
-
}
|
|
1095
|
-
var buf = Buffer(size);
|
|
1096
|
-
if (fill !== void 0) {
|
|
1097
|
-
if (typeof encoding === "string") {
|
|
1098
|
-
buf.fill(fill, encoding);
|
|
1099
|
-
} else {
|
|
1100
|
-
buf.fill(fill);
|
|
1101
|
-
}
|
|
1102
|
-
} else {
|
|
1103
|
-
buf.fill(0);
|
|
1104
|
-
}
|
|
1105
|
-
return buf;
|
|
1106
|
-
};
|
|
1107
|
-
SafeBuffer.allocUnsafe = function(size) {
|
|
1108
|
-
if (typeof size !== "number") {
|
|
1109
|
-
throw new TypeError("Argument must be a number");
|
|
1110
|
-
}
|
|
1111
|
-
return Buffer(size);
|
|
1112
|
-
};
|
|
1113
|
-
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
1114
|
-
if (typeof size !== "number") {
|
|
1115
|
-
throw new TypeError("Argument must be a number");
|
|
1116
|
-
}
|
|
1117
|
-
return buffer.SlowBuffer(size);
|
|
1118
|
-
};
|
|
1119
|
-
}
|
|
1120
|
-
});
|
|
1121
|
-
|
|
1122
|
-
// ../../node_modules/string_decoder/lib/string_decoder.js
|
|
1123
|
-
var require_string_decoder = __commonJS({
|
|
1124
|
-
"../../node_modules/string_decoder/lib/string_decoder.js"(exports) {
|
|
1125
|
-
"use strict";
|
|
1126
|
-
init_esm_shims();
|
|
1127
|
-
var Buffer = require_safe_buffer().Buffer;
|
|
1128
|
-
var isEncoding = Buffer.isEncoding || function(encoding) {
|
|
1129
|
-
encoding = "" + encoding;
|
|
1130
|
-
switch (encoding && encoding.toLowerCase()) {
|
|
1131
|
-
case "hex":
|
|
1132
|
-
case "utf8":
|
|
1133
|
-
case "utf-8":
|
|
1134
|
-
case "ascii":
|
|
1135
|
-
case "binary":
|
|
1136
|
-
case "base64":
|
|
1137
|
-
case "ucs2":
|
|
1138
|
-
case "ucs-2":
|
|
1139
|
-
case "utf16le":
|
|
1140
|
-
case "utf-16le":
|
|
1141
|
-
case "raw":
|
|
1142
|
-
return true;
|
|
1143
|
-
default:
|
|
1144
|
-
return false;
|
|
1145
|
-
}
|
|
1146
|
-
};
|
|
1147
|
-
function _normalizeEncoding(enc) {
|
|
1148
|
-
if (!enc) return "utf8";
|
|
1149
|
-
var retried;
|
|
1150
|
-
while (true) {
|
|
1151
|
-
switch (enc) {
|
|
1152
|
-
case "utf8":
|
|
1153
|
-
case "utf-8":
|
|
1154
|
-
return "utf8";
|
|
1155
|
-
case "ucs2":
|
|
1156
|
-
case "ucs-2":
|
|
1157
|
-
case "utf16le":
|
|
1158
|
-
case "utf-16le":
|
|
1159
|
-
return "utf16le";
|
|
1160
|
-
case "latin1":
|
|
1161
|
-
case "binary":
|
|
1162
|
-
return "latin1";
|
|
1163
|
-
case "base64":
|
|
1164
|
-
case "ascii":
|
|
1165
|
-
case "hex":
|
|
1166
|
-
return enc;
|
|
1167
|
-
default:
|
|
1168
|
-
if (retried) return;
|
|
1169
|
-
enc = ("" + enc).toLowerCase();
|
|
1170
|
-
retried = true;
|
|
1171
|
-
}
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
function normalizeEncoding(enc) {
|
|
1175
|
-
var nenc = _normalizeEncoding(enc);
|
|
1176
|
-
if (typeof nenc !== "string" && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
|
|
1177
|
-
return nenc || enc;
|
|
1178
|
-
}
|
|
1179
|
-
exports.StringDecoder = StringDecoder;
|
|
1180
|
-
function StringDecoder(encoding) {
|
|
1181
|
-
this.encoding = normalizeEncoding(encoding);
|
|
1182
|
-
var nb;
|
|
1183
|
-
switch (this.encoding) {
|
|
1184
|
-
case "utf16le":
|
|
1185
|
-
this.text = utf16Text;
|
|
1186
|
-
this.end = utf16End;
|
|
1187
|
-
nb = 4;
|
|
1188
|
-
break;
|
|
1189
|
-
case "utf8":
|
|
1190
|
-
this.fillLast = utf8FillLast;
|
|
1191
|
-
nb = 4;
|
|
1192
|
-
break;
|
|
1193
|
-
case "base64":
|
|
1194
|
-
this.text = base64Text;
|
|
1195
|
-
this.end = base64End;
|
|
1196
|
-
nb = 3;
|
|
1197
|
-
break;
|
|
1198
|
-
default:
|
|
1199
|
-
this.write = simpleWrite;
|
|
1200
|
-
this.end = simpleEnd;
|
|
1201
|
-
return;
|
|
1202
|
-
}
|
|
1203
|
-
this.lastNeed = 0;
|
|
1204
|
-
this.lastTotal = 0;
|
|
1205
|
-
this.lastChar = Buffer.allocUnsafe(nb);
|
|
1206
|
-
}
|
|
1207
|
-
StringDecoder.prototype.write = function(buf) {
|
|
1208
|
-
if (buf.length === 0) return "";
|
|
1209
|
-
var r;
|
|
1210
|
-
var i;
|
|
1211
|
-
if (this.lastNeed) {
|
|
1212
|
-
r = this.fillLast(buf);
|
|
1213
|
-
if (r === void 0) return "";
|
|
1214
|
-
i = this.lastNeed;
|
|
1215
|
-
this.lastNeed = 0;
|
|
1216
|
-
} else {
|
|
1217
|
-
i = 0;
|
|
1218
|
-
}
|
|
1219
|
-
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
|
|
1220
|
-
return r || "";
|
|
1221
|
-
};
|
|
1222
|
-
StringDecoder.prototype.end = utf8End;
|
|
1223
|
-
StringDecoder.prototype.text = utf8Text;
|
|
1224
|
-
StringDecoder.prototype.fillLast = function(buf) {
|
|
1225
|
-
if (this.lastNeed <= buf.length) {
|
|
1226
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
|
|
1227
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
1228
|
-
}
|
|
1229
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
|
|
1230
|
-
this.lastNeed -= buf.length;
|
|
1231
|
-
};
|
|
1232
|
-
function utf8CheckByte(byte) {
|
|
1233
|
-
if (byte <= 127) return 0;
|
|
1234
|
-
else if (byte >> 5 === 6) return 2;
|
|
1235
|
-
else if (byte >> 4 === 14) return 3;
|
|
1236
|
-
else if (byte >> 3 === 30) return 4;
|
|
1237
|
-
return byte >> 6 === 2 ? -1 : -2;
|
|
1238
|
-
}
|
|
1239
|
-
function utf8CheckIncomplete(self, buf, i) {
|
|
1240
|
-
var j = buf.length - 1;
|
|
1241
|
-
if (j < i) return 0;
|
|
1242
|
-
var nb = utf8CheckByte(buf[j]);
|
|
1243
|
-
if (nb >= 0) {
|
|
1244
|
-
if (nb > 0) self.lastNeed = nb - 1;
|
|
1245
|
-
return nb;
|
|
1246
|
-
}
|
|
1247
|
-
if (--j < i || nb === -2) return 0;
|
|
1248
|
-
nb = utf8CheckByte(buf[j]);
|
|
1249
|
-
if (nb >= 0) {
|
|
1250
|
-
if (nb > 0) self.lastNeed = nb - 2;
|
|
1251
|
-
return nb;
|
|
1252
|
-
}
|
|
1253
|
-
if (--j < i || nb === -2) return 0;
|
|
1254
|
-
nb = utf8CheckByte(buf[j]);
|
|
1255
|
-
if (nb >= 0) {
|
|
1256
|
-
if (nb > 0) {
|
|
1257
|
-
if (nb === 2) nb = 0;
|
|
1258
|
-
else self.lastNeed = nb - 3;
|
|
1259
|
-
}
|
|
1260
|
-
return nb;
|
|
1261
|
-
}
|
|
1262
|
-
return 0;
|
|
1263
|
-
}
|
|
1264
|
-
function utf8CheckExtraBytes(self, buf, p) {
|
|
1265
|
-
if ((buf[0] & 192) !== 128) {
|
|
1266
|
-
self.lastNeed = 0;
|
|
1267
|
-
return "\uFFFD";
|
|
1268
|
-
}
|
|
1269
|
-
if (self.lastNeed > 1 && buf.length > 1) {
|
|
1270
|
-
if ((buf[1] & 192) !== 128) {
|
|
1271
|
-
self.lastNeed = 1;
|
|
1272
|
-
return "\uFFFD";
|
|
1273
|
-
}
|
|
1274
|
-
if (self.lastNeed > 2 && buf.length > 2) {
|
|
1275
|
-
if ((buf[2] & 192) !== 128) {
|
|
1276
|
-
self.lastNeed = 2;
|
|
1277
|
-
return "\uFFFD";
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
function utf8FillLast(buf) {
|
|
1283
|
-
var p = this.lastTotal - this.lastNeed;
|
|
1284
|
-
var r = utf8CheckExtraBytes(this, buf, p);
|
|
1285
|
-
if (r !== void 0) return r;
|
|
1286
|
-
if (this.lastNeed <= buf.length) {
|
|
1287
|
-
buf.copy(this.lastChar, p, 0, this.lastNeed);
|
|
1288
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
1289
|
-
}
|
|
1290
|
-
buf.copy(this.lastChar, p, 0, buf.length);
|
|
1291
|
-
this.lastNeed -= buf.length;
|
|
1292
|
-
}
|
|
1293
|
-
function utf8Text(buf, i) {
|
|
1294
|
-
var total = utf8CheckIncomplete(this, buf, i);
|
|
1295
|
-
if (!this.lastNeed) return buf.toString("utf8", i);
|
|
1296
|
-
this.lastTotal = total;
|
|
1297
|
-
var end = buf.length - (total - this.lastNeed);
|
|
1298
|
-
buf.copy(this.lastChar, 0, end);
|
|
1299
|
-
return buf.toString("utf8", i, end);
|
|
1300
|
-
}
|
|
1301
|
-
function utf8End(buf) {
|
|
1302
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
1303
|
-
if (this.lastNeed) return r + "\uFFFD";
|
|
1304
|
-
return r;
|
|
1305
|
-
}
|
|
1306
|
-
function utf16Text(buf, i) {
|
|
1307
|
-
if ((buf.length - i) % 2 === 0) {
|
|
1308
|
-
var r = buf.toString("utf16le", i);
|
|
1309
|
-
if (r) {
|
|
1310
|
-
var c = r.charCodeAt(r.length - 1);
|
|
1311
|
-
if (c >= 55296 && c <= 56319) {
|
|
1312
|
-
this.lastNeed = 2;
|
|
1313
|
-
this.lastTotal = 4;
|
|
1314
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
1315
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
1316
|
-
return r.slice(0, -1);
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
return r;
|
|
1320
|
-
}
|
|
1321
|
-
this.lastNeed = 1;
|
|
1322
|
-
this.lastTotal = 2;
|
|
1323
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
1324
|
-
return buf.toString("utf16le", i, buf.length - 1);
|
|
1325
|
-
}
|
|
1326
|
-
function utf16End(buf) {
|
|
1327
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
1328
|
-
if (this.lastNeed) {
|
|
1329
|
-
var end = this.lastTotal - this.lastNeed;
|
|
1330
|
-
return r + this.lastChar.toString("utf16le", 0, end);
|
|
1331
|
-
}
|
|
1332
|
-
return r;
|
|
1333
|
-
}
|
|
1334
|
-
function base64Text(buf, i) {
|
|
1335
|
-
var n = (buf.length - i) % 3;
|
|
1336
|
-
if (n === 0) return buf.toString("base64", i);
|
|
1337
|
-
this.lastNeed = 3 - n;
|
|
1338
|
-
this.lastTotal = 3;
|
|
1339
|
-
if (n === 1) {
|
|
1340
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
1341
|
-
} else {
|
|
1342
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
1343
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
1344
|
-
}
|
|
1345
|
-
return buf.toString("base64", i, buf.length - n);
|
|
1346
|
-
}
|
|
1347
|
-
function base64End(buf) {
|
|
1348
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
1349
|
-
if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
|
|
1350
|
-
return r;
|
|
1351
|
-
}
|
|
1352
|
-
function simpleWrite(buf) {
|
|
1353
|
-
return buf.toString(this.encoding);
|
|
1354
|
-
}
|
|
1355
|
-
function simpleEnd(buf) {
|
|
1356
|
-
return buf && buf.length ? this.write(buf) : "";
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
});
|
|
1360
|
-
|
|
1361
|
-
// ../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js
|
|
1362
|
-
var require_end_of_stream = __commonJS({
|
|
1363
|
-
"../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports, module) {
|
|
1364
|
-
"use strict";
|
|
1365
|
-
init_esm_shims();
|
|
1366
|
-
var ERR_STREAM_PREMATURE_CLOSE = require_errors().codes.ERR_STREAM_PREMATURE_CLOSE;
|
|
1367
|
-
function once(callback) {
|
|
1368
|
-
var called = false;
|
|
1369
|
-
return function() {
|
|
1370
|
-
if (called) return;
|
|
1371
|
-
called = true;
|
|
1372
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1373
|
-
args[_key] = arguments[_key];
|
|
1374
|
-
}
|
|
1375
|
-
callback.apply(this, args);
|
|
1376
|
-
};
|
|
1377
|
-
}
|
|
1378
|
-
function noop() {
|
|
1379
|
-
}
|
|
1380
|
-
function isRequest(stream) {
|
|
1381
|
-
return stream.setHeader && typeof stream.abort === "function";
|
|
1382
|
-
}
|
|
1383
|
-
function eos(stream, opts, callback) {
|
|
1384
|
-
if (typeof opts === "function") return eos(stream, null, opts);
|
|
1385
|
-
if (!opts) opts = {};
|
|
1386
|
-
callback = once(callback || noop);
|
|
1387
|
-
var readable = opts.readable || opts.readable !== false && stream.readable;
|
|
1388
|
-
var writable = opts.writable || opts.writable !== false && stream.writable;
|
|
1389
|
-
var onlegacyfinish = function onlegacyfinish2() {
|
|
1390
|
-
if (!stream.writable) onfinish();
|
|
1391
|
-
};
|
|
1392
|
-
var writableEnded = stream._writableState && stream._writableState.finished;
|
|
1393
|
-
var onfinish = function onfinish2() {
|
|
1394
|
-
writable = false;
|
|
1395
|
-
writableEnded = true;
|
|
1396
|
-
if (!readable) callback.call(stream);
|
|
1397
|
-
};
|
|
1398
|
-
var readableEnded = stream._readableState && stream._readableState.endEmitted;
|
|
1399
|
-
var onend = function onend2() {
|
|
1400
|
-
readable = false;
|
|
1401
|
-
readableEnded = true;
|
|
1402
|
-
if (!writable) callback.call(stream);
|
|
1403
|
-
};
|
|
1404
|
-
var onerror = function onerror2(err) {
|
|
1405
|
-
callback.call(stream, err);
|
|
1406
|
-
};
|
|
1407
|
-
var onclose = function onclose2() {
|
|
1408
|
-
var err;
|
|
1409
|
-
if (readable && !readableEnded) {
|
|
1410
|
-
if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
|
|
1411
|
-
return callback.call(stream, err);
|
|
1412
|
-
}
|
|
1413
|
-
if (writable && !writableEnded) {
|
|
1414
|
-
if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
|
|
1415
|
-
return callback.call(stream, err);
|
|
1416
|
-
}
|
|
1417
|
-
};
|
|
1418
|
-
var onrequest = function onrequest2() {
|
|
1419
|
-
stream.req.on("finish", onfinish);
|
|
1420
|
-
};
|
|
1421
|
-
if (isRequest(stream)) {
|
|
1422
|
-
stream.on("complete", onfinish);
|
|
1423
|
-
stream.on("abort", onclose);
|
|
1424
|
-
if (stream.req) onrequest();
|
|
1425
|
-
else stream.on("request", onrequest);
|
|
1426
|
-
} else if (writable && !stream._writableState) {
|
|
1427
|
-
stream.on("end", onlegacyfinish);
|
|
1428
|
-
stream.on("close", onlegacyfinish);
|
|
1429
|
-
}
|
|
1430
|
-
stream.on("end", onend);
|
|
1431
|
-
stream.on("finish", onfinish);
|
|
1432
|
-
if (opts.error !== false) stream.on("error", onerror);
|
|
1433
|
-
stream.on("close", onclose);
|
|
1434
|
-
return function() {
|
|
1435
|
-
stream.removeListener("complete", onfinish);
|
|
1436
|
-
stream.removeListener("abort", onclose);
|
|
1437
|
-
stream.removeListener("request", onrequest);
|
|
1438
|
-
if (stream.req) stream.req.removeListener("finish", onfinish);
|
|
1439
|
-
stream.removeListener("end", onlegacyfinish);
|
|
1440
|
-
stream.removeListener("close", onlegacyfinish);
|
|
1441
|
-
stream.removeListener("finish", onfinish);
|
|
1442
|
-
stream.removeListener("end", onend);
|
|
1443
|
-
stream.removeListener("error", onerror);
|
|
1444
|
-
stream.removeListener("close", onclose);
|
|
1445
|
-
};
|
|
1446
|
-
}
|
|
1447
|
-
module.exports = eos;
|
|
1448
|
-
}
|
|
1449
|
-
});
|
|
1450
|
-
|
|
1451
|
-
// ../../node_modules/readable-stream/lib/internal/streams/async_iterator.js
|
|
1452
|
-
var require_async_iterator = __commonJS({
|
|
1453
|
-
"../../node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports, module) {
|
|
1454
|
-
"use strict";
|
|
1455
|
-
init_esm_shims();
|
|
1456
|
-
var _Object$setPrototypeO;
|
|
1457
|
-
function _defineProperty(obj, key, value) {
|
|
1458
|
-
if (key in obj) {
|
|
1459
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
1460
|
-
} else {
|
|
1461
|
-
obj[key] = value;
|
|
1462
|
-
}
|
|
1463
|
-
return obj;
|
|
1464
|
-
}
|
|
1465
|
-
var finished = require_end_of_stream();
|
|
1466
|
-
var kLastResolve = Symbol("lastResolve");
|
|
1467
|
-
var kLastReject = Symbol("lastReject");
|
|
1468
|
-
var kError = Symbol("error");
|
|
1469
|
-
var kEnded = Symbol("ended");
|
|
1470
|
-
var kLastPromise = Symbol("lastPromise");
|
|
1471
|
-
var kHandlePromise = Symbol("handlePromise");
|
|
1472
|
-
var kStream = Symbol("stream");
|
|
1473
|
-
function createIterResult(value, done) {
|
|
1474
|
-
return {
|
|
1475
|
-
value,
|
|
1476
|
-
done
|
|
1477
|
-
};
|
|
1478
|
-
}
|
|
1479
|
-
function readAndResolve(iter) {
|
|
1480
|
-
var resolve = iter[kLastResolve];
|
|
1481
|
-
if (resolve !== null) {
|
|
1482
|
-
var data = iter[kStream].read();
|
|
1483
|
-
if (data !== null) {
|
|
1484
|
-
iter[kLastPromise] = null;
|
|
1485
|
-
iter[kLastResolve] = null;
|
|
1486
|
-
iter[kLastReject] = null;
|
|
1487
|
-
resolve(createIterResult(data, false));
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1490
|
-
}
|
|
1491
|
-
function onReadable(iter) {
|
|
1492
|
-
process.nextTick(readAndResolve, iter);
|
|
1493
|
-
}
|
|
1494
|
-
function wrapForNext(lastPromise, iter) {
|
|
1495
|
-
return function(resolve, reject) {
|
|
1496
|
-
lastPromise.then(function() {
|
|
1497
|
-
if (iter[kEnded]) {
|
|
1498
|
-
resolve(createIterResult(void 0, true));
|
|
1499
|
-
return;
|
|
1500
|
-
}
|
|
1501
|
-
iter[kHandlePromise](resolve, reject);
|
|
1502
|
-
}, reject);
|
|
1503
|
-
};
|
|
1504
|
-
}
|
|
1505
|
-
var AsyncIteratorPrototype = Object.getPrototypeOf(function() {
|
|
1506
|
-
});
|
|
1507
|
-
var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
|
|
1508
|
-
get stream() {
|
|
1509
|
-
return this[kStream];
|
|
1510
|
-
},
|
|
1511
|
-
next: function next() {
|
|
1512
|
-
var _this = this;
|
|
1513
|
-
var error = this[kError];
|
|
1514
|
-
if (error !== null) {
|
|
1515
|
-
return Promise.reject(error);
|
|
1516
|
-
}
|
|
1517
|
-
if (this[kEnded]) {
|
|
1518
|
-
return Promise.resolve(createIterResult(void 0, true));
|
|
1519
|
-
}
|
|
1520
|
-
if (this[kStream].destroyed) {
|
|
1521
|
-
return new Promise(function(resolve, reject) {
|
|
1522
|
-
process.nextTick(function() {
|
|
1523
|
-
if (_this[kError]) {
|
|
1524
|
-
reject(_this[kError]);
|
|
1525
|
-
} else {
|
|
1526
|
-
resolve(createIterResult(void 0, true));
|
|
1527
|
-
}
|
|
1528
|
-
});
|
|
1529
|
-
});
|
|
1530
|
-
}
|
|
1531
|
-
var lastPromise = this[kLastPromise];
|
|
1532
|
-
var promise;
|
|
1533
|
-
if (lastPromise) {
|
|
1534
|
-
promise = new Promise(wrapForNext(lastPromise, this));
|
|
1535
|
-
} else {
|
|
1536
|
-
var data = this[kStream].read();
|
|
1537
|
-
if (data !== null) {
|
|
1538
|
-
return Promise.resolve(createIterResult(data, false));
|
|
1539
|
-
}
|
|
1540
|
-
promise = new Promise(this[kHandlePromise]);
|
|
1541
|
-
}
|
|
1542
|
-
this[kLastPromise] = promise;
|
|
1543
|
-
return promise;
|
|
1544
|
-
}
|
|
1545
|
-
}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() {
|
|
1546
|
-
return this;
|
|
1547
|
-
}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
|
|
1548
|
-
var _this2 = this;
|
|
1549
|
-
return new Promise(function(resolve, reject) {
|
|
1550
|
-
_this2[kStream].destroy(null, function(err) {
|
|
1551
|
-
if (err) {
|
|
1552
|
-
reject(err);
|
|
1553
|
-
return;
|
|
1554
|
-
}
|
|
1555
|
-
resolve(createIterResult(void 0, true));
|
|
1556
|
-
});
|
|
1557
|
-
});
|
|
1558
|
-
}), _Object$setPrototypeO), AsyncIteratorPrototype);
|
|
1559
|
-
var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) {
|
|
1560
|
-
var _Object$create;
|
|
1561
|
-
var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
|
|
1562
|
-
value: stream,
|
|
1563
|
-
writable: true
|
|
1564
|
-
}), _defineProperty(_Object$create, kLastResolve, {
|
|
1565
|
-
value: null,
|
|
1566
|
-
writable: true
|
|
1567
|
-
}), _defineProperty(_Object$create, kLastReject, {
|
|
1568
|
-
value: null,
|
|
1569
|
-
writable: true
|
|
1570
|
-
}), _defineProperty(_Object$create, kError, {
|
|
1571
|
-
value: null,
|
|
1572
|
-
writable: true
|
|
1573
|
-
}), _defineProperty(_Object$create, kEnded, {
|
|
1574
|
-
value: stream._readableState.endEmitted,
|
|
1575
|
-
writable: true
|
|
1576
|
-
}), _defineProperty(_Object$create, kHandlePromise, {
|
|
1577
|
-
value: function value(resolve, reject) {
|
|
1578
|
-
var data = iterator[kStream].read();
|
|
1579
|
-
if (data) {
|
|
1580
|
-
iterator[kLastPromise] = null;
|
|
1581
|
-
iterator[kLastResolve] = null;
|
|
1582
|
-
iterator[kLastReject] = null;
|
|
1583
|
-
resolve(createIterResult(data, false));
|
|
1584
|
-
} else {
|
|
1585
|
-
iterator[kLastResolve] = resolve;
|
|
1586
|
-
iterator[kLastReject] = reject;
|
|
1587
|
-
}
|
|
1588
|
-
},
|
|
1589
|
-
writable: true
|
|
1590
|
-
}), _Object$create));
|
|
1591
|
-
iterator[kLastPromise] = null;
|
|
1592
|
-
finished(stream, function(err) {
|
|
1593
|
-
if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
|
|
1594
|
-
var reject = iterator[kLastReject];
|
|
1595
|
-
if (reject !== null) {
|
|
1596
|
-
iterator[kLastPromise] = null;
|
|
1597
|
-
iterator[kLastResolve] = null;
|
|
1598
|
-
iterator[kLastReject] = null;
|
|
1599
|
-
reject(err);
|
|
1600
|
-
}
|
|
1601
|
-
iterator[kError] = err;
|
|
1602
|
-
return;
|
|
1603
|
-
}
|
|
1604
|
-
var resolve = iterator[kLastResolve];
|
|
1605
|
-
if (resolve !== null) {
|
|
1606
|
-
iterator[kLastPromise] = null;
|
|
1607
|
-
iterator[kLastResolve] = null;
|
|
1608
|
-
iterator[kLastReject] = null;
|
|
1609
|
-
resolve(createIterResult(void 0, true));
|
|
1610
|
-
}
|
|
1611
|
-
iterator[kEnded] = true;
|
|
1612
|
-
});
|
|
1613
|
-
stream.on("readable", onReadable.bind(null, iterator));
|
|
1614
|
-
return iterator;
|
|
1615
|
-
};
|
|
1616
|
-
module.exports = createReadableStreamAsyncIterator;
|
|
1617
|
-
}
|
|
1618
|
-
});
|
|
1619
|
-
|
|
1620
|
-
// ../../node_modules/readable-stream/lib/internal/streams/from.js
|
|
1621
|
-
var require_from = __commonJS({
|
|
1622
|
-
"../../node_modules/readable-stream/lib/internal/streams/from.js"(exports, module) {
|
|
1623
|
-
"use strict";
|
|
1624
|
-
init_esm_shims();
|
|
1625
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1626
|
-
try {
|
|
1627
|
-
var info = gen[key](arg);
|
|
1628
|
-
var value = info.value;
|
|
1629
|
-
} catch (error) {
|
|
1630
|
-
reject(error);
|
|
1631
|
-
return;
|
|
1632
|
-
}
|
|
1633
|
-
if (info.done) {
|
|
1634
|
-
resolve(value);
|
|
1635
|
-
} else {
|
|
1636
|
-
Promise.resolve(value).then(_next, _throw);
|
|
1637
|
-
}
|
|
1638
|
-
}
|
|
1639
|
-
function _asyncToGenerator(fn) {
|
|
1640
|
-
return function() {
|
|
1641
|
-
var self = this, args = arguments;
|
|
1642
|
-
return new Promise(function(resolve, reject) {
|
|
1643
|
-
var gen = fn.apply(self, args);
|
|
1644
|
-
function _next(value) {
|
|
1645
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
1646
|
-
}
|
|
1647
|
-
function _throw(err) {
|
|
1648
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1649
|
-
}
|
|
1650
|
-
_next(void 0);
|
|
1651
|
-
});
|
|
1652
|
-
};
|
|
1653
|
-
}
|
|
1654
|
-
function ownKeys(object, enumerableOnly) {
|
|
1655
|
-
var keys = Object.keys(object);
|
|
1656
|
-
if (Object.getOwnPropertySymbols) {
|
|
1657
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
1658
|
-
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
1659
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
1660
|
-
});
|
|
1661
|
-
keys.push.apply(keys, symbols);
|
|
1662
|
-
}
|
|
1663
|
-
return keys;
|
|
1664
|
-
}
|
|
1665
|
-
function _objectSpread(target) {
|
|
1666
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
1667
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
1668
|
-
if (i % 2) {
|
|
1669
|
-
ownKeys(Object(source), true).forEach(function(key) {
|
|
1670
|
-
_defineProperty(target, key, source[key]);
|
|
1671
|
-
});
|
|
1672
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
1673
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1674
|
-
} else {
|
|
1675
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
1676
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1677
|
-
});
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
return target;
|
|
1681
|
-
}
|
|
1682
|
-
function _defineProperty(obj, key, value) {
|
|
1683
|
-
if (key in obj) {
|
|
1684
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
1685
|
-
} else {
|
|
1686
|
-
obj[key] = value;
|
|
1687
|
-
}
|
|
1688
|
-
return obj;
|
|
1689
|
-
}
|
|
1690
|
-
var ERR_INVALID_ARG_TYPE = require_errors().codes.ERR_INVALID_ARG_TYPE;
|
|
1691
|
-
function from(Readable, iterable, opts) {
|
|
1692
|
-
var iterator;
|
|
1693
|
-
if (iterable && typeof iterable.next === "function") {
|
|
1694
|
-
iterator = iterable;
|
|
1695
|
-
} else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();
|
|
1696
|
-
else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();
|
|
1697
|
-
else throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable);
|
|
1698
|
-
var readable = new Readable(_objectSpread({
|
|
1699
|
-
objectMode: true
|
|
1700
|
-
}, opts));
|
|
1701
|
-
var reading = false;
|
|
1702
|
-
readable._read = function() {
|
|
1703
|
-
if (!reading) {
|
|
1704
|
-
reading = true;
|
|
1705
|
-
next();
|
|
1706
|
-
}
|
|
1707
|
-
};
|
|
1708
|
-
function next() {
|
|
1709
|
-
return _next2.apply(this, arguments);
|
|
1710
|
-
}
|
|
1711
|
-
function _next2() {
|
|
1712
|
-
_next2 = _asyncToGenerator(function* () {
|
|
1713
|
-
try {
|
|
1714
|
-
var _ref = yield iterator.next(), value = _ref.value, done = _ref.done;
|
|
1715
|
-
if (done) {
|
|
1716
|
-
readable.push(null);
|
|
1717
|
-
} else if (readable.push(yield value)) {
|
|
1718
|
-
next();
|
|
1719
|
-
} else {
|
|
1720
|
-
reading = false;
|
|
1721
|
-
}
|
|
1722
|
-
} catch (err) {
|
|
1723
|
-
readable.destroy(err);
|
|
1724
|
-
}
|
|
1725
|
-
});
|
|
1726
|
-
return _next2.apply(this, arguments);
|
|
1727
|
-
}
|
|
1728
|
-
return readable;
|
|
1729
|
-
}
|
|
1730
|
-
module.exports = from;
|
|
1731
|
-
}
|
|
1732
|
-
});
|
|
1733
|
-
|
|
1734
|
-
// ../../node_modules/readable-stream/lib/_stream_readable.js
|
|
1735
|
-
var require_stream_readable = __commonJS({
|
|
1736
|
-
"../../node_modules/readable-stream/lib/_stream_readable.js"(exports, module) {
|
|
1737
|
-
"use strict";
|
|
1738
|
-
init_esm_shims();
|
|
1739
|
-
module.exports = Readable;
|
|
1740
|
-
var Duplex;
|
|
1741
|
-
Readable.ReadableState = ReadableState;
|
|
1742
|
-
var EE = __require("events").EventEmitter;
|
|
1743
|
-
var EElistenerCount = function EElistenerCount2(emitter, type) {
|
|
1744
|
-
return emitter.listeners(type).length;
|
|
1745
|
-
};
|
|
1746
|
-
var Stream = require_stream();
|
|
1747
|
-
var Buffer = __require("buffer").Buffer;
|
|
1748
|
-
var OurUint8Array = global.Uint8Array || function() {
|
|
1749
|
-
};
|
|
1750
|
-
function _uint8ArrayToBuffer(chunk) {
|
|
1751
|
-
return Buffer.from(chunk);
|
|
1752
|
-
}
|
|
1753
|
-
function _isUint8Array(obj) {
|
|
1754
|
-
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
1755
|
-
}
|
|
1756
|
-
var debugUtil = __require("util");
|
|
1757
|
-
var debug;
|
|
1758
|
-
if (debugUtil && debugUtil.debuglog) {
|
|
1759
|
-
debug = debugUtil.debuglog("stream");
|
|
1760
|
-
} else {
|
|
1761
|
-
debug = function debug2() {
|
|
1762
|
-
};
|
|
1763
|
-
}
|
|
1764
|
-
var BufferList = require_buffer_list();
|
|
1765
|
-
var destroyImpl = require_destroy();
|
|
1766
|
-
var _require = require_state();
|
|
1767
|
-
var getHighWaterMark = _require.getHighWaterMark;
|
|
1768
|
-
var _require$codes = require_errors().codes;
|
|
1769
|
-
var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE;
|
|
1770
|
-
var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF;
|
|
1771
|
-
var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
|
|
1772
|
-
var ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
|
|
1773
|
-
var StringDecoder;
|
|
1774
|
-
var createReadableStreamAsyncIterator;
|
|
1775
|
-
var from;
|
|
1776
|
-
require_inherits()(Readable, Stream);
|
|
1777
|
-
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
1778
|
-
var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
|
|
1779
|
-
function prependListener(emitter, event, fn) {
|
|
1780
|
-
if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
|
|
1781
|
-
if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
|
|
1782
|
-
else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);
|
|
1783
|
-
else emitter._events[event] = [fn, emitter._events[event]];
|
|
1784
|
-
}
|
|
1785
|
-
function ReadableState(options, stream, isDuplex) {
|
|
1786
|
-
Duplex = Duplex || require_stream_duplex();
|
|
1787
|
-
options = options || {};
|
|
1788
|
-
if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex;
|
|
1789
|
-
this.objectMode = !!options.objectMode;
|
|
1790
|
-
if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
|
|
1791
|
-
this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex);
|
|
1792
|
-
this.buffer = new BufferList();
|
|
1793
|
-
this.length = 0;
|
|
1794
|
-
this.pipes = null;
|
|
1795
|
-
this.pipesCount = 0;
|
|
1796
|
-
this.flowing = null;
|
|
1797
|
-
this.ended = false;
|
|
1798
|
-
this.endEmitted = false;
|
|
1799
|
-
this.reading = false;
|
|
1800
|
-
this.sync = true;
|
|
1801
|
-
this.needReadable = false;
|
|
1802
|
-
this.emittedReadable = false;
|
|
1803
|
-
this.readableListening = false;
|
|
1804
|
-
this.resumeScheduled = false;
|
|
1805
|
-
this.paused = true;
|
|
1806
|
-
this.emitClose = options.emitClose !== false;
|
|
1807
|
-
this.autoDestroy = !!options.autoDestroy;
|
|
1808
|
-
this.destroyed = false;
|
|
1809
|
-
this.defaultEncoding = options.defaultEncoding || "utf8";
|
|
1810
|
-
this.awaitDrain = 0;
|
|
1811
|
-
this.readingMore = false;
|
|
1812
|
-
this.decoder = null;
|
|
1813
|
-
this.encoding = null;
|
|
1814
|
-
if (options.encoding) {
|
|
1815
|
-
if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
|
|
1816
|
-
this.decoder = new StringDecoder(options.encoding);
|
|
1817
|
-
this.encoding = options.encoding;
|
|
1818
|
-
}
|
|
1819
|
-
}
|
|
1820
|
-
function Readable(options) {
|
|
1821
|
-
Duplex = Duplex || require_stream_duplex();
|
|
1822
|
-
if (!(this instanceof Readable)) return new Readable(options);
|
|
1823
|
-
var isDuplex = this instanceof Duplex;
|
|
1824
|
-
this._readableState = new ReadableState(options, this, isDuplex);
|
|
1825
|
-
this.readable = true;
|
|
1826
|
-
if (options) {
|
|
1827
|
-
if (typeof options.read === "function") this._read = options.read;
|
|
1828
|
-
if (typeof options.destroy === "function") this._destroy = options.destroy;
|
|
1829
|
-
}
|
|
1830
|
-
Stream.call(this);
|
|
1831
|
-
}
|
|
1832
|
-
Object.defineProperty(Readable.prototype, "destroyed", {
|
|
1833
|
-
// making it explicit this property is not enumerable
|
|
1834
|
-
// because otherwise some prototype manipulation in
|
|
1835
|
-
// userland will fail
|
|
1836
|
-
enumerable: false,
|
|
1837
|
-
get: function get() {
|
|
1838
|
-
if (this._readableState === void 0) {
|
|
1839
|
-
return false;
|
|
1840
|
-
}
|
|
1841
|
-
return this._readableState.destroyed;
|
|
1842
|
-
},
|
|
1843
|
-
set: function set(value) {
|
|
1844
|
-
if (!this._readableState) {
|
|
1845
|
-
return;
|
|
1846
|
-
}
|
|
1847
|
-
this._readableState.destroyed = value;
|
|
1848
|
-
}
|
|
1849
|
-
});
|
|
1850
|
-
Readable.prototype.destroy = destroyImpl.destroy;
|
|
1851
|
-
Readable.prototype._undestroy = destroyImpl.undestroy;
|
|
1852
|
-
Readable.prototype._destroy = function(err, cb) {
|
|
1853
|
-
cb(err);
|
|
1854
|
-
};
|
|
1855
|
-
Readable.prototype.push = function(chunk, encoding) {
|
|
1856
|
-
var state = this._readableState;
|
|
1857
|
-
var skipChunkCheck;
|
|
1858
|
-
if (!state.objectMode) {
|
|
1859
|
-
if (typeof chunk === "string") {
|
|
1860
|
-
encoding = encoding || state.defaultEncoding;
|
|
1861
|
-
if (encoding !== state.encoding) {
|
|
1862
|
-
chunk = Buffer.from(chunk, encoding);
|
|
1863
|
-
encoding = "";
|
|
1864
|
-
}
|
|
1865
|
-
skipChunkCheck = true;
|
|
1866
|
-
}
|
|
1867
|
-
} else {
|
|
1868
|
-
skipChunkCheck = true;
|
|
1869
|
-
}
|
|
1870
|
-
return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
|
|
1871
|
-
};
|
|
1872
|
-
Readable.prototype.unshift = function(chunk) {
|
|
1873
|
-
return readableAddChunk(this, chunk, null, true, false);
|
|
1874
|
-
};
|
|
1875
|
-
function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
|
|
1876
|
-
debug("readableAddChunk", chunk);
|
|
1877
|
-
var state = stream._readableState;
|
|
1878
|
-
if (chunk === null) {
|
|
1879
|
-
state.reading = false;
|
|
1880
|
-
onEofChunk(stream, state);
|
|
1881
|
-
} else {
|
|
1882
|
-
var er;
|
|
1883
|
-
if (!skipChunkCheck) er = chunkInvalid(state, chunk);
|
|
1884
|
-
if (er) {
|
|
1885
|
-
errorOrDestroy(stream, er);
|
|
1886
|
-
} else if (state.objectMode || chunk && chunk.length > 0) {
|
|
1887
|
-
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
|
|
1888
|
-
chunk = _uint8ArrayToBuffer(chunk);
|
|
1889
|
-
}
|
|
1890
|
-
if (addToFront) {
|
|
1891
|
-
if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());
|
|
1892
|
-
else addChunk(stream, state, chunk, true);
|
|
1893
|
-
} else if (state.ended) {
|
|
1894
|
-
errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
|
|
1895
|
-
} else if (state.destroyed) {
|
|
1896
|
-
return false;
|
|
1897
|
-
} else {
|
|
1898
|
-
state.reading = false;
|
|
1899
|
-
if (state.decoder && !encoding) {
|
|
1900
|
-
chunk = state.decoder.write(chunk);
|
|
1901
|
-
if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);
|
|
1902
|
-
else maybeReadMore(stream, state);
|
|
1903
|
-
} else {
|
|
1904
|
-
addChunk(stream, state, chunk, false);
|
|
1905
|
-
}
|
|
1906
|
-
}
|
|
1907
|
-
} else if (!addToFront) {
|
|
1908
|
-
state.reading = false;
|
|
1909
|
-
maybeReadMore(stream, state);
|
|
1910
|
-
}
|
|
1911
|
-
}
|
|
1912
|
-
return !state.ended && (state.length < state.highWaterMark || state.length === 0);
|
|
1913
|
-
}
|
|
1914
|
-
function addChunk(stream, state, chunk, addToFront) {
|
|
1915
|
-
if (state.flowing && state.length === 0 && !state.sync) {
|
|
1916
|
-
state.awaitDrain = 0;
|
|
1917
|
-
stream.emit("data", chunk);
|
|
1918
|
-
} else {
|
|
1919
|
-
state.length += state.objectMode ? 1 : chunk.length;
|
|
1920
|
-
if (addToFront) state.buffer.unshift(chunk);
|
|
1921
|
-
else state.buffer.push(chunk);
|
|
1922
|
-
if (state.needReadable) emitReadable(stream);
|
|
1923
|
-
}
|
|
1924
|
-
maybeReadMore(stream, state);
|
|
1925
|
-
}
|
|
1926
|
-
function chunkInvalid(state, chunk) {
|
|
1927
|
-
var er;
|
|
1928
|
-
if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
|
|
1929
|
-
er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk);
|
|
1930
|
-
}
|
|
1931
|
-
return er;
|
|
1932
|
-
}
|
|
1933
|
-
Readable.prototype.isPaused = function() {
|
|
1934
|
-
return this._readableState.flowing === false;
|
|
1935
|
-
};
|
|
1936
|
-
Readable.prototype.setEncoding = function(enc) {
|
|
1937
|
-
if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
|
|
1938
|
-
var decoder = new StringDecoder(enc);
|
|
1939
|
-
this._readableState.decoder = decoder;
|
|
1940
|
-
this._readableState.encoding = this._readableState.decoder.encoding;
|
|
1941
|
-
var p = this._readableState.buffer.head;
|
|
1942
|
-
var content = "";
|
|
1943
|
-
while (p !== null) {
|
|
1944
|
-
content += decoder.write(p.data);
|
|
1945
|
-
p = p.next;
|
|
1946
|
-
}
|
|
1947
|
-
this._readableState.buffer.clear();
|
|
1948
|
-
if (content !== "") this._readableState.buffer.push(content);
|
|
1949
|
-
this._readableState.length = content.length;
|
|
1950
|
-
return this;
|
|
1951
|
-
};
|
|
1952
|
-
var MAX_HWM = 1073741824;
|
|
1953
|
-
function computeNewHighWaterMark(n) {
|
|
1954
|
-
if (n >= MAX_HWM) {
|
|
1955
|
-
n = MAX_HWM;
|
|
1956
|
-
} else {
|
|
1957
|
-
n--;
|
|
1958
|
-
n |= n >>> 1;
|
|
1959
|
-
n |= n >>> 2;
|
|
1960
|
-
n |= n >>> 4;
|
|
1961
|
-
n |= n >>> 8;
|
|
1962
|
-
n |= n >>> 16;
|
|
1963
|
-
n++;
|
|
1964
|
-
}
|
|
1965
|
-
return n;
|
|
1966
|
-
}
|
|
1967
|
-
function howMuchToRead(n, state) {
|
|
1968
|
-
if (n <= 0 || state.length === 0 && state.ended) return 0;
|
|
1969
|
-
if (state.objectMode) return 1;
|
|
1970
|
-
if (n !== n) {
|
|
1971
|
-
if (state.flowing && state.length) return state.buffer.head.data.length;
|
|
1972
|
-
else return state.length;
|
|
1973
|
-
}
|
|
1974
|
-
if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
|
|
1975
|
-
if (n <= state.length) return n;
|
|
1976
|
-
if (!state.ended) {
|
|
1977
|
-
state.needReadable = true;
|
|
1978
|
-
return 0;
|
|
1979
|
-
}
|
|
1980
|
-
return state.length;
|
|
1981
|
-
}
|
|
1982
|
-
Readable.prototype.read = function(n) {
|
|
1983
|
-
debug("read", n);
|
|
1984
|
-
n = parseInt(n, 10);
|
|
1985
|
-
var state = this._readableState;
|
|
1986
|
-
var nOrig = n;
|
|
1987
|
-
if (n !== 0) state.emittedReadable = false;
|
|
1988
|
-
if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
|
|
1989
|
-
debug("read: emitReadable", state.length, state.ended);
|
|
1990
|
-
if (state.length === 0 && state.ended) endReadable(this);
|
|
1991
|
-
else emitReadable(this);
|
|
1992
|
-
return null;
|
|
1993
|
-
}
|
|
1994
|
-
n = howMuchToRead(n, state);
|
|
1995
|
-
if (n === 0 && state.ended) {
|
|
1996
|
-
if (state.length === 0) endReadable(this);
|
|
1997
|
-
return null;
|
|
1998
|
-
}
|
|
1999
|
-
var doRead = state.needReadable;
|
|
2000
|
-
debug("need readable", doRead);
|
|
2001
|
-
if (state.length === 0 || state.length - n < state.highWaterMark) {
|
|
2002
|
-
doRead = true;
|
|
2003
|
-
debug("length less than watermark", doRead);
|
|
2004
|
-
}
|
|
2005
|
-
if (state.ended || state.reading) {
|
|
2006
|
-
doRead = false;
|
|
2007
|
-
debug("reading or ended", doRead);
|
|
2008
|
-
} else if (doRead) {
|
|
2009
|
-
debug("do read");
|
|
2010
|
-
state.reading = true;
|
|
2011
|
-
state.sync = true;
|
|
2012
|
-
if (state.length === 0) state.needReadable = true;
|
|
2013
|
-
this._read(state.highWaterMark);
|
|
2014
|
-
state.sync = false;
|
|
2015
|
-
if (!state.reading) n = howMuchToRead(nOrig, state);
|
|
2016
|
-
}
|
|
2017
|
-
var ret;
|
|
2018
|
-
if (n > 0) ret = fromList(n, state);
|
|
2019
|
-
else ret = null;
|
|
2020
|
-
if (ret === null) {
|
|
2021
|
-
state.needReadable = state.length <= state.highWaterMark;
|
|
2022
|
-
n = 0;
|
|
2023
|
-
} else {
|
|
2024
|
-
state.length -= n;
|
|
2025
|
-
state.awaitDrain = 0;
|
|
2026
|
-
}
|
|
2027
|
-
if (state.length === 0) {
|
|
2028
|
-
if (!state.ended) state.needReadable = true;
|
|
2029
|
-
if (nOrig !== n && state.ended) endReadable(this);
|
|
2030
|
-
}
|
|
2031
|
-
if (ret !== null) this.emit("data", ret);
|
|
2032
|
-
return ret;
|
|
2033
|
-
};
|
|
2034
|
-
function onEofChunk(stream, state) {
|
|
2035
|
-
debug("onEofChunk");
|
|
2036
|
-
if (state.ended) return;
|
|
2037
|
-
if (state.decoder) {
|
|
2038
|
-
var chunk = state.decoder.end();
|
|
2039
|
-
if (chunk && chunk.length) {
|
|
2040
|
-
state.buffer.push(chunk);
|
|
2041
|
-
state.length += state.objectMode ? 1 : chunk.length;
|
|
2042
|
-
}
|
|
2043
|
-
}
|
|
2044
|
-
state.ended = true;
|
|
2045
|
-
if (state.sync) {
|
|
2046
|
-
emitReadable(stream);
|
|
2047
|
-
} else {
|
|
2048
|
-
state.needReadable = false;
|
|
2049
|
-
if (!state.emittedReadable) {
|
|
2050
|
-
state.emittedReadable = true;
|
|
2051
|
-
emitReadable_(stream);
|
|
2052
|
-
}
|
|
2053
|
-
}
|
|
2054
|
-
}
|
|
2055
|
-
function emitReadable(stream) {
|
|
2056
|
-
var state = stream._readableState;
|
|
2057
|
-
debug("emitReadable", state.needReadable, state.emittedReadable);
|
|
2058
|
-
state.needReadable = false;
|
|
2059
|
-
if (!state.emittedReadable) {
|
|
2060
|
-
debug("emitReadable", state.flowing);
|
|
2061
|
-
state.emittedReadable = true;
|
|
2062
|
-
process.nextTick(emitReadable_, stream);
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
function emitReadable_(stream) {
|
|
2066
|
-
var state = stream._readableState;
|
|
2067
|
-
debug("emitReadable_", state.destroyed, state.length, state.ended);
|
|
2068
|
-
if (!state.destroyed && (state.length || state.ended)) {
|
|
2069
|
-
stream.emit("readable");
|
|
2070
|
-
state.emittedReadable = false;
|
|
2071
|
-
}
|
|
2072
|
-
state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
|
|
2073
|
-
flow(stream);
|
|
2074
|
-
}
|
|
2075
|
-
function maybeReadMore(stream, state) {
|
|
2076
|
-
if (!state.readingMore) {
|
|
2077
|
-
state.readingMore = true;
|
|
2078
|
-
process.nextTick(maybeReadMore_, stream, state);
|
|
2079
|
-
}
|
|
2080
|
-
}
|
|
2081
|
-
function maybeReadMore_(stream, state) {
|
|
2082
|
-
while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
|
|
2083
|
-
var len = state.length;
|
|
2084
|
-
debug("maybeReadMore read 0");
|
|
2085
|
-
stream.read(0);
|
|
2086
|
-
if (len === state.length)
|
|
2087
|
-
break;
|
|
2088
|
-
}
|
|
2089
|
-
state.readingMore = false;
|
|
2090
|
-
}
|
|
2091
|
-
Readable.prototype._read = function(n) {
|
|
2092
|
-
errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
|
|
2093
|
-
};
|
|
2094
|
-
Readable.prototype.pipe = function(dest, pipeOpts) {
|
|
2095
|
-
var src = this;
|
|
2096
|
-
var state = this._readableState;
|
|
2097
|
-
switch (state.pipesCount) {
|
|
2098
|
-
case 0:
|
|
2099
|
-
state.pipes = dest;
|
|
2100
|
-
break;
|
|
2101
|
-
case 1:
|
|
2102
|
-
state.pipes = [state.pipes, dest];
|
|
2103
|
-
break;
|
|
2104
|
-
default:
|
|
2105
|
-
state.pipes.push(dest);
|
|
2106
|
-
break;
|
|
2107
|
-
}
|
|
2108
|
-
state.pipesCount += 1;
|
|
2109
|
-
debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
|
|
2110
|
-
var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
|
|
2111
|
-
var endFn = doEnd ? onend : unpipe;
|
|
2112
|
-
if (state.endEmitted) process.nextTick(endFn);
|
|
2113
|
-
else src.once("end", endFn);
|
|
2114
|
-
dest.on("unpipe", onunpipe);
|
|
2115
|
-
function onunpipe(readable, unpipeInfo) {
|
|
2116
|
-
debug("onunpipe");
|
|
2117
|
-
if (readable === src) {
|
|
2118
|
-
if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
|
|
2119
|
-
unpipeInfo.hasUnpiped = true;
|
|
2120
|
-
cleanup();
|
|
2121
|
-
}
|
|
2122
|
-
}
|
|
2123
|
-
}
|
|
2124
|
-
function onend() {
|
|
2125
|
-
debug("onend");
|
|
2126
|
-
dest.end();
|
|
2127
|
-
}
|
|
2128
|
-
var ondrain = pipeOnDrain(src);
|
|
2129
|
-
dest.on("drain", ondrain);
|
|
2130
|
-
var cleanedUp = false;
|
|
2131
|
-
function cleanup() {
|
|
2132
|
-
debug("cleanup");
|
|
2133
|
-
dest.removeListener("close", onclose);
|
|
2134
|
-
dest.removeListener("finish", onfinish);
|
|
2135
|
-
dest.removeListener("drain", ondrain);
|
|
2136
|
-
dest.removeListener("error", onerror);
|
|
2137
|
-
dest.removeListener("unpipe", onunpipe);
|
|
2138
|
-
src.removeListener("end", onend);
|
|
2139
|
-
src.removeListener("end", unpipe);
|
|
2140
|
-
src.removeListener("data", ondata);
|
|
2141
|
-
cleanedUp = true;
|
|
2142
|
-
if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
|
|
2143
|
-
}
|
|
2144
|
-
src.on("data", ondata);
|
|
2145
|
-
function ondata(chunk) {
|
|
2146
|
-
debug("ondata");
|
|
2147
|
-
var ret = dest.write(chunk);
|
|
2148
|
-
debug("dest.write", ret);
|
|
2149
|
-
if (ret === false) {
|
|
2150
|
-
if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
|
|
2151
|
-
debug("false write response, pause", state.awaitDrain);
|
|
2152
|
-
state.awaitDrain++;
|
|
2153
|
-
}
|
|
2154
|
-
src.pause();
|
|
2155
|
-
}
|
|
2156
|
-
}
|
|
2157
|
-
function onerror(er) {
|
|
2158
|
-
debug("onerror", er);
|
|
2159
|
-
unpipe();
|
|
2160
|
-
dest.removeListener("error", onerror);
|
|
2161
|
-
if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er);
|
|
2162
|
-
}
|
|
2163
|
-
prependListener(dest, "error", onerror);
|
|
2164
|
-
function onclose() {
|
|
2165
|
-
dest.removeListener("finish", onfinish);
|
|
2166
|
-
unpipe();
|
|
2167
|
-
}
|
|
2168
|
-
dest.once("close", onclose);
|
|
2169
|
-
function onfinish() {
|
|
2170
|
-
debug("onfinish");
|
|
2171
|
-
dest.removeListener("close", onclose);
|
|
2172
|
-
unpipe();
|
|
2173
|
-
}
|
|
2174
|
-
dest.once("finish", onfinish);
|
|
2175
|
-
function unpipe() {
|
|
2176
|
-
debug("unpipe");
|
|
2177
|
-
src.unpipe(dest);
|
|
2178
|
-
}
|
|
2179
|
-
dest.emit("pipe", src);
|
|
2180
|
-
if (!state.flowing) {
|
|
2181
|
-
debug("pipe resume");
|
|
2182
|
-
src.resume();
|
|
2183
|
-
}
|
|
2184
|
-
return dest;
|
|
2185
|
-
};
|
|
2186
|
-
function pipeOnDrain(src) {
|
|
2187
|
-
return function pipeOnDrainFunctionResult() {
|
|
2188
|
-
var state = src._readableState;
|
|
2189
|
-
debug("pipeOnDrain", state.awaitDrain);
|
|
2190
|
-
if (state.awaitDrain) state.awaitDrain--;
|
|
2191
|
-
if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
|
|
2192
|
-
state.flowing = true;
|
|
2193
|
-
flow(src);
|
|
2194
|
-
}
|
|
2195
|
-
};
|
|
2196
|
-
}
|
|
2197
|
-
Readable.prototype.unpipe = function(dest) {
|
|
2198
|
-
var state = this._readableState;
|
|
2199
|
-
var unpipeInfo = {
|
|
2200
|
-
hasUnpiped: false
|
|
2201
|
-
};
|
|
2202
|
-
if (state.pipesCount === 0) return this;
|
|
2203
|
-
if (state.pipesCount === 1) {
|
|
2204
|
-
if (dest && dest !== state.pipes) return this;
|
|
2205
|
-
if (!dest) dest = state.pipes;
|
|
2206
|
-
state.pipes = null;
|
|
2207
|
-
state.pipesCount = 0;
|
|
2208
|
-
state.flowing = false;
|
|
2209
|
-
if (dest) dest.emit("unpipe", this, unpipeInfo);
|
|
2210
|
-
return this;
|
|
2211
|
-
}
|
|
2212
|
-
if (!dest) {
|
|
2213
|
-
var dests = state.pipes;
|
|
2214
|
-
var len = state.pipesCount;
|
|
2215
|
-
state.pipes = null;
|
|
2216
|
-
state.pipesCount = 0;
|
|
2217
|
-
state.flowing = false;
|
|
2218
|
-
for (var i = 0; i < len; i++) {
|
|
2219
|
-
dests[i].emit("unpipe", this, {
|
|
2220
|
-
hasUnpiped: false
|
|
2221
|
-
});
|
|
2222
|
-
}
|
|
2223
|
-
return this;
|
|
2224
|
-
}
|
|
2225
|
-
var index = indexOf(state.pipes, dest);
|
|
2226
|
-
if (index === -1) return this;
|
|
2227
|
-
state.pipes.splice(index, 1);
|
|
2228
|
-
state.pipesCount -= 1;
|
|
2229
|
-
if (state.pipesCount === 1) state.pipes = state.pipes[0];
|
|
2230
|
-
dest.emit("unpipe", this, unpipeInfo);
|
|
2231
|
-
return this;
|
|
2232
|
-
};
|
|
2233
|
-
Readable.prototype.on = function(ev, fn) {
|
|
2234
|
-
var res = Stream.prototype.on.call(this, ev, fn);
|
|
2235
|
-
var state = this._readableState;
|
|
2236
|
-
if (ev === "data") {
|
|
2237
|
-
state.readableListening = this.listenerCount("readable") > 0;
|
|
2238
|
-
if (state.flowing !== false) this.resume();
|
|
2239
|
-
} else if (ev === "readable") {
|
|
2240
|
-
if (!state.endEmitted && !state.readableListening) {
|
|
2241
|
-
state.readableListening = state.needReadable = true;
|
|
2242
|
-
state.flowing = false;
|
|
2243
|
-
state.emittedReadable = false;
|
|
2244
|
-
debug("on readable", state.length, state.reading);
|
|
2245
|
-
if (state.length) {
|
|
2246
|
-
emitReadable(this);
|
|
2247
|
-
} else if (!state.reading) {
|
|
2248
|
-
process.nextTick(nReadingNextTick, this);
|
|
2249
|
-
}
|
|
2250
|
-
}
|
|
2251
|
-
}
|
|
2252
|
-
return res;
|
|
2253
|
-
};
|
|
2254
|
-
Readable.prototype.addListener = Readable.prototype.on;
|
|
2255
|
-
Readable.prototype.removeListener = function(ev, fn) {
|
|
2256
|
-
var res = Stream.prototype.removeListener.call(this, ev, fn);
|
|
2257
|
-
if (ev === "readable") {
|
|
2258
|
-
process.nextTick(updateReadableListening, this);
|
|
2259
|
-
}
|
|
2260
|
-
return res;
|
|
2261
|
-
};
|
|
2262
|
-
Readable.prototype.removeAllListeners = function(ev) {
|
|
2263
|
-
var res = Stream.prototype.removeAllListeners.apply(this, arguments);
|
|
2264
|
-
if (ev === "readable" || ev === void 0) {
|
|
2265
|
-
process.nextTick(updateReadableListening, this);
|
|
2266
|
-
}
|
|
2267
|
-
return res;
|
|
2268
|
-
};
|
|
2269
|
-
function updateReadableListening(self) {
|
|
2270
|
-
var state = self._readableState;
|
|
2271
|
-
state.readableListening = self.listenerCount("readable") > 0;
|
|
2272
|
-
if (state.resumeScheduled && !state.paused) {
|
|
2273
|
-
state.flowing = true;
|
|
2274
|
-
} else if (self.listenerCount("data") > 0) {
|
|
2275
|
-
self.resume();
|
|
2276
|
-
}
|
|
2277
|
-
}
|
|
2278
|
-
function nReadingNextTick(self) {
|
|
2279
|
-
debug("readable nexttick read 0");
|
|
2280
|
-
self.read(0);
|
|
2281
|
-
}
|
|
2282
|
-
Readable.prototype.resume = function() {
|
|
2283
|
-
var state = this._readableState;
|
|
2284
|
-
if (!state.flowing) {
|
|
2285
|
-
debug("resume");
|
|
2286
|
-
state.flowing = !state.readableListening;
|
|
2287
|
-
resume(this, state);
|
|
2288
|
-
}
|
|
2289
|
-
state.paused = false;
|
|
2290
|
-
return this;
|
|
2291
|
-
};
|
|
2292
|
-
function resume(stream, state) {
|
|
2293
|
-
if (!state.resumeScheduled) {
|
|
2294
|
-
state.resumeScheduled = true;
|
|
2295
|
-
process.nextTick(resume_, stream, state);
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
function resume_(stream, state) {
|
|
2299
|
-
debug("resume", state.reading);
|
|
2300
|
-
if (!state.reading) {
|
|
2301
|
-
stream.read(0);
|
|
2302
|
-
}
|
|
2303
|
-
state.resumeScheduled = false;
|
|
2304
|
-
stream.emit("resume");
|
|
2305
|
-
flow(stream);
|
|
2306
|
-
if (state.flowing && !state.reading) stream.read(0);
|
|
2307
|
-
}
|
|
2308
|
-
Readable.prototype.pause = function() {
|
|
2309
|
-
debug("call pause flowing=%j", this._readableState.flowing);
|
|
2310
|
-
if (this._readableState.flowing !== false) {
|
|
2311
|
-
debug("pause");
|
|
2312
|
-
this._readableState.flowing = false;
|
|
2313
|
-
this.emit("pause");
|
|
2314
|
-
}
|
|
2315
|
-
this._readableState.paused = true;
|
|
2316
|
-
return this;
|
|
2317
|
-
};
|
|
2318
|
-
function flow(stream) {
|
|
2319
|
-
var state = stream._readableState;
|
|
2320
|
-
debug("flow", state.flowing);
|
|
2321
|
-
while (state.flowing && stream.read() !== null) {
|
|
2322
|
-
;
|
|
2323
|
-
}
|
|
2324
|
-
}
|
|
2325
|
-
Readable.prototype.wrap = function(stream) {
|
|
2326
|
-
var _this = this;
|
|
2327
|
-
var state = this._readableState;
|
|
2328
|
-
var paused = false;
|
|
2329
|
-
stream.on("end", function() {
|
|
2330
|
-
debug("wrapped end");
|
|
2331
|
-
if (state.decoder && !state.ended) {
|
|
2332
|
-
var chunk = state.decoder.end();
|
|
2333
|
-
if (chunk && chunk.length) _this.push(chunk);
|
|
2334
|
-
}
|
|
2335
|
-
_this.push(null);
|
|
2336
|
-
});
|
|
2337
|
-
stream.on("data", function(chunk) {
|
|
2338
|
-
debug("wrapped data");
|
|
2339
|
-
if (state.decoder) chunk = state.decoder.write(chunk);
|
|
2340
|
-
if (state.objectMode && (chunk === null || chunk === void 0)) return;
|
|
2341
|
-
else if (!state.objectMode && (!chunk || !chunk.length)) return;
|
|
2342
|
-
var ret = _this.push(chunk);
|
|
2343
|
-
if (!ret) {
|
|
2344
|
-
paused = true;
|
|
2345
|
-
stream.pause();
|
|
2346
|
-
}
|
|
2347
|
-
});
|
|
2348
|
-
for (var i in stream) {
|
|
2349
|
-
if (this[i] === void 0 && typeof stream[i] === "function") {
|
|
2350
|
-
this[i] = /* @__PURE__ */ function methodWrap(method) {
|
|
2351
|
-
return function methodWrapReturnFunction() {
|
|
2352
|
-
return stream[method].apply(stream, arguments);
|
|
2353
|
-
};
|
|
2354
|
-
}(i);
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
for (var n = 0; n < kProxyEvents.length; n++) {
|
|
2358
|
-
stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
|
|
2359
|
-
}
|
|
2360
|
-
this._read = function(n2) {
|
|
2361
|
-
debug("wrapped _read", n2);
|
|
2362
|
-
if (paused) {
|
|
2363
|
-
paused = false;
|
|
2364
|
-
stream.resume();
|
|
2365
|
-
}
|
|
2366
|
-
};
|
|
2367
|
-
return this;
|
|
2368
|
-
};
|
|
2369
|
-
if (typeof Symbol === "function") {
|
|
2370
|
-
Readable.prototype[Symbol.asyncIterator] = function() {
|
|
2371
|
-
if (createReadableStreamAsyncIterator === void 0) {
|
|
2372
|
-
createReadableStreamAsyncIterator = require_async_iterator();
|
|
2373
|
-
}
|
|
2374
|
-
return createReadableStreamAsyncIterator(this);
|
|
2375
|
-
};
|
|
2376
|
-
}
|
|
2377
|
-
Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
|
|
2378
|
-
// making it explicit this property is not enumerable
|
|
2379
|
-
// because otherwise some prototype manipulation in
|
|
2380
|
-
// userland will fail
|
|
2381
|
-
enumerable: false,
|
|
2382
|
-
get: function get() {
|
|
2383
|
-
return this._readableState.highWaterMark;
|
|
2384
|
-
}
|
|
2385
|
-
});
|
|
2386
|
-
Object.defineProperty(Readable.prototype, "readableBuffer", {
|
|
2387
|
-
// making it explicit this property is not enumerable
|
|
2388
|
-
// because otherwise some prototype manipulation in
|
|
2389
|
-
// userland will fail
|
|
2390
|
-
enumerable: false,
|
|
2391
|
-
get: function get() {
|
|
2392
|
-
return this._readableState && this._readableState.buffer;
|
|
2393
|
-
}
|
|
2394
|
-
});
|
|
2395
|
-
Object.defineProperty(Readable.prototype, "readableFlowing", {
|
|
2396
|
-
// making it explicit this property is not enumerable
|
|
2397
|
-
// because otherwise some prototype manipulation in
|
|
2398
|
-
// userland will fail
|
|
2399
|
-
enumerable: false,
|
|
2400
|
-
get: function get() {
|
|
2401
|
-
return this._readableState.flowing;
|
|
2402
|
-
},
|
|
2403
|
-
set: function set(state) {
|
|
2404
|
-
if (this._readableState) {
|
|
2405
|
-
this._readableState.flowing = state;
|
|
2406
|
-
}
|
|
2407
|
-
}
|
|
2408
|
-
});
|
|
2409
|
-
Readable._fromList = fromList;
|
|
2410
|
-
Object.defineProperty(Readable.prototype, "readableLength", {
|
|
2411
|
-
// making it explicit this property is not enumerable
|
|
2412
|
-
// because otherwise some prototype manipulation in
|
|
2413
|
-
// userland will fail
|
|
2414
|
-
enumerable: false,
|
|
2415
|
-
get: function get() {
|
|
2416
|
-
return this._readableState.length;
|
|
2417
|
-
}
|
|
2418
|
-
});
|
|
2419
|
-
function fromList(n, state) {
|
|
2420
|
-
if (state.length === 0) return null;
|
|
2421
|
-
var ret;
|
|
2422
|
-
if (state.objectMode) ret = state.buffer.shift();
|
|
2423
|
-
else if (!n || n >= state.length) {
|
|
2424
|
-
if (state.decoder) ret = state.buffer.join("");
|
|
2425
|
-
else if (state.buffer.length === 1) ret = state.buffer.first();
|
|
2426
|
-
else ret = state.buffer.concat(state.length);
|
|
2427
|
-
state.buffer.clear();
|
|
2428
|
-
} else {
|
|
2429
|
-
ret = state.buffer.consume(n, state.decoder);
|
|
2430
|
-
}
|
|
2431
|
-
return ret;
|
|
2432
|
-
}
|
|
2433
|
-
function endReadable(stream) {
|
|
2434
|
-
var state = stream._readableState;
|
|
2435
|
-
debug("endReadable", state.endEmitted);
|
|
2436
|
-
if (!state.endEmitted) {
|
|
2437
|
-
state.ended = true;
|
|
2438
|
-
process.nextTick(endReadableNT, state, stream);
|
|
2439
|
-
}
|
|
2440
|
-
}
|
|
2441
|
-
function endReadableNT(state, stream) {
|
|
2442
|
-
debug("endReadableNT", state.endEmitted, state.length);
|
|
2443
|
-
if (!state.endEmitted && state.length === 0) {
|
|
2444
|
-
state.endEmitted = true;
|
|
2445
|
-
stream.readable = false;
|
|
2446
|
-
stream.emit("end");
|
|
2447
|
-
if (state.autoDestroy) {
|
|
2448
|
-
var wState = stream._writableState;
|
|
2449
|
-
if (!wState || wState.autoDestroy && wState.finished) {
|
|
2450
|
-
stream.destroy();
|
|
2451
|
-
}
|
|
2452
|
-
}
|
|
2453
|
-
}
|
|
2454
|
-
}
|
|
2455
|
-
if (typeof Symbol === "function") {
|
|
2456
|
-
Readable.from = function(iterable, opts) {
|
|
2457
|
-
if (from === void 0) {
|
|
2458
|
-
from = require_from();
|
|
2459
|
-
}
|
|
2460
|
-
return from(Readable, iterable, opts);
|
|
2461
|
-
};
|
|
2462
|
-
}
|
|
2463
|
-
function indexOf(xs, x) {
|
|
2464
|
-
for (var i = 0, l = xs.length; i < l; i++) {
|
|
2465
|
-
if (xs[i] === x) return i;
|
|
2466
|
-
}
|
|
2467
|
-
return -1;
|
|
2468
|
-
}
|
|
2469
|
-
}
|
|
2470
|
-
});
|
|
2471
|
-
|
|
2472
|
-
// ../../node_modules/readable-stream/lib/_stream_transform.js
|
|
2473
|
-
var require_stream_transform = __commonJS({
|
|
2474
|
-
"../../node_modules/readable-stream/lib/_stream_transform.js"(exports, module) {
|
|
2475
|
-
"use strict";
|
|
2476
|
-
init_esm_shims();
|
|
2477
|
-
module.exports = Transform;
|
|
2478
|
-
var _require$codes = require_errors().codes;
|
|
2479
|
-
var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
|
|
2480
|
-
var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK;
|
|
2481
|
-
var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING;
|
|
2482
|
-
var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
|
|
2483
|
-
var Duplex = require_stream_duplex();
|
|
2484
|
-
require_inherits()(Transform, Duplex);
|
|
2485
|
-
function afterTransform(er, data) {
|
|
2486
|
-
var ts = this._transformState;
|
|
2487
|
-
ts.transforming = false;
|
|
2488
|
-
var cb = ts.writecb;
|
|
2489
|
-
if (cb === null) {
|
|
2490
|
-
return this.emit("error", new ERR_MULTIPLE_CALLBACK());
|
|
2491
|
-
}
|
|
2492
|
-
ts.writechunk = null;
|
|
2493
|
-
ts.writecb = null;
|
|
2494
|
-
if (data != null)
|
|
2495
|
-
this.push(data);
|
|
2496
|
-
cb(er);
|
|
2497
|
-
var rs = this._readableState;
|
|
2498
|
-
rs.reading = false;
|
|
2499
|
-
if (rs.needReadable || rs.length < rs.highWaterMark) {
|
|
2500
|
-
this._read(rs.highWaterMark);
|
|
2501
|
-
}
|
|
2502
|
-
}
|
|
2503
|
-
function Transform(options) {
|
|
2504
|
-
if (!(this instanceof Transform)) return new Transform(options);
|
|
2505
|
-
Duplex.call(this, options);
|
|
2506
|
-
this._transformState = {
|
|
2507
|
-
afterTransform: afterTransform.bind(this),
|
|
2508
|
-
needTransform: false,
|
|
2509
|
-
transforming: false,
|
|
2510
|
-
writecb: null,
|
|
2511
|
-
writechunk: null,
|
|
2512
|
-
writeencoding: null
|
|
2513
|
-
};
|
|
2514
|
-
this._readableState.needReadable = true;
|
|
2515
|
-
this._readableState.sync = false;
|
|
2516
|
-
if (options) {
|
|
2517
|
-
if (typeof options.transform === "function") this._transform = options.transform;
|
|
2518
|
-
if (typeof options.flush === "function") this._flush = options.flush;
|
|
2519
|
-
}
|
|
2520
|
-
this.on("prefinish", prefinish);
|
|
2521
|
-
}
|
|
2522
|
-
function prefinish() {
|
|
2523
|
-
var _this = this;
|
|
2524
|
-
if (typeof this._flush === "function" && !this._readableState.destroyed) {
|
|
2525
|
-
this._flush(function(er, data) {
|
|
2526
|
-
done(_this, er, data);
|
|
2527
|
-
});
|
|
2528
|
-
} else {
|
|
2529
|
-
done(this, null, null);
|
|
2530
|
-
}
|
|
2531
|
-
}
|
|
2532
|
-
Transform.prototype.push = function(chunk, encoding) {
|
|
2533
|
-
this._transformState.needTransform = false;
|
|
2534
|
-
return Duplex.prototype.push.call(this, chunk, encoding);
|
|
2535
|
-
};
|
|
2536
|
-
Transform.prototype._transform = function(chunk, encoding, cb) {
|
|
2537
|
-
cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
|
|
2538
|
-
};
|
|
2539
|
-
Transform.prototype._write = function(chunk, encoding, cb) {
|
|
2540
|
-
var ts = this._transformState;
|
|
2541
|
-
ts.writecb = cb;
|
|
2542
|
-
ts.writechunk = chunk;
|
|
2543
|
-
ts.writeencoding = encoding;
|
|
2544
|
-
if (!ts.transforming) {
|
|
2545
|
-
var rs = this._readableState;
|
|
2546
|
-
if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
|
|
2547
|
-
}
|
|
2548
|
-
};
|
|
2549
|
-
Transform.prototype._read = function(n) {
|
|
2550
|
-
var ts = this._transformState;
|
|
2551
|
-
if (ts.writechunk !== null && !ts.transforming) {
|
|
2552
|
-
ts.transforming = true;
|
|
2553
|
-
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
|
|
2554
|
-
} else {
|
|
2555
|
-
ts.needTransform = true;
|
|
2556
|
-
}
|
|
2557
|
-
};
|
|
2558
|
-
Transform.prototype._destroy = function(err, cb) {
|
|
2559
|
-
Duplex.prototype._destroy.call(this, err, function(err2) {
|
|
2560
|
-
cb(err2);
|
|
2561
|
-
});
|
|
2562
|
-
};
|
|
2563
|
-
function done(stream, er, data) {
|
|
2564
|
-
if (er) return stream.emit("error", er);
|
|
2565
|
-
if (data != null)
|
|
2566
|
-
stream.push(data);
|
|
2567
|
-
if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
|
|
2568
|
-
if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
|
|
2569
|
-
return stream.push(null);
|
|
2570
|
-
}
|
|
2571
|
-
}
|
|
2572
|
-
});
|
|
2573
|
-
|
|
2574
|
-
// ../../node_modules/readable-stream/lib/_stream_passthrough.js
|
|
2575
|
-
var require_stream_passthrough = __commonJS({
|
|
2576
|
-
"../../node_modules/readable-stream/lib/_stream_passthrough.js"(exports, module) {
|
|
2577
|
-
"use strict";
|
|
2578
|
-
init_esm_shims();
|
|
2579
|
-
module.exports = PassThrough;
|
|
2580
|
-
var Transform = require_stream_transform();
|
|
2581
|
-
require_inherits()(PassThrough, Transform);
|
|
2582
|
-
function PassThrough(options) {
|
|
2583
|
-
if (!(this instanceof PassThrough)) return new PassThrough(options);
|
|
2584
|
-
Transform.call(this, options);
|
|
2585
|
-
}
|
|
2586
|
-
PassThrough.prototype._transform = function(chunk, encoding, cb) {
|
|
2587
|
-
cb(null, chunk);
|
|
2588
|
-
};
|
|
2589
|
-
}
|
|
2590
|
-
});
|
|
2591
|
-
|
|
2592
|
-
// ../../node_modules/readable-stream/lib/internal/streams/pipeline.js
|
|
2593
|
-
var require_pipeline = __commonJS({
|
|
2594
|
-
"../../node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports, module) {
|
|
2595
|
-
"use strict";
|
|
2596
|
-
init_esm_shims();
|
|
2597
|
-
var eos;
|
|
2598
|
-
function once(callback) {
|
|
2599
|
-
var called = false;
|
|
2600
|
-
return function() {
|
|
2601
|
-
if (called) return;
|
|
2602
|
-
called = true;
|
|
2603
|
-
callback.apply(void 0, arguments);
|
|
2604
|
-
};
|
|
2605
|
-
}
|
|
2606
|
-
var _require$codes = require_errors().codes;
|
|
2607
|
-
var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;
|
|
2608
|
-
var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
|
|
2609
|
-
function noop(err) {
|
|
2610
|
-
if (err) throw err;
|
|
2611
|
-
}
|
|
2612
|
-
function isRequest(stream) {
|
|
2613
|
-
return stream.setHeader && typeof stream.abort === "function";
|
|
2614
|
-
}
|
|
2615
|
-
function destroyer(stream, reading, writing, callback) {
|
|
2616
|
-
callback = once(callback);
|
|
2617
|
-
var closed = false;
|
|
2618
|
-
stream.on("close", function() {
|
|
2619
|
-
closed = true;
|
|
2620
|
-
});
|
|
2621
|
-
if (eos === void 0) eos = require_end_of_stream();
|
|
2622
|
-
eos(stream, {
|
|
2623
|
-
readable: reading,
|
|
2624
|
-
writable: writing
|
|
2625
|
-
}, function(err) {
|
|
2626
|
-
if (err) return callback(err);
|
|
2627
|
-
closed = true;
|
|
2628
|
-
callback();
|
|
2629
|
-
});
|
|
2630
|
-
var destroyed = false;
|
|
2631
|
-
return function(err) {
|
|
2632
|
-
if (closed) return;
|
|
2633
|
-
if (destroyed) return;
|
|
2634
|
-
destroyed = true;
|
|
2635
|
-
if (isRequest(stream)) return stream.abort();
|
|
2636
|
-
if (typeof stream.destroy === "function") return stream.destroy();
|
|
2637
|
-
callback(err || new ERR_STREAM_DESTROYED("pipe"));
|
|
2638
|
-
};
|
|
2639
|
-
}
|
|
2640
|
-
function call(fn) {
|
|
2641
|
-
fn();
|
|
2642
|
-
}
|
|
2643
|
-
function pipe(from, to) {
|
|
2644
|
-
return from.pipe(to);
|
|
2645
|
-
}
|
|
2646
|
-
function popCallback(streams) {
|
|
2647
|
-
if (!streams.length) return noop;
|
|
2648
|
-
if (typeof streams[streams.length - 1] !== "function") return noop;
|
|
2649
|
-
return streams.pop();
|
|
2650
|
-
}
|
|
2651
|
-
function pipeline() {
|
|
2652
|
-
for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2653
|
-
streams[_key] = arguments[_key];
|
|
2654
|
-
}
|
|
2655
|
-
var callback = popCallback(streams);
|
|
2656
|
-
if (Array.isArray(streams[0])) streams = streams[0];
|
|
2657
|
-
if (streams.length < 2) {
|
|
2658
|
-
throw new ERR_MISSING_ARGS("streams");
|
|
2659
|
-
}
|
|
2660
|
-
var error;
|
|
2661
|
-
var destroys = streams.map(function(stream, i) {
|
|
2662
|
-
var reading = i < streams.length - 1;
|
|
2663
|
-
var writing = i > 0;
|
|
2664
|
-
return destroyer(stream, reading, writing, function(err) {
|
|
2665
|
-
if (!error) error = err;
|
|
2666
|
-
if (err) destroys.forEach(call);
|
|
2667
|
-
if (reading) return;
|
|
2668
|
-
destroys.forEach(call);
|
|
2669
|
-
callback(error);
|
|
2670
|
-
});
|
|
2671
|
-
});
|
|
2672
|
-
return streams.reduce(pipe);
|
|
2673
|
-
}
|
|
2674
|
-
module.exports = pipeline;
|
|
2675
|
-
}
|
|
2676
|
-
});
|
|
2677
|
-
|
|
2678
|
-
// ../../node_modules/readable-stream/readable.js
|
|
2679
|
-
var require_readable = __commonJS({
|
|
2680
|
-
"../../node_modules/readable-stream/readable.js"(exports, module) {
|
|
2681
|
-
"use strict";
|
|
2682
|
-
init_esm_shims();
|
|
2683
|
-
var Stream = __require("stream");
|
|
2684
|
-
if (process.env.READABLE_STREAM === "disable" && Stream) {
|
|
2685
|
-
module.exports = Stream.Readable;
|
|
2686
|
-
Object.assign(module.exports, Stream);
|
|
2687
|
-
module.exports.Stream = Stream;
|
|
2688
|
-
} else {
|
|
2689
|
-
exports = module.exports = require_stream_readable();
|
|
2690
|
-
exports.Stream = Stream || exports;
|
|
2691
|
-
exports.Readable = exports;
|
|
2692
|
-
exports.Writable = require_stream_writable();
|
|
2693
|
-
exports.Duplex = require_stream_duplex();
|
|
2694
|
-
exports.Transform = require_stream_transform();
|
|
2695
|
-
exports.PassThrough = require_stream_passthrough();
|
|
2696
|
-
exports.finished = require_end_of_stream();
|
|
2697
|
-
exports.pipeline = require_pipeline();
|
|
2698
|
-
}
|
|
2699
|
-
}
|
|
2700
|
-
});
|
|
2701
|
-
|
|
2702
|
-
// ../../node_modules/bl/BufferList.js
|
|
2703
|
-
var require_BufferList = __commonJS({
|
|
2704
|
-
"../../node_modules/bl/BufferList.js"(exports, module) {
|
|
2705
|
-
"use strict";
|
|
2706
|
-
init_esm_shims();
|
|
2707
|
-
var { Buffer } = __require("buffer");
|
|
2708
|
-
var symbol = Symbol.for("BufferList");
|
|
2709
|
-
function BufferList(buf) {
|
|
2710
|
-
if (!(this instanceof BufferList)) {
|
|
2711
|
-
return new BufferList(buf);
|
|
2712
|
-
}
|
|
2713
|
-
BufferList._init.call(this, buf);
|
|
2714
|
-
}
|
|
2715
|
-
BufferList._init = function _init(buf) {
|
|
2716
|
-
Object.defineProperty(this, symbol, { value: true });
|
|
2717
|
-
this._bufs = [];
|
|
2718
|
-
this.length = 0;
|
|
2719
|
-
if (buf) {
|
|
2720
|
-
this.append(buf);
|
|
2721
|
-
}
|
|
2722
|
-
};
|
|
2723
|
-
BufferList.prototype._new = function _new(buf) {
|
|
2724
|
-
return new BufferList(buf);
|
|
2725
|
-
};
|
|
2726
|
-
BufferList.prototype._offset = function _offset(offset) {
|
|
2727
|
-
if (offset === 0) {
|
|
2728
|
-
return [0, 0];
|
|
2729
|
-
}
|
|
2730
|
-
let tot = 0;
|
|
2731
|
-
for (let i = 0; i < this._bufs.length; i++) {
|
|
2732
|
-
const _t = tot + this._bufs[i].length;
|
|
2733
|
-
if (offset < _t || i === this._bufs.length - 1) {
|
|
2734
|
-
return [i, offset - tot];
|
|
2735
|
-
}
|
|
2736
|
-
tot = _t;
|
|
2737
|
-
}
|
|
2738
|
-
};
|
|
2739
|
-
BufferList.prototype._reverseOffset = function(blOffset) {
|
|
2740
|
-
const bufferId = blOffset[0];
|
|
2741
|
-
let offset = blOffset[1];
|
|
2742
|
-
for (let i = 0; i < bufferId; i++) {
|
|
2743
|
-
offset += this._bufs[i].length;
|
|
2744
|
-
}
|
|
2745
|
-
return offset;
|
|
2746
|
-
};
|
|
2747
|
-
BufferList.prototype.get = function get(index) {
|
|
2748
|
-
if (index > this.length || index < 0) {
|
|
2749
|
-
return void 0;
|
|
2750
|
-
}
|
|
2751
|
-
const offset = this._offset(index);
|
|
2752
|
-
return this._bufs[offset[0]][offset[1]];
|
|
2753
|
-
};
|
|
2754
|
-
BufferList.prototype.slice = function slice(start, end) {
|
|
2755
|
-
if (typeof start === "number" && start < 0) {
|
|
2756
|
-
start += this.length;
|
|
2757
|
-
}
|
|
2758
|
-
if (typeof end === "number" && end < 0) {
|
|
2759
|
-
end += this.length;
|
|
2760
|
-
}
|
|
2761
|
-
return this.copy(null, 0, start, end);
|
|
2762
|
-
};
|
|
2763
|
-
BufferList.prototype.copy = function copy(dst, dstStart, srcStart, srcEnd) {
|
|
2764
|
-
if (typeof srcStart !== "number" || srcStart < 0) {
|
|
2765
|
-
srcStart = 0;
|
|
2766
|
-
}
|
|
2767
|
-
if (typeof srcEnd !== "number" || srcEnd > this.length) {
|
|
2768
|
-
srcEnd = this.length;
|
|
2769
|
-
}
|
|
2770
|
-
if (srcStart >= this.length) {
|
|
2771
|
-
return dst || Buffer.alloc(0);
|
|
2772
|
-
}
|
|
2773
|
-
if (srcEnd <= 0) {
|
|
2774
|
-
return dst || Buffer.alloc(0);
|
|
2775
|
-
}
|
|
2776
|
-
const copy2 = !!dst;
|
|
2777
|
-
const off = this._offset(srcStart);
|
|
2778
|
-
const len = srcEnd - srcStart;
|
|
2779
|
-
let bytes = len;
|
|
2780
|
-
let bufoff = copy2 && dstStart || 0;
|
|
2781
|
-
let start = off[1];
|
|
2782
|
-
if (srcStart === 0 && srcEnd === this.length) {
|
|
2783
|
-
if (!copy2) {
|
|
2784
|
-
return this._bufs.length === 1 ? this._bufs[0] : Buffer.concat(this._bufs, this.length);
|
|
2785
|
-
}
|
|
2786
|
-
for (let i = 0; i < this._bufs.length; i++) {
|
|
2787
|
-
this._bufs[i].copy(dst, bufoff);
|
|
2788
|
-
bufoff += this._bufs[i].length;
|
|
2789
|
-
}
|
|
2790
|
-
return dst;
|
|
2791
|
-
}
|
|
2792
|
-
if (bytes <= this._bufs[off[0]].length - start) {
|
|
2793
|
-
return copy2 ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) : this._bufs[off[0]].slice(start, start + bytes);
|
|
2794
|
-
}
|
|
2795
|
-
if (!copy2) {
|
|
2796
|
-
dst = Buffer.allocUnsafe(len);
|
|
2797
|
-
}
|
|
2798
|
-
for (let i = off[0]; i < this._bufs.length; i++) {
|
|
2799
|
-
const l = this._bufs[i].length - start;
|
|
2800
|
-
if (bytes > l) {
|
|
2801
|
-
this._bufs[i].copy(dst, bufoff, start);
|
|
2802
|
-
bufoff += l;
|
|
2803
|
-
} else {
|
|
2804
|
-
this._bufs[i].copy(dst, bufoff, start, start + bytes);
|
|
2805
|
-
bufoff += l;
|
|
2806
|
-
break;
|
|
2807
|
-
}
|
|
2808
|
-
bytes -= l;
|
|
2809
|
-
if (start) {
|
|
2810
|
-
start = 0;
|
|
2811
|
-
}
|
|
2812
|
-
}
|
|
2813
|
-
if (dst.length > bufoff) return dst.slice(0, bufoff);
|
|
2814
|
-
return dst;
|
|
2815
|
-
};
|
|
2816
|
-
BufferList.prototype.shallowSlice = function shallowSlice(start, end) {
|
|
2817
|
-
start = start || 0;
|
|
2818
|
-
end = typeof end !== "number" ? this.length : end;
|
|
2819
|
-
if (start < 0) {
|
|
2820
|
-
start += this.length;
|
|
2821
|
-
}
|
|
2822
|
-
if (end < 0) {
|
|
2823
|
-
end += this.length;
|
|
2824
|
-
}
|
|
2825
|
-
if (start === end) {
|
|
2826
|
-
return this._new();
|
|
2827
|
-
}
|
|
2828
|
-
const startOffset = this._offset(start);
|
|
2829
|
-
const endOffset = this._offset(end);
|
|
2830
|
-
const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1);
|
|
2831
|
-
if (endOffset[1] === 0) {
|
|
2832
|
-
buffers.pop();
|
|
2833
|
-
} else {
|
|
2834
|
-
buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1]);
|
|
2835
|
-
}
|
|
2836
|
-
if (startOffset[1] !== 0) {
|
|
2837
|
-
buffers[0] = buffers[0].slice(startOffset[1]);
|
|
2838
|
-
}
|
|
2839
|
-
return this._new(buffers);
|
|
2840
|
-
};
|
|
2841
|
-
BufferList.prototype.toString = function toString(encoding, start, end) {
|
|
2842
|
-
return this.slice(start, end).toString(encoding);
|
|
2843
|
-
};
|
|
2844
|
-
BufferList.prototype.consume = function consume(bytes) {
|
|
2845
|
-
bytes = Math.trunc(bytes);
|
|
2846
|
-
if (Number.isNaN(bytes) || bytes <= 0) return this;
|
|
2847
|
-
while (this._bufs.length) {
|
|
2848
|
-
if (bytes >= this._bufs[0].length) {
|
|
2849
|
-
bytes -= this._bufs[0].length;
|
|
2850
|
-
this.length -= this._bufs[0].length;
|
|
2851
|
-
this._bufs.shift();
|
|
2852
|
-
} else {
|
|
2853
|
-
this._bufs[0] = this._bufs[0].slice(bytes);
|
|
2854
|
-
this.length -= bytes;
|
|
2855
|
-
break;
|
|
2856
|
-
}
|
|
2857
|
-
}
|
|
2858
|
-
return this;
|
|
2859
|
-
};
|
|
2860
|
-
BufferList.prototype.duplicate = function duplicate() {
|
|
2861
|
-
const copy = this._new();
|
|
2862
|
-
for (let i = 0; i < this._bufs.length; i++) {
|
|
2863
|
-
copy.append(this._bufs[i]);
|
|
2864
|
-
}
|
|
2865
|
-
return copy;
|
|
2866
|
-
};
|
|
2867
|
-
BufferList.prototype.append = function append(buf) {
|
|
2868
|
-
if (buf == null) {
|
|
2869
|
-
return this;
|
|
2870
|
-
}
|
|
2871
|
-
if (buf.buffer) {
|
|
2872
|
-
this._appendBuffer(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength));
|
|
2873
|
-
} else if (Array.isArray(buf)) {
|
|
2874
|
-
for (let i = 0; i < buf.length; i++) {
|
|
2875
|
-
this.append(buf[i]);
|
|
2876
|
-
}
|
|
2877
|
-
} else if (this._isBufferList(buf)) {
|
|
2878
|
-
for (let i = 0; i < buf._bufs.length; i++) {
|
|
2879
|
-
this.append(buf._bufs[i]);
|
|
2880
|
-
}
|
|
2881
|
-
} else {
|
|
2882
|
-
if (typeof buf === "number") {
|
|
2883
|
-
buf = buf.toString();
|
|
2884
|
-
}
|
|
2885
|
-
this._appendBuffer(Buffer.from(buf));
|
|
2886
|
-
}
|
|
2887
|
-
return this;
|
|
2888
|
-
};
|
|
2889
|
-
BufferList.prototype._appendBuffer = function appendBuffer(buf) {
|
|
2890
|
-
this._bufs.push(buf);
|
|
2891
|
-
this.length += buf.length;
|
|
2892
|
-
};
|
|
2893
|
-
BufferList.prototype.indexOf = function(search, offset, encoding) {
|
|
2894
|
-
if (encoding === void 0 && typeof offset === "string") {
|
|
2895
|
-
encoding = offset;
|
|
2896
|
-
offset = void 0;
|
|
2897
|
-
}
|
|
2898
|
-
if (typeof search === "function" || Array.isArray(search)) {
|
|
2899
|
-
throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');
|
|
2900
|
-
} else if (typeof search === "number") {
|
|
2901
|
-
search = Buffer.from([search]);
|
|
2902
|
-
} else if (typeof search === "string") {
|
|
2903
|
-
search = Buffer.from(search, encoding);
|
|
2904
|
-
} else if (this._isBufferList(search)) {
|
|
2905
|
-
search = search.slice();
|
|
2906
|
-
} else if (Array.isArray(search.buffer)) {
|
|
2907
|
-
search = Buffer.from(search.buffer, search.byteOffset, search.byteLength);
|
|
2908
|
-
} else if (!Buffer.isBuffer(search)) {
|
|
2909
|
-
search = Buffer.from(search);
|
|
2910
|
-
}
|
|
2911
|
-
offset = Number(offset || 0);
|
|
2912
|
-
if (isNaN(offset)) {
|
|
2913
|
-
offset = 0;
|
|
2914
|
-
}
|
|
2915
|
-
if (offset < 0) {
|
|
2916
|
-
offset = this.length + offset;
|
|
2917
|
-
}
|
|
2918
|
-
if (offset < 0) {
|
|
2919
|
-
offset = 0;
|
|
2920
|
-
}
|
|
2921
|
-
if (search.length === 0) {
|
|
2922
|
-
return offset > this.length ? this.length : offset;
|
|
2923
|
-
}
|
|
2924
|
-
const blOffset = this._offset(offset);
|
|
2925
|
-
let blIndex = blOffset[0];
|
|
2926
|
-
let buffOffset = blOffset[1];
|
|
2927
|
-
for (; blIndex < this._bufs.length; blIndex++) {
|
|
2928
|
-
const buff = this._bufs[blIndex];
|
|
2929
|
-
while (buffOffset < buff.length) {
|
|
2930
|
-
const availableWindow = buff.length - buffOffset;
|
|
2931
|
-
if (availableWindow >= search.length) {
|
|
2932
|
-
const nativeSearchResult = buff.indexOf(search, buffOffset);
|
|
2933
|
-
if (nativeSearchResult !== -1) {
|
|
2934
|
-
return this._reverseOffset([blIndex, nativeSearchResult]);
|
|
2935
|
-
}
|
|
2936
|
-
buffOffset = buff.length - search.length + 1;
|
|
2937
|
-
} else {
|
|
2938
|
-
const revOffset = this._reverseOffset([blIndex, buffOffset]);
|
|
2939
|
-
if (this._match(revOffset, search)) {
|
|
2940
|
-
return revOffset;
|
|
2941
|
-
}
|
|
2942
|
-
buffOffset++;
|
|
2943
|
-
}
|
|
2944
|
-
}
|
|
2945
|
-
buffOffset = 0;
|
|
2946
|
-
}
|
|
2947
|
-
return -1;
|
|
2948
|
-
};
|
|
2949
|
-
BufferList.prototype._match = function(offset, search) {
|
|
2950
|
-
if (this.length - offset < search.length) {
|
|
2951
|
-
return false;
|
|
2952
|
-
}
|
|
2953
|
-
for (let searchOffset = 0; searchOffset < search.length; searchOffset++) {
|
|
2954
|
-
if (this.get(offset + searchOffset) !== search[searchOffset]) {
|
|
2955
|
-
return false;
|
|
2956
|
-
}
|
|
2957
|
-
}
|
|
2958
|
-
return true;
|
|
2959
|
-
};
|
|
2960
|
-
(function() {
|
|
2961
|
-
const methods = {
|
|
2962
|
-
readDoubleBE: 8,
|
|
2963
|
-
readDoubleLE: 8,
|
|
2964
|
-
readFloatBE: 4,
|
|
2965
|
-
readFloatLE: 4,
|
|
2966
|
-
readInt32BE: 4,
|
|
2967
|
-
readInt32LE: 4,
|
|
2968
|
-
readUInt32BE: 4,
|
|
2969
|
-
readUInt32LE: 4,
|
|
2970
|
-
readInt16BE: 2,
|
|
2971
|
-
readInt16LE: 2,
|
|
2972
|
-
readUInt16BE: 2,
|
|
2973
|
-
readUInt16LE: 2,
|
|
2974
|
-
readInt8: 1,
|
|
2975
|
-
readUInt8: 1,
|
|
2976
|
-
readIntBE: null,
|
|
2977
|
-
readIntLE: null,
|
|
2978
|
-
readUIntBE: null,
|
|
2979
|
-
readUIntLE: null
|
|
2980
|
-
};
|
|
2981
|
-
for (const m in methods) {
|
|
2982
|
-
(function(m2) {
|
|
2983
|
-
if (methods[m2] === null) {
|
|
2984
|
-
BufferList.prototype[m2] = function(offset, byteLength) {
|
|
2985
|
-
return this.slice(offset, offset + byteLength)[m2](0, byteLength);
|
|
2986
|
-
};
|
|
2987
|
-
} else {
|
|
2988
|
-
BufferList.prototype[m2] = function(offset = 0) {
|
|
2989
|
-
return this.slice(offset, offset + methods[m2])[m2](0);
|
|
2990
|
-
};
|
|
2991
|
-
}
|
|
2992
|
-
})(m);
|
|
2993
|
-
}
|
|
2994
|
-
})();
|
|
2995
|
-
BufferList.prototype._isBufferList = function _isBufferList(b) {
|
|
2996
|
-
return b instanceof BufferList || BufferList.isBufferList(b);
|
|
2997
|
-
};
|
|
2998
|
-
BufferList.isBufferList = function isBufferList(b) {
|
|
2999
|
-
return b != null && b[symbol];
|
|
3000
|
-
};
|
|
3001
|
-
module.exports = BufferList;
|
|
3002
|
-
}
|
|
3003
|
-
});
|
|
3004
|
-
|
|
3005
|
-
// ../../node_modules/bl/bl.js
|
|
3006
|
-
var require_bl = __commonJS({
|
|
3007
|
-
"../../node_modules/bl/bl.js"(exports, module) {
|
|
3008
|
-
"use strict";
|
|
3009
|
-
init_esm_shims();
|
|
3010
|
-
var DuplexStream = require_readable().Duplex;
|
|
3011
|
-
var inherits = require_inherits();
|
|
3012
|
-
var BufferList = require_BufferList();
|
|
3013
|
-
function BufferListStream2(callback) {
|
|
3014
|
-
if (!(this instanceof BufferListStream2)) {
|
|
3015
|
-
return new BufferListStream2(callback);
|
|
3016
|
-
}
|
|
3017
|
-
if (typeof callback === "function") {
|
|
3018
|
-
this._callback = callback;
|
|
3019
|
-
const piper = function piper2(err) {
|
|
3020
|
-
if (this._callback) {
|
|
3021
|
-
this._callback(err);
|
|
3022
|
-
this._callback = null;
|
|
3023
|
-
}
|
|
3024
|
-
}.bind(this);
|
|
3025
|
-
this.on("pipe", function onPipe(src) {
|
|
3026
|
-
src.on("error", piper);
|
|
3027
|
-
});
|
|
3028
|
-
this.on("unpipe", function onUnpipe(src) {
|
|
3029
|
-
src.removeListener("error", piper);
|
|
3030
|
-
});
|
|
3031
|
-
callback = null;
|
|
3032
|
-
}
|
|
3033
|
-
BufferList._init.call(this, callback);
|
|
3034
|
-
DuplexStream.call(this);
|
|
3035
|
-
}
|
|
3036
|
-
inherits(BufferListStream2, DuplexStream);
|
|
3037
|
-
Object.assign(BufferListStream2.prototype, BufferList.prototype);
|
|
3038
|
-
BufferListStream2.prototype._new = function _new(callback) {
|
|
3039
|
-
return new BufferListStream2(callback);
|
|
3040
|
-
};
|
|
3041
|
-
BufferListStream2.prototype._write = function _write(buf, encoding, callback) {
|
|
3042
|
-
this._appendBuffer(buf);
|
|
3043
|
-
if (typeof callback === "function") {
|
|
3044
|
-
callback();
|
|
3045
|
-
}
|
|
3046
|
-
};
|
|
3047
|
-
BufferListStream2.prototype._read = function _read(size) {
|
|
3048
|
-
if (!this.length) {
|
|
3049
|
-
return this.push(null);
|
|
3050
|
-
}
|
|
3051
|
-
size = Math.min(size, this.length);
|
|
3052
|
-
this.push(this.slice(0, size));
|
|
3053
|
-
this.consume(size);
|
|
3054
|
-
};
|
|
3055
|
-
BufferListStream2.prototype.end = function end(chunk) {
|
|
3056
|
-
DuplexStream.prototype.end.call(this, chunk);
|
|
3057
|
-
if (this._callback) {
|
|
3058
|
-
this._callback(null, this.slice());
|
|
3059
|
-
this._callback = null;
|
|
3060
|
-
}
|
|
3061
|
-
};
|
|
3062
|
-
BufferListStream2.prototype._destroy = function _destroy(err, cb) {
|
|
3063
|
-
this._bufs.length = 0;
|
|
3064
|
-
this.length = 0;
|
|
3065
|
-
cb(err);
|
|
3066
|
-
};
|
|
3067
|
-
BufferListStream2.prototype._isBufferList = function _isBufferList(b) {
|
|
3068
|
-
return b instanceof BufferListStream2 || b instanceof BufferList || BufferListStream2.isBufferList(b);
|
|
3069
|
-
};
|
|
3070
|
-
BufferListStream2.isBufferList = BufferList.isBufferList;
|
|
3071
|
-
module.exports = BufferListStream2;
|
|
3072
|
-
module.exports.BufferListStream = BufferListStream2;
|
|
3073
|
-
module.exports.BufferList = BufferList;
|
|
3074
|
-
}
|
|
3075
|
-
});
|
|
3076
|
-
|
|
3077
|
-
// ../cli-logger/src/index.ts
|
|
3078
|
-
init_esm_shims();
|
|
3079
|
-
|
|
3080
|
-
// ../cli-logger/src/create-logger.ts
|
|
3081
|
-
init_esm_shims();
|
|
3082
|
-
import { stdout } from "node:process";
|
|
3083
|
-
|
|
3084
|
-
// ../../node_modules/ora/index.js
|
|
3085
|
-
init_esm_shims();
|
|
3086
|
-
import process3 from "node:process";
|
|
3087
|
-
var import_cli_spinners = __toESM(require_cli_spinners(), 1);
|
|
3088
|
-
|
|
3089
|
-
// ../../node_modules/ora/node_modules/log-symbols/index.js
|
|
3090
|
-
init_esm_shims();
|
|
3091
|
-
var main = {
|
|
3092
|
-
info: source_default.blue("\u2139"),
|
|
3093
|
-
success: source_default.green("\u2714"),
|
|
3094
|
-
warning: source_default.yellow("\u26A0"),
|
|
3095
|
-
error: source_default.red("\u2716")
|
|
3096
|
-
};
|
|
3097
|
-
var fallback = {
|
|
3098
|
-
info: source_default.blue("i"),
|
|
3099
|
-
success: source_default.green("\u221A"),
|
|
3100
|
-
warning: source_default.yellow("\u203C"),
|
|
3101
|
-
error: source_default.red("\xD7")
|
|
3102
|
-
};
|
|
3103
|
-
var logSymbols = isUnicodeSupported() ? main : fallback;
|
|
3104
|
-
var log_symbols_default = logSymbols;
|
|
3105
|
-
|
|
3106
|
-
// ../../node_modules/ora/index.js
|
|
3107
|
-
var import_wcwidth = __toESM(require_wcwidth(), 1);
|
|
3108
|
-
|
|
3109
|
-
// ../../node_modules/is-interactive/index.js
|
|
3110
|
-
init_esm_shims();
|
|
3111
|
-
function isInteractive({ stream = process.stdout } = {}) {
|
|
3112
|
-
return Boolean(
|
|
3113
|
-
stream && stream.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env)
|
|
3114
|
-
);
|
|
3115
|
-
}
|
|
3116
|
-
|
|
3117
|
-
// ../../node_modules/ora/node_modules/stdin-discarder/index.js
|
|
3118
|
-
init_esm_shims();
|
|
3119
|
-
var import_bl = __toESM(require_bl(), 1);
|
|
3120
|
-
import process2 from "node:process";
|
|
3121
|
-
import readline from "node:readline";
|
|
3122
|
-
var ASCII_ETX_CODE = 3;
|
|
3123
|
-
var StdinDiscarder = class {
|
|
3124
|
-
#requests = 0;
|
|
3125
|
-
#mutedStream = new import_bl.BufferListStream();
|
|
3126
|
-
#ourEmit;
|
|
3127
|
-
#rl;
|
|
3128
|
-
constructor() {
|
|
3129
|
-
this.#mutedStream.pipe(process2.stdout);
|
|
3130
|
-
const self = this;
|
|
3131
|
-
this.#ourEmit = function(event, data, ...arguments_) {
|
|
3132
|
-
const { stdin } = process2;
|
|
3133
|
-
if (self.#requests > 0 || stdin.emit === self.#ourEmit) {
|
|
3134
|
-
if (event === "keypress") {
|
|
3135
|
-
return;
|
|
3136
|
-
}
|
|
3137
|
-
if (event === "data" && data.includes(ASCII_ETX_CODE)) {
|
|
3138
|
-
process2.emit("SIGINT");
|
|
3139
|
-
}
|
|
3140
|
-
Reflect.apply(self.#ourEmit, this, [event, data, ...arguments_]);
|
|
3141
|
-
} else {
|
|
3142
|
-
Reflect.apply(process2.stdin.emit, this, [event, data, ...arguments_]);
|
|
3143
|
-
}
|
|
3144
|
-
};
|
|
3145
|
-
}
|
|
3146
|
-
start() {
|
|
3147
|
-
this.#requests++;
|
|
3148
|
-
if (this.#requests === 1) {
|
|
3149
|
-
this._realStart();
|
|
3150
|
-
}
|
|
3151
|
-
}
|
|
3152
|
-
stop() {
|
|
3153
|
-
if (this.#requests <= 0) {
|
|
3154
|
-
throw new Error("`stop` called more times than `start`");
|
|
3155
|
-
}
|
|
3156
|
-
this.#requests--;
|
|
3157
|
-
if (this.#requests === 0) {
|
|
3158
|
-
this._realStop();
|
|
3159
|
-
}
|
|
3160
|
-
}
|
|
3161
|
-
// TODO: Use private methods when targeting Node.js 14.
|
|
3162
|
-
_realStart() {
|
|
3163
|
-
if (process2.platform === "win32") {
|
|
3164
|
-
return;
|
|
3165
|
-
}
|
|
3166
|
-
this.#rl = readline.createInterface({
|
|
3167
|
-
input: process2.stdin,
|
|
3168
|
-
output: this.#mutedStream
|
|
3169
|
-
});
|
|
3170
|
-
this.#rl.on("SIGINT", () => {
|
|
3171
|
-
if (process2.listenerCount("SIGINT") === 0) {
|
|
3172
|
-
process2.emit("SIGINT");
|
|
3173
|
-
} else {
|
|
3174
|
-
this.#rl.close();
|
|
3175
|
-
process2.kill(process2.pid, "SIGINT");
|
|
3176
|
-
}
|
|
3177
|
-
});
|
|
3178
|
-
}
|
|
3179
|
-
_realStop() {
|
|
3180
|
-
if (process2.platform === "win32") {
|
|
3181
|
-
return;
|
|
3182
|
-
}
|
|
3183
|
-
this.#rl.close();
|
|
3184
|
-
this.#rl = void 0;
|
|
3185
|
-
}
|
|
3186
|
-
};
|
|
3187
|
-
var stdinDiscarder = new StdinDiscarder();
|
|
3188
|
-
var stdin_discarder_default = stdinDiscarder;
|
|
3189
|
-
|
|
3190
|
-
// ../../node_modules/ora/index.js
|
|
3191
|
-
var import_cli_spinners2 = __toESM(require_cli_spinners(), 1);
|
|
3192
|
-
var Ora = class {
|
|
3193
|
-
#linesToClear = 0;
|
|
3194
|
-
#isDiscardingStdin = false;
|
|
3195
|
-
#lineCount = 0;
|
|
3196
|
-
#frameIndex = 0;
|
|
3197
|
-
#options;
|
|
3198
|
-
#spinner;
|
|
3199
|
-
#stream;
|
|
3200
|
-
#id;
|
|
3201
|
-
#initialInterval;
|
|
3202
|
-
#isEnabled;
|
|
3203
|
-
#isSilent;
|
|
3204
|
-
#indent;
|
|
3205
|
-
#text;
|
|
3206
|
-
#prefixText;
|
|
3207
|
-
#suffixText;
|
|
3208
|
-
color;
|
|
3209
|
-
constructor(options) {
|
|
3210
|
-
if (typeof options === "string") {
|
|
3211
|
-
options = {
|
|
3212
|
-
text: options
|
|
3213
|
-
};
|
|
3214
|
-
}
|
|
3215
|
-
this.#options = {
|
|
3216
|
-
color: "cyan",
|
|
3217
|
-
stream: process3.stderr,
|
|
3218
|
-
discardStdin: true,
|
|
3219
|
-
hideCursor: true,
|
|
3220
|
-
...options
|
|
3221
|
-
};
|
|
3222
|
-
this.color = this.#options.color;
|
|
3223
|
-
this.spinner = this.#options.spinner;
|
|
3224
|
-
this.#initialInterval = this.#options.interval;
|
|
3225
|
-
this.#stream = this.#options.stream;
|
|
3226
|
-
this.#isEnabled = typeof this.#options.isEnabled === "boolean" ? this.#options.isEnabled : isInteractive({ stream: this.#stream });
|
|
3227
|
-
this.#isSilent = typeof this.#options.isSilent === "boolean" ? this.#options.isSilent : false;
|
|
3228
|
-
this.text = this.#options.text;
|
|
3229
|
-
this.prefixText = this.#options.prefixText;
|
|
3230
|
-
this.suffixText = this.#options.suffixText;
|
|
3231
|
-
this.indent = this.#options.indent;
|
|
3232
|
-
if (process3.env.NODE_ENV === "test") {
|
|
3233
|
-
this._stream = this.#stream;
|
|
3234
|
-
this._isEnabled = this.#isEnabled;
|
|
3235
|
-
Object.defineProperty(this, "_linesToClear", {
|
|
3236
|
-
get() {
|
|
3237
|
-
return this.#linesToClear;
|
|
3238
|
-
},
|
|
3239
|
-
set(newValue) {
|
|
3240
|
-
this.#linesToClear = newValue;
|
|
3241
|
-
}
|
|
3242
|
-
});
|
|
3243
|
-
Object.defineProperty(this, "_frameIndex", {
|
|
3244
|
-
get() {
|
|
3245
|
-
return this.#frameIndex;
|
|
3246
|
-
}
|
|
3247
|
-
});
|
|
3248
|
-
Object.defineProperty(this, "_lineCount", {
|
|
3249
|
-
get() {
|
|
3250
|
-
return this.#lineCount;
|
|
3251
|
-
}
|
|
3252
|
-
});
|
|
3253
|
-
}
|
|
3254
|
-
}
|
|
3255
|
-
get indent() {
|
|
3256
|
-
return this.#indent;
|
|
3257
|
-
}
|
|
3258
|
-
set indent(indent = 0) {
|
|
3259
|
-
if (!(indent >= 0 && Number.isInteger(indent))) {
|
|
3260
|
-
throw new Error("The `indent` option must be an integer from 0 and up");
|
|
3261
|
-
}
|
|
3262
|
-
this.#indent = indent;
|
|
3263
|
-
this.updateLineCount();
|
|
3264
|
-
}
|
|
3265
|
-
get interval() {
|
|
3266
|
-
return this.#initialInterval || this.#spinner.interval || 100;
|
|
3267
|
-
}
|
|
3268
|
-
get spinner() {
|
|
3269
|
-
return this.#spinner;
|
|
3270
|
-
}
|
|
3271
|
-
set spinner(spinner) {
|
|
3272
|
-
this.#frameIndex = 0;
|
|
3273
|
-
this.#initialInterval = void 0;
|
|
3274
|
-
if (typeof spinner === "object") {
|
|
3275
|
-
if (spinner.frames === void 0) {
|
|
3276
|
-
throw new Error("The given spinner must have a `frames` property");
|
|
3277
|
-
}
|
|
3278
|
-
this.#spinner = spinner;
|
|
3279
|
-
} else if (!isUnicodeSupported()) {
|
|
3280
|
-
this.#spinner = import_cli_spinners.default.line;
|
|
3281
|
-
} else if (spinner === void 0) {
|
|
3282
|
-
this.#spinner = import_cli_spinners.default.dots;
|
|
3283
|
-
} else if (spinner !== "default" && import_cli_spinners.default[spinner]) {
|
|
3284
|
-
this.#spinner = import_cli_spinners.default[spinner];
|
|
3285
|
-
} else {
|
|
3286
|
-
throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);
|
|
3287
|
-
}
|
|
3288
|
-
}
|
|
3289
|
-
get text() {
|
|
3290
|
-
return this.#text;
|
|
3291
|
-
}
|
|
3292
|
-
set text(value) {
|
|
3293
|
-
this.#text = value || "";
|
|
3294
|
-
this.updateLineCount();
|
|
3295
|
-
}
|
|
3296
|
-
get prefixText() {
|
|
3297
|
-
return this.#prefixText;
|
|
3298
|
-
}
|
|
3299
|
-
set prefixText(value) {
|
|
3300
|
-
this.#prefixText = value || "";
|
|
3301
|
-
this.updateLineCount();
|
|
3302
|
-
}
|
|
3303
|
-
get suffixText() {
|
|
3304
|
-
return this.#suffixText;
|
|
3305
|
-
}
|
|
3306
|
-
set suffixText(value) {
|
|
3307
|
-
this.#suffixText = value || "";
|
|
3308
|
-
this.updateLineCount();
|
|
3309
|
-
}
|
|
3310
|
-
get isSpinning() {
|
|
3311
|
-
return this.#id !== void 0;
|
|
3312
|
-
}
|
|
3313
|
-
// TODO: Use private methods when targeting Node.js 14.
|
|
3314
|
-
getFullPrefixText(prefixText = this.#prefixText, postfix = " ") {
|
|
3315
|
-
if (typeof prefixText === "string" && prefixText !== "") {
|
|
3316
|
-
return prefixText + postfix;
|
|
3317
|
-
}
|
|
3318
|
-
if (typeof prefixText === "function") {
|
|
3319
|
-
return prefixText() + postfix;
|
|
3320
|
-
}
|
|
3321
|
-
return "";
|
|
3322
|
-
}
|
|
3323
|
-
getFullSuffixText(suffixText = this.#suffixText, prefix = " ") {
|
|
3324
|
-
if (typeof suffixText === "string" && suffixText !== "") {
|
|
3325
|
-
return prefix + suffixText;
|
|
3326
|
-
}
|
|
3327
|
-
if (typeof suffixText === "function") {
|
|
3328
|
-
return prefix + suffixText();
|
|
3329
|
-
}
|
|
3330
|
-
return "";
|
|
3331
|
-
}
|
|
3332
|
-
updateLineCount() {
|
|
3333
|
-
const columns = this.#stream.columns || 80;
|
|
3334
|
-
const fullPrefixText = this.getFullPrefixText(this.#prefixText, "-");
|
|
3335
|
-
const fullSuffixText = this.getFullSuffixText(this.#suffixText, "-");
|
|
3336
|
-
const fullText = " ".repeat(this.#indent) + fullPrefixText + "--" + this.#text + "--" + fullSuffixText;
|
|
3337
|
-
this.#lineCount = 0;
|
|
3338
|
-
for (const line of stripAnsi(fullText).split("\n")) {
|
|
3339
|
-
this.#lineCount += Math.max(1, Math.ceil((0, import_wcwidth.default)(line) / columns));
|
|
3340
|
-
}
|
|
3341
|
-
}
|
|
3342
|
-
get isEnabled() {
|
|
3343
|
-
return this.#isEnabled && !this.#isSilent;
|
|
3344
|
-
}
|
|
3345
|
-
set isEnabled(value) {
|
|
3346
|
-
if (typeof value !== "boolean") {
|
|
3347
|
-
throw new TypeError("The `isEnabled` option must be a boolean");
|
|
3348
|
-
}
|
|
3349
|
-
this.#isEnabled = value;
|
|
3350
|
-
}
|
|
3351
|
-
get isSilent() {
|
|
3352
|
-
return this.#isSilent;
|
|
3353
|
-
}
|
|
3354
|
-
set isSilent(value) {
|
|
3355
|
-
if (typeof value !== "boolean") {
|
|
3356
|
-
throw new TypeError("The `isSilent` option must be a boolean");
|
|
3357
|
-
}
|
|
3358
|
-
this.#isSilent = value;
|
|
3359
|
-
}
|
|
3360
|
-
frame() {
|
|
3361
|
-
const { frames } = this.#spinner;
|
|
3362
|
-
let frame = frames[this.#frameIndex];
|
|
3363
|
-
if (this.color) {
|
|
3364
|
-
frame = source_default[this.color](frame);
|
|
3365
|
-
}
|
|
3366
|
-
this.#frameIndex = ++this.#frameIndex % frames.length;
|
|
3367
|
-
const fullPrefixText = typeof this.#prefixText === "string" && this.#prefixText !== "" ? this.#prefixText + " " : "";
|
|
3368
|
-
const fullText = typeof this.text === "string" ? " " + this.text : "";
|
|
3369
|
-
const fullSuffixText = typeof this.#suffixText === "string" && this.#suffixText !== "" ? " " + this.#suffixText : "";
|
|
3370
|
-
return fullPrefixText + frame + fullText + fullSuffixText;
|
|
3371
|
-
}
|
|
3372
|
-
clear() {
|
|
3373
|
-
if (!this.#isEnabled || !this.#stream.isTTY) {
|
|
3374
|
-
return this;
|
|
3375
|
-
}
|
|
3376
|
-
this.#stream.cursorTo(0);
|
|
3377
|
-
for (let index = 0; index < this.#linesToClear; index++) {
|
|
3378
|
-
if (index > 0) {
|
|
3379
|
-
this.#stream.moveCursor(0, -1);
|
|
3380
|
-
}
|
|
3381
|
-
this.#stream.clearLine(1);
|
|
3382
|
-
}
|
|
3383
|
-
if (this.#indent || this.lastIndent !== this.#indent) {
|
|
3384
|
-
this.#stream.cursorTo(this.#indent);
|
|
3385
|
-
}
|
|
3386
|
-
this.lastIndent = this.#indent;
|
|
3387
|
-
this.#linesToClear = 0;
|
|
3388
|
-
return this;
|
|
3389
|
-
}
|
|
3390
|
-
render() {
|
|
3391
|
-
if (this.#isSilent) {
|
|
3392
|
-
return this;
|
|
3393
|
-
}
|
|
3394
|
-
this.clear();
|
|
3395
|
-
this.#stream.write(this.frame());
|
|
3396
|
-
this.#linesToClear = this.#lineCount;
|
|
3397
|
-
return this;
|
|
3398
|
-
}
|
|
3399
|
-
start(text) {
|
|
3400
|
-
if (text) {
|
|
3401
|
-
this.text = text;
|
|
3402
|
-
}
|
|
3403
|
-
if (this.#isSilent) {
|
|
3404
|
-
return this;
|
|
3405
|
-
}
|
|
3406
|
-
if (!this.#isEnabled) {
|
|
3407
|
-
if (this.text) {
|
|
3408
|
-
this.#stream.write(`- ${this.text}
|
|
3409
|
-
`);
|
|
3410
|
-
}
|
|
3411
|
-
return this;
|
|
3412
|
-
}
|
|
3413
|
-
if (this.isSpinning) {
|
|
3414
|
-
return this;
|
|
3415
|
-
}
|
|
3416
|
-
if (this.#options.hideCursor) {
|
|
3417
|
-
cli_cursor_default.hide(this.#stream);
|
|
3418
|
-
}
|
|
3419
|
-
if (this.#options.discardStdin && process3.stdin.isTTY) {
|
|
3420
|
-
this.#isDiscardingStdin = true;
|
|
3421
|
-
stdin_discarder_default.start();
|
|
3422
|
-
}
|
|
3423
|
-
this.render();
|
|
3424
|
-
this.#id = setInterval(this.render.bind(this), this.interval);
|
|
3425
|
-
return this;
|
|
3426
|
-
}
|
|
3427
|
-
stop() {
|
|
3428
|
-
if (!this.#isEnabled) {
|
|
3429
|
-
return this;
|
|
3430
|
-
}
|
|
3431
|
-
clearInterval(this.#id);
|
|
3432
|
-
this.#id = void 0;
|
|
3433
|
-
this.#frameIndex = 0;
|
|
3434
|
-
this.clear();
|
|
3435
|
-
if (this.#options.hideCursor) {
|
|
3436
|
-
cli_cursor_default.show(this.#stream);
|
|
3437
|
-
}
|
|
3438
|
-
if (this.#options.discardStdin && process3.stdin.isTTY && this.#isDiscardingStdin) {
|
|
3439
|
-
stdin_discarder_default.stop();
|
|
3440
|
-
this.#isDiscardingStdin = false;
|
|
3441
|
-
}
|
|
3442
|
-
return this;
|
|
3443
|
-
}
|
|
3444
|
-
succeed(text) {
|
|
3445
|
-
return this.stopAndPersist({ symbol: log_symbols_default.success, text });
|
|
3446
|
-
}
|
|
3447
|
-
fail(text) {
|
|
3448
|
-
return this.stopAndPersist({ symbol: log_symbols_default.error, text });
|
|
3449
|
-
}
|
|
3450
|
-
warn(text) {
|
|
3451
|
-
return this.stopAndPersist({ symbol: log_symbols_default.warning, text });
|
|
3452
|
-
}
|
|
3453
|
-
info(text) {
|
|
3454
|
-
return this.stopAndPersist({ symbol: log_symbols_default.info, text });
|
|
3455
|
-
}
|
|
3456
|
-
stopAndPersist(options = {}) {
|
|
3457
|
-
if (this.#isSilent) {
|
|
3458
|
-
return this;
|
|
3459
|
-
}
|
|
3460
|
-
const prefixText = options.prefixText || this.#prefixText;
|
|
3461
|
-
const fullPrefixText = this.getFullPrefixText(prefixText, " ");
|
|
3462
|
-
const symbolText = options.symbol || " ";
|
|
3463
|
-
const text = options.text || this.text;
|
|
3464
|
-
const fullText = typeof text === "string" ? " " + text : "";
|
|
3465
|
-
const suffixText = options.suffixText !== void 0 ? options.suffixText : this.#suffixText;
|
|
3466
|
-
const fullSuffixText = this.getFullSuffixText(suffixText, " ");
|
|
3467
|
-
const textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + "\n";
|
|
3468
|
-
this.stop();
|
|
3469
|
-
this.#stream.write(textToWrite);
|
|
3470
|
-
return this;
|
|
3471
|
-
}
|
|
3472
|
-
};
|
|
3473
|
-
function ora(options) {
|
|
3474
|
-
return new Ora(options);
|
|
3475
|
-
}
|
|
3476
|
-
|
|
3477
|
-
// ../cli-logger/src/create-logger.ts
|
|
3478
|
-
function createLogger() {
|
|
3479
|
-
return {
|
|
3480
|
-
log: (message) => {
|
|
3481
|
-
console.log(message);
|
|
3482
|
-
},
|
|
3483
|
-
error: (message) => {
|
|
3484
|
-
console.error(message);
|
|
3485
|
-
},
|
|
3486
|
-
logWithLoader: (messageOrOptions) => {
|
|
3487
|
-
const initialOptions = typeof messageOrOptions === "string" ? { text: messageOrOptions } : messageOrOptions ?? {};
|
|
3488
|
-
const options = {
|
|
3489
|
-
...initialOptions,
|
|
3490
|
-
stream: stdout
|
|
3491
|
-
};
|
|
3492
|
-
const loader = ora(options).start();
|
|
3493
|
-
return {
|
|
3494
|
-
update: (message) => {
|
|
3495
|
-
loader.text = message;
|
|
3496
|
-
},
|
|
3497
|
-
succeed: (message) => {
|
|
3498
|
-
loader.succeed(message);
|
|
3499
|
-
},
|
|
3500
|
-
info: (message) => {
|
|
3501
|
-
loader.info(message);
|
|
3502
|
-
},
|
|
3503
|
-
warn: (message) => {
|
|
3504
|
-
loader.warn(message);
|
|
3505
|
-
},
|
|
3506
|
-
fail: (message) => {
|
|
3507
|
-
loader.fail(message);
|
|
3508
|
-
},
|
|
3509
|
-
stop: () => {
|
|
3510
|
-
loader.stop();
|
|
3511
|
-
}
|
|
3512
|
-
};
|
|
3513
|
-
}
|
|
3514
|
-
};
|
|
3515
|
-
}
|
|
3516
|
-
|
|
3517
|
-
export {
|
|
3518
|
-
createLogger
|
|
3519
|
-
};
|
|
3520
|
-
/*! Bundled license information:
|
|
3521
|
-
|
|
3522
|
-
safe-buffer/index.js:
|
|
3523
|
-
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
3524
|
-
*/
|
|
3525
|
-
//# sourceMappingURL=chunk-7AAFANVT.js.map
|