@ssv-labs/ssv-sdk 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/main.js +540 -485
- package/dist/main.mjs +540 -485
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -135,17 +135,17 @@ process.env = {};
|
|
|
135
135
|
process.argv = [];
|
|
136
136
|
process.version = "";
|
|
137
137
|
process.versions = {};
|
|
138
|
-
function noop
|
|
139
|
-
}
|
|
140
|
-
process.on = noop
|
|
141
|
-
process.addListener = noop
|
|
142
|
-
process.once = noop
|
|
143
|
-
process.off = noop
|
|
144
|
-
process.removeListener = noop
|
|
145
|
-
process.removeAllListeners = noop
|
|
146
|
-
process.emit = noop
|
|
147
|
-
process.prependListener = noop
|
|
148
|
-
process.prependOnceListener = noop
|
|
138
|
+
function noop() {
|
|
139
|
+
}
|
|
140
|
+
process.on = noop;
|
|
141
|
+
process.addListener = noop;
|
|
142
|
+
process.once = noop;
|
|
143
|
+
process.off = noop;
|
|
144
|
+
process.removeListener = noop;
|
|
145
|
+
process.removeAllListeners = noop;
|
|
146
|
+
process.emit = noop;
|
|
147
|
+
process.prependListener = noop;
|
|
148
|
+
process.prependOnceListener = noop;
|
|
149
149
|
process.listeners = function(name2) {
|
|
150
150
|
return [];
|
|
151
151
|
};
|
|
@@ -943,7 +943,7 @@ var dist = {};
|
|
|
943
943
|
}
|
|
944
944
|
return -1;
|
|
945
945
|
}
|
|
946
|
-
Buffer3.prototype.includes = function
|
|
946
|
+
Buffer3.prototype.includes = function includes(val, byteOffset, encoding) {
|
|
947
947
|
return this.indexOf(val, byteOffset, encoding) !== -1;
|
|
948
948
|
};
|
|
949
949
|
Buffer3.prototype.indexOf = function indexOf3(val, byteOffset, encoding) {
|
|
@@ -2555,7 +2555,7 @@ function EventEmitter() {
|
|
|
2555
2555
|
EventEmitter.init.call(this);
|
|
2556
2556
|
}
|
|
2557
2557
|
events.exports = EventEmitter;
|
|
2558
|
-
events.exports.once = once
|
|
2558
|
+
events.exports.once = once;
|
|
2559
2559
|
EventEmitter.EventEmitter = EventEmitter;
|
|
2560
2560
|
EventEmitter.prototype._events = void 0;
|
|
2561
2561
|
EventEmitter.prototype._eventsCount = 0;
|
|
@@ -2849,7 +2849,7 @@ function unwrapListeners(arr) {
|
|
|
2849
2849
|
}
|
|
2850
2850
|
return ret;
|
|
2851
2851
|
}
|
|
2852
|
-
function once
|
|
2852
|
+
function once(emitter, name2) {
|
|
2853
2853
|
return new Promise(function(resolve2, reject) {
|
|
2854
2854
|
function errorListener(err) {
|
|
2855
2855
|
emitter.removeListener(name2, resolver);
|
|
@@ -2891,7 +2891,14 @@ function eventTargetAgnosticAddListener(emitter, name2, listener, flags) {
|
|
|
2891
2891
|
}
|
|
2892
2892
|
}
|
|
2893
2893
|
var eventsExports = events.exports;
|
|
2894
|
-
var streamBrowser$1
|
|
2894
|
+
var streamBrowser$1;
|
|
2895
|
+
var hasRequiredStreamBrowser;
|
|
2896
|
+
function requireStreamBrowser() {
|
|
2897
|
+
if (hasRequiredStreamBrowser) return streamBrowser$1;
|
|
2898
|
+
hasRequiredStreamBrowser = 1;
|
|
2899
|
+
streamBrowser$1 = eventsExports.EventEmitter;
|
|
2900
|
+
return streamBrowser$1;
|
|
2901
|
+
}
|
|
2895
2902
|
var util$3 = {};
|
|
2896
2903
|
var types$1 = {};
|
|
2897
2904
|
var shams$1 = function hasSymbols2() {
|
|
@@ -3046,10 +3053,10 @@ var implementation$1 = function bind2(that) {
|
|
|
3046
3053
|
};
|
|
3047
3054
|
var implementation = implementation$1;
|
|
3048
3055
|
var functionBind = Function.prototype.bind || implementation;
|
|
3049
|
-
var call
|
|
3056
|
+
var call = Function.prototype.call;
|
|
3050
3057
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
3051
3058
|
var bind$1 = functionBind;
|
|
3052
|
-
var hasown = bind$1.call(call
|
|
3059
|
+
var hasown = bind$1.call(call, $hasOwn);
|
|
3053
3060
|
var undefined$1;
|
|
3054
3061
|
var $Error = esErrors;
|
|
3055
3062
|
var $EvalError = _eval;
|
|
@@ -4890,209 +4897,229 @@ function requireBuffer_list() {
|
|
|
4890
4897
|
}();
|
|
4891
4898
|
return buffer_list;
|
|
4892
4899
|
}
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4900
|
+
var destroy_1$1;
|
|
4901
|
+
var hasRequiredDestroy;
|
|
4902
|
+
function requireDestroy() {
|
|
4903
|
+
if (hasRequiredDestroy) return destroy_1$1;
|
|
4904
|
+
hasRequiredDestroy = 1;
|
|
4905
|
+
function destroy2(err, cb) {
|
|
4906
|
+
var _this = this;
|
|
4907
|
+
var readableDestroyed = this._readableState && this._readableState.destroyed;
|
|
4908
|
+
var writableDestroyed = this._writableState && this._writableState.destroyed;
|
|
4909
|
+
if (readableDestroyed || writableDestroyed) {
|
|
4910
|
+
if (cb) {
|
|
4911
|
+
cb(err);
|
|
4912
|
+
} else if (err) {
|
|
4913
|
+
if (!this._writableState) {
|
|
4914
|
+
process$1.nextTick(emitErrorNT2, this, err);
|
|
4915
|
+
} else if (!this._writableState.errorEmitted) {
|
|
4916
|
+
this._writableState.errorEmitted = true;
|
|
4917
|
+
process$1.nextTick(emitErrorNT2, this, err);
|
|
4918
|
+
}
|
|
4906
4919
|
}
|
|
4920
|
+
return this;
|
|
4921
|
+
}
|
|
4922
|
+
if (this._readableState) {
|
|
4923
|
+
this._readableState.destroyed = true;
|
|
4907
4924
|
}
|
|
4925
|
+
if (this._writableState) {
|
|
4926
|
+
this._writableState.destroyed = true;
|
|
4927
|
+
}
|
|
4928
|
+
this._destroy(err || null, function(err2) {
|
|
4929
|
+
if (!cb && err2) {
|
|
4930
|
+
if (!_this._writableState) {
|
|
4931
|
+
process$1.nextTick(emitErrorAndCloseNT, _this, err2);
|
|
4932
|
+
} else if (!_this._writableState.errorEmitted) {
|
|
4933
|
+
_this._writableState.errorEmitted = true;
|
|
4934
|
+
process$1.nextTick(emitErrorAndCloseNT, _this, err2);
|
|
4935
|
+
} else {
|
|
4936
|
+
process$1.nextTick(emitCloseNT, _this);
|
|
4937
|
+
}
|
|
4938
|
+
} else if (cb) {
|
|
4939
|
+
process$1.nextTick(emitCloseNT, _this);
|
|
4940
|
+
cb(err2);
|
|
4941
|
+
} else {
|
|
4942
|
+
process$1.nextTick(emitCloseNT, _this);
|
|
4943
|
+
}
|
|
4944
|
+
});
|
|
4908
4945
|
return this;
|
|
4909
4946
|
}
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4947
|
+
function emitErrorAndCloseNT(self2, err) {
|
|
4948
|
+
emitErrorNT2(self2, err);
|
|
4949
|
+
emitCloseNT(self2);
|
|
4950
|
+
}
|
|
4951
|
+
function emitCloseNT(self2) {
|
|
4952
|
+
if (self2._writableState && !self2._writableState.emitClose) return;
|
|
4953
|
+
if (self2._readableState && !self2._readableState.emitClose) return;
|
|
4954
|
+
self2.emit("close");
|
|
4955
|
+
}
|
|
4956
|
+
function undestroy2() {
|
|
4957
|
+
if (this._readableState) {
|
|
4958
|
+
this._readableState.destroyed = false;
|
|
4959
|
+
this._readableState.reading = false;
|
|
4960
|
+
this._readableState.ended = false;
|
|
4961
|
+
this._readableState.endEmitted = false;
|
|
4962
|
+
}
|
|
4963
|
+
if (this._writableState) {
|
|
4964
|
+
this._writableState.destroyed = false;
|
|
4965
|
+
this._writableState.ended = false;
|
|
4966
|
+
this._writableState.ending = false;
|
|
4967
|
+
this._writableState.finalCalled = false;
|
|
4968
|
+
this._writableState.prefinished = false;
|
|
4969
|
+
this._writableState.finished = false;
|
|
4970
|
+
this._writableState.errorEmitted = false;
|
|
4971
|
+
}
|
|
4972
|
+
}
|
|
4973
|
+
function emitErrorNT2(self2, err) {
|
|
4974
|
+
self2.emit("error", err);
|
|
4975
|
+
}
|
|
4976
|
+
function errorOrDestroy(stream, err) {
|
|
4977
|
+
var rState = stream._readableState;
|
|
4978
|
+
var wState = stream._writableState;
|
|
4979
|
+
if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);
|
|
4980
|
+
else stream.emit("error", err);
|
|
4981
|
+
}
|
|
4982
|
+
destroy_1$1 = {
|
|
4983
|
+
destroy: destroy2,
|
|
4984
|
+
undestroy: undestroy2,
|
|
4985
|
+
errorOrDestroy
|
|
4986
|
+
};
|
|
4987
|
+
return destroy_1$1;
|
|
4988
|
+
}
|
|
4989
|
+
var errorsBrowser = {};
|
|
4990
|
+
var hasRequiredErrorsBrowser;
|
|
4991
|
+
function requireErrorsBrowser() {
|
|
4992
|
+
if (hasRequiredErrorsBrowser) return errorsBrowser;
|
|
4993
|
+
hasRequiredErrorsBrowser = 1;
|
|
4994
|
+
function _inheritsLoose(subClass, superClass) {
|
|
4995
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
4996
|
+
subClass.prototype.constructor = subClass;
|
|
4997
|
+
subClass.__proto__ = superClass;
|
|
4998
|
+
}
|
|
4999
|
+
var codes = {};
|
|
5000
|
+
function createErrorType(code, message, Base2) {
|
|
5001
|
+
if (!Base2) {
|
|
5002
|
+
Base2 = Error;
|
|
5003
|
+
}
|
|
5004
|
+
function getMessage(arg1, arg2, arg3) {
|
|
5005
|
+
if (typeof message === "string") {
|
|
5006
|
+
return message;
|
|
5007
|
+
} else {
|
|
5008
|
+
return message(arg1, arg2, arg3);
|
|
5009
|
+
}
|
|
5010
|
+
}
|
|
5011
|
+
var NodeError = /* @__PURE__ */ function(_Base) {
|
|
5012
|
+
_inheritsLoose(NodeError2, _Base);
|
|
5013
|
+
function NodeError2(arg1, arg2, arg3) {
|
|
5014
|
+
return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
|
|
5015
|
+
}
|
|
5016
|
+
return NodeError2;
|
|
5017
|
+
}(Base2);
|
|
5018
|
+
NodeError.prototype.name = Base2.name;
|
|
5019
|
+
NodeError.prototype.code = code;
|
|
5020
|
+
codes[code] = NodeError;
|
|
4915
5021
|
}
|
|
4916
|
-
|
|
4917
|
-
if (
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
5022
|
+
function oneOf(expected, thing) {
|
|
5023
|
+
if (Array.isArray(expected)) {
|
|
5024
|
+
var len = expected.length;
|
|
5025
|
+
expected = expected.map(function(i) {
|
|
5026
|
+
return String(i);
|
|
5027
|
+
});
|
|
5028
|
+
if (len > 2) {
|
|
5029
|
+
return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1];
|
|
5030
|
+
} else if (len === 2) {
|
|
5031
|
+
return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
|
|
4923
5032
|
} else {
|
|
4924
|
-
|
|
5033
|
+
return "of ".concat(thing, " ").concat(expected[0]);
|
|
4925
5034
|
}
|
|
4926
|
-
} else if (cb) {
|
|
4927
|
-
process$1.nextTick(emitCloseNT, _this);
|
|
4928
|
-
cb(err2);
|
|
4929
5035
|
} else {
|
|
4930
|
-
|
|
5036
|
+
return "of ".concat(thing, " ").concat(String(expected));
|
|
4931
5037
|
}
|
|
4932
|
-
});
|
|
4933
|
-
return this;
|
|
4934
|
-
}
|
|
4935
|
-
function emitErrorAndCloseNT(self2, err) {
|
|
4936
|
-
emitErrorNT$1(self2, err);
|
|
4937
|
-
emitCloseNT(self2);
|
|
4938
|
-
}
|
|
4939
|
-
function emitCloseNT(self2) {
|
|
4940
|
-
if (self2._writableState && !self2._writableState.emitClose) return;
|
|
4941
|
-
if (self2._readableState && !self2._readableState.emitClose) return;
|
|
4942
|
-
self2.emit("close");
|
|
4943
|
-
}
|
|
4944
|
-
function undestroy$1() {
|
|
4945
|
-
if (this._readableState) {
|
|
4946
|
-
this._readableState.destroyed = false;
|
|
4947
|
-
this._readableState.reading = false;
|
|
4948
|
-
this._readableState.ended = false;
|
|
4949
|
-
this._readableState.endEmitted = false;
|
|
4950
5038
|
}
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
this._writableState.ended = false;
|
|
4954
|
-
this._writableState.ending = false;
|
|
4955
|
-
this._writableState.finalCalled = false;
|
|
4956
|
-
this._writableState.prefinished = false;
|
|
4957
|
-
this._writableState.finished = false;
|
|
4958
|
-
this._writableState.errorEmitted = false;
|
|
5039
|
+
function startsWith(str, search, pos) {
|
|
5040
|
+
return str.substr(0, search.length) === search;
|
|
4959
5041
|
}
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
}
|
|
4964
|
-
function errorOrDestroy(stream, err) {
|
|
4965
|
-
var rState = stream._readableState;
|
|
4966
|
-
var wState = stream._writableState;
|
|
4967
|
-
if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);
|
|
4968
|
-
else stream.emit("error", err);
|
|
4969
|
-
}
|
|
4970
|
-
var destroy_1$1 = {
|
|
4971
|
-
destroy: destroy$1,
|
|
4972
|
-
undestroy: undestroy$1,
|
|
4973
|
-
errorOrDestroy
|
|
4974
|
-
};
|
|
4975
|
-
var errorsBrowser = {};
|
|
4976
|
-
function _inheritsLoose(subClass, superClass) {
|
|
4977
|
-
subClass.prototype = Object.create(superClass.prototype);
|
|
4978
|
-
subClass.prototype.constructor = subClass;
|
|
4979
|
-
subClass.__proto__ = superClass;
|
|
4980
|
-
}
|
|
4981
|
-
var codes = {};
|
|
4982
|
-
function createErrorType(code, message, Base2) {
|
|
4983
|
-
if (!Base2) {
|
|
4984
|
-
Base2 = Error;
|
|
4985
|
-
}
|
|
4986
|
-
function getMessage(arg1, arg2, arg3) {
|
|
4987
|
-
if (typeof message === "string") {
|
|
4988
|
-
return message;
|
|
4989
|
-
} else {
|
|
4990
|
-
return message(arg1, arg2, arg3);
|
|
5042
|
+
function endsWith(str, search, this_len) {
|
|
5043
|
+
if (this_len === void 0 || this_len > str.length) {
|
|
5044
|
+
this_len = str.length;
|
|
4991
5045
|
}
|
|
5046
|
+
return str.substring(this_len - search.length, this_len) === search;
|
|
4992
5047
|
}
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
|
|
5048
|
+
function includes(str, search, start) {
|
|
5049
|
+
if (typeof start !== "number") {
|
|
5050
|
+
start = 0;
|
|
4997
5051
|
}
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
NodeError.prototype.name = Base2.name;
|
|
5001
|
-
NodeError.prototype.code = code;
|
|
5002
|
-
codes[code] = NodeError;
|
|
5003
|
-
}
|
|
5004
|
-
function oneOf(expected, thing) {
|
|
5005
|
-
if (Array.isArray(expected)) {
|
|
5006
|
-
var len = expected.length;
|
|
5007
|
-
expected = expected.map(function(i) {
|
|
5008
|
-
return String(i);
|
|
5009
|
-
});
|
|
5010
|
-
if (len > 2) {
|
|
5011
|
-
return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1];
|
|
5012
|
-
} else if (len === 2) {
|
|
5013
|
-
return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
|
|
5052
|
+
if (start + search.length > str.length) {
|
|
5053
|
+
return false;
|
|
5014
5054
|
} else {
|
|
5015
|
-
return
|
|
5055
|
+
return str.indexOf(search, start) !== -1;
|
|
5016
5056
|
}
|
|
5017
|
-
} else {
|
|
5018
|
-
return "of ".concat(thing, " ").concat(String(expected));
|
|
5019
|
-
}
|
|
5020
|
-
}
|
|
5021
|
-
function startsWith(str, search, pos) {
|
|
5022
|
-
return str.substr(0, search.length) === search;
|
|
5023
|
-
}
|
|
5024
|
-
function endsWith(str, search, this_len) {
|
|
5025
|
-
if (this_len === void 0 || this_len > str.length) {
|
|
5026
|
-
this_len = str.length;
|
|
5027
|
-
}
|
|
5028
|
-
return str.substring(this_len - search.length, this_len) === search;
|
|
5029
|
-
}
|
|
5030
|
-
function includes(str, search, start) {
|
|
5031
|
-
if (typeof start !== "number") {
|
|
5032
|
-
start = 0;
|
|
5033
|
-
}
|
|
5034
|
-
if (start + search.length > str.length) {
|
|
5035
|
-
return false;
|
|
5036
|
-
} else {
|
|
5037
|
-
return str.indexOf(search, start) !== -1;
|
|
5038
5057
|
}
|
|
5058
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value) {
|
|
5059
|
+
return 'The value "' + value + '" is invalid for option "' + name2 + '"';
|
|
5060
|
+
}, TypeError);
|
|
5061
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name2, expected, actual) {
|
|
5062
|
+
var determiner;
|
|
5063
|
+
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
5064
|
+
determiner = "must not be";
|
|
5065
|
+
expected = expected.replace(/^not /, "");
|
|
5066
|
+
} else {
|
|
5067
|
+
determiner = "must be";
|
|
5068
|
+
}
|
|
5069
|
+
var msg;
|
|
5070
|
+
if (endsWith(name2, " argument")) {
|
|
5071
|
+
msg = "The ".concat(name2, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
5072
|
+
} else {
|
|
5073
|
+
var type2 = includes(name2, ".") ? "property" : "argument";
|
|
5074
|
+
msg = 'The "'.concat(name2, '" ').concat(type2, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
5075
|
+
}
|
|
5076
|
+
msg += ". Received type ".concat(typeof actual);
|
|
5077
|
+
return msg;
|
|
5078
|
+
}, TypeError);
|
|
5079
|
+
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
5080
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name2) {
|
|
5081
|
+
return "The " + name2 + " method is not implemented";
|
|
5082
|
+
});
|
|
5083
|
+
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
5084
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name2) {
|
|
5085
|
+
return "Cannot call " + name2 + " after a stream was destroyed";
|
|
5086
|
+
});
|
|
5087
|
+
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
5088
|
+
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
5089
|
+
createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
|
|
5090
|
+
createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
|
|
5091
|
+
createErrorType("ERR_UNKNOWN_ENCODING", function(arg) {
|
|
5092
|
+
return "Unknown encoding: " + arg;
|
|
5093
|
+
}, TypeError);
|
|
5094
|
+
createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
|
|
5095
|
+
errorsBrowser.codes = codes;
|
|
5096
|
+
return errorsBrowser;
|
|
5097
|
+
}
|
|
5098
|
+
var state;
|
|
5099
|
+
var hasRequiredState;
|
|
5100
|
+
function requireState() {
|
|
5101
|
+
if (hasRequiredState) return state;
|
|
5102
|
+
hasRequiredState = 1;
|
|
5103
|
+
var ERR_INVALID_OPT_VALUE = requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;
|
|
5104
|
+
function highWaterMarkFrom(options2, isDuplex, duplexKey) {
|
|
5105
|
+
return options2.highWaterMark != null ? options2.highWaterMark : isDuplex ? options2[duplexKey] : null;
|
|
5106
|
+
}
|
|
5107
|
+
function getHighWaterMark(state2, options2, duplexKey, isDuplex) {
|
|
5108
|
+
var hwm = highWaterMarkFrom(options2, isDuplex, duplexKey);
|
|
5109
|
+
if (hwm != null) {
|
|
5110
|
+
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
5111
|
+
var name2 = isDuplex ? duplexKey : "highWaterMark";
|
|
5112
|
+
throw new ERR_INVALID_OPT_VALUE(name2, hwm);
|
|
5113
|
+
}
|
|
5114
|
+
return Math.floor(hwm);
|
|
5115
|
+
}
|
|
5116
|
+
return state2.objectMode ? 16 : 16 * 1024;
|
|
5117
|
+
}
|
|
5118
|
+
state = {
|
|
5119
|
+
getHighWaterMark
|
|
5120
|
+
};
|
|
5121
|
+
return state;
|
|
5039
5122
|
}
|
|
5040
|
-
createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value) {
|
|
5041
|
-
return 'The value "' + value + '" is invalid for option "' + name2 + '"';
|
|
5042
|
-
}, TypeError);
|
|
5043
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(name2, expected, actual) {
|
|
5044
|
-
var determiner;
|
|
5045
|
-
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
5046
|
-
determiner = "must not be";
|
|
5047
|
-
expected = expected.replace(/^not /, "");
|
|
5048
|
-
} else {
|
|
5049
|
-
determiner = "must be";
|
|
5050
|
-
}
|
|
5051
|
-
var msg;
|
|
5052
|
-
if (endsWith(name2, " argument")) {
|
|
5053
|
-
msg = "The ".concat(name2, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
5054
|
-
} else {
|
|
5055
|
-
var type2 = includes(name2, ".") ? "property" : "argument";
|
|
5056
|
-
msg = 'The "'.concat(name2, '" ').concat(type2, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
5057
|
-
}
|
|
5058
|
-
msg += ". Received type ".concat(typeof actual);
|
|
5059
|
-
return msg;
|
|
5060
|
-
}, TypeError);
|
|
5061
|
-
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
5062
|
-
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name2) {
|
|
5063
|
-
return "The " + name2 + " method is not implemented";
|
|
5064
|
-
});
|
|
5065
|
-
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
5066
|
-
createErrorType("ERR_STREAM_DESTROYED", function(name2) {
|
|
5067
|
-
return "Cannot call " + name2 + " after a stream was destroyed";
|
|
5068
|
-
});
|
|
5069
|
-
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
5070
|
-
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
5071
|
-
createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
|
|
5072
|
-
createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
|
|
5073
|
-
createErrorType("ERR_UNKNOWN_ENCODING", function(arg) {
|
|
5074
|
-
return "Unknown encoding: " + arg;
|
|
5075
|
-
}, TypeError);
|
|
5076
|
-
createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
|
|
5077
|
-
errorsBrowser.codes = codes;
|
|
5078
|
-
var ERR_INVALID_OPT_VALUE = errorsBrowser.codes.ERR_INVALID_OPT_VALUE;
|
|
5079
|
-
function highWaterMarkFrom(options2, isDuplex, duplexKey) {
|
|
5080
|
-
return options2.highWaterMark != null ? options2.highWaterMark : isDuplex ? options2[duplexKey] : null;
|
|
5081
|
-
}
|
|
5082
|
-
function getHighWaterMark(state2, options2, duplexKey, isDuplex) {
|
|
5083
|
-
var hwm = highWaterMarkFrom(options2, isDuplex, duplexKey);
|
|
5084
|
-
if (hwm != null) {
|
|
5085
|
-
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
5086
|
-
var name2 = isDuplex ? duplexKey : "highWaterMark";
|
|
5087
|
-
throw new ERR_INVALID_OPT_VALUE(name2, hwm);
|
|
5088
|
-
}
|
|
5089
|
-
return Math.floor(hwm);
|
|
5090
|
-
}
|
|
5091
|
-
return state2.objectMode ? 16 : 16 * 1024;
|
|
5092
|
-
}
|
|
5093
|
-
var state = {
|
|
5094
|
-
getHighWaterMark
|
|
5095
|
-
};
|
|
5096
5123
|
var browser$b = deprecate;
|
|
5097
5124
|
function deprecate(fn, msg) {
|
|
5098
5125
|
if (config$1("noDeprecation")) {
|
|
@@ -5143,7 +5170,7 @@ function require_stream_writable$1() {
|
|
|
5143
5170
|
var internalUtil = {
|
|
5144
5171
|
deprecate: browser$b
|
|
5145
5172
|
};
|
|
5146
|
-
var Stream2 =
|
|
5173
|
+
var Stream2 = requireStreamBrowser();
|
|
5147
5174
|
var Buffer2 = dist.Buffer;
|
|
5148
5175
|
var OurUint8Array = (typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
5149
5176
|
};
|
|
@@ -5153,10 +5180,10 @@ function require_stream_writable$1() {
|
|
|
5153
5180
|
function _isUint8Array(obj) {
|
|
5154
5181
|
return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
5155
5182
|
}
|
|
5156
|
-
var destroyImpl =
|
|
5157
|
-
var _require =
|
|
5158
|
-
var _require$
|
|
5159
|
-
var
|
|
5183
|
+
var destroyImpl = requireDestroy();
|
|
5184
|
+
var _require = requireState(), getHighWaterMark = _require.getHighWaterMark;
|
|
5185
|
+
var _require$codes = requireErrorsBrowser().codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
|
|
5186
|
+
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
5160
5187
|
inherits_browserExports(Writable, Stream2);
|
|
5161
5188
|
function nop() {
|
|
5162
5189
|
}
|
|
@@ -5166,7 +5193,7 @@ function require_stream_writable$1() {
|
|
|
5166
5193
|
if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex2;
|
|
5167
5194
|
this.objectMode = !!options2.objectMode;
|
|
5168
5195
|
if (isDuplex) this.objectMode = this.objectMode || !!options2.writableObjectMode;
|
|
5169
|
-
this.highWaterMark =
|
|
5196
|
+
this.highWaterMark = getHighWaterMark(this, options2, "writableHighWaterMark", isDuplex);
|
|
5170
5197
|
this.finalCalled = false;
|
|
5171
5198
|
this.needDrain = false;
|
|
5172
5199
|
this.ending = false;
|
|
@@ -5245,11 +5272,11 @@ function require_stream_writable$1() {
|
|
|
5245
5272
|
Stream2.call(this);
|
|
5246
5273
|
}
|
|
5247
5274
|
Writable.prototype.pipe = function() {
|
|
5248
|
-
|
|
5275
|
+
errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
|
|
5249
5276
|
};
|
|
5250
5277
|
function writeAfterEnd(stream, cb) {
|
|
5251
5278
|
var er = new ERR_STREAM_WRITE_AFTER_END();
|
|
5252
|
-
|
|
5279
|
+
errorOrDestroy(stream, er);
|
|
5253
5280
|
process$1.nextTick(cb, er);
|
|
5254
5281
|
}
|
|
5255
5282
|
function validChunk(stream, state2, chunk, cb) {
|
|
@@ -5260,7 +5287,7 @@ function require_stream_writable$1() {
|
|
|
5260
5287
|
er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
|
|
5261
5288
|
}
|
|
5262
5289
|
if (er) {
|
|
5263
|
-
|
|
5290
|
+
errorOrDestroy(stream, er);
|
|
5264
5291
|
process$1.nextTick(cb, er);
|
|
5265
5292
|
return false;
|
|
5266
5293
|
}
|
|
@@ -5365,7 +5392,7 @@ function require_stream_writable$1() {
|
|
|
5365
5392
|
state2.writecb = cb;
|
|
5366
5393
|
state2.writing = true;
|
|
5367
5394
|
state2.sync = true;
|
|
5368
|
-
if (state2.destroyed) state2.onwrite(new
|
|
5395
|
+
if (state2.destroyed) state2.onwrite(new ERR_STREAM_DESTROYED("write"));
|
|
5369
5396
|
else if (writev) stream._writev(chunk, state2.onwrite);
|
|
5370
5397
|
else stream._write(chunk, encoding, state2.onwrite);
|
|
5371
5398
|
state2.sync = false;
|
|
@@ -5376,11 +5403,11 @@ function require_stream_writable$1() {
|
|
|
5376
5403
|
process$1.nextTick(cb, er);
|
|
5377
5404
|
process$1.nextTick(finishMaybe, stream, state2);
|
|
5378
5405
|
stream._writableState.errorEmitted = true;
|
|
5379
|
-
|
|
5406
|
+
errorOrDestroy(stream, er);
|
|
5380
5407
|
} else {
|
|
5381
5408
|
cb(er);
|
|
5382
5409
|
stream._writableState.errorEmitted = true;
|
|
5383
|
-
|
|
5410
|
+
errorOrDestroy(stream, er);
|
|
5384
5411
|
finishMaybe(stream, state2);
|
|
5385
5412
|
}
|
|
5386
5413
|
}
|
|
@@ -5394,7 +5421,7 @@ function require_stream_writable$1() {
|
|
|
5394
5421
|
var state2 = stream._writableState;
|
|
5395
5422
|
var sync2 = state2.sync;
|
|
5396
5423
|
var cb = state2.writecb;
|
|
5397
|
-
if (typeof cb !== "function") throw new
|
|
5424
|
+
if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK();
|
|
5398
5425
|
onwriteStateUpdate(state2);
|
|
5399
5426
|
if (er) onwriteError(stream, state2, sync2, er, cb);
|
|
5400
5427
|
else {
|
|
@@ -5467,7 +5494,7 @@ function require_stream_writable$1() {
|
|
|
5467
5494
|
state2.bufferProcessing = false;
|
|
5468
5495
|
}
|
|
5469
5496
|
Writable.prototype._write = function(chunk, encoding, cb) {
|
|
5470
|
-
cb(new
|
|
5497
|
+
cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()"));
|
|
5471
5498
|
};
|
|
5472
5499
|
Writable.prototype._writev = null;
|
|
5473
5500
|
Writable.prototype.end = function(chunk, encoding, cb) {
|
|
@@ -5504,7 +5531,7 @@ function require_stream_writable$1() {
|
|
|
5504
5531
|
stream._final(function(err) {
|
|
5505
5532
|
state2.pendingcb--;
|
|
5506
5533
|
if (err) {
|
|
5507
|
-
|
|
5534
|
+
errorOrDestroy(stream, err);
|
|
5508
5535
|
}
|
|
5509
5536
|
state2.prefinished = true;
|
|
5510
5537
|
stream.emit("prefinish");
|
|
@@ -5908,88 +5935,95 @@ function simpleWrite(buf) {
|
|
|
5908
5935
|
function simpleEnd(buf) {
|
|
5909
5936
|
return buf && buf.length ? this.write(buf) : "";
|
|
5910
5937
|
}
|
|
5911
|
-
var
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
}
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
}
|
|
5928
|
-
function
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
if (!
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
if (
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
stream.
|
|
5981
|
-
stream.
|
|
5982
|
-
stream.
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5938
|
+
var endOfStream;
|
|
5939
|
+
var hasRequiredEndOfStream;
|
|
5940
|
+
function requireEndOfStream() {
|
|
5941
|
+
if (hasRequiredEndOfStream) return endOfStream;
|
|
5942
|
+
hasRequiredEndOfStream = 1;
|
|
5943
|
+
var ERR_STREAM_PREMATURE_CLOSE = requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;
|
|
5944
|
+
function once3(callback) {
|
|
5945
|
+
var called = false;
|
|
5946
|
+
return function() {
|
|
5947
|
+
if (called) return;
|
|
5948
|
+
called = true;
|
|
5949
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
5950
|
+
args[_key] = arguments[_key];
|
|
5951
|
+
}
|
|
5952
|
+
callback.apply(this, args);
|
|
5953
|
+
};
|
|
5954
|
+
}
|
|
5955
|
+
function noop2() {
|
|
5956
|
+
}
|
|
5957
|
+
function isRequest(stream) {
|
|
5958
|
+
return stream.setHeader && typeof stream.abort === "function";
|
|
5959
|
+
}
|
|
5960
|
+
function eos(stream, opts, callback) {
|
|
5961
|
+
if (typeof opts === "function") return eos(stream, null, opts);
|
|
5962
|
+
if (!opts) opts = {};
|
|
5963
|
+
callback = once3(callback || noop2);
|
|
5964
|
+
var readable = opts.readable || opts.readable !== false && stream.readable;
|
|
5965
|
+
var writable = opts.writable || opts.writable !== false && stream.writable;
|
|
5966
|
+
var onlegacyfinish = function onlegacyfinish2() {
|
|
5967
|
+
if (!stream.writable) onfinish();
|
|
5968
|
+
};
|
|
5969
|
+
var writableEnded = stream._writableState && stream._writableState.finished;
|
|
5970
|
+
var onfinish = function onfinish2() {
|
|
5971
|
+
writable = false;
|
|
5972
|
+
writableEnded = true;
|
|
5973
|
+
if (!readable) callback.call(stream);
|
|
5974
|
+
};
|
|
5975
|
+
var readableEnded = stream._readableState && stream._readableState.endEmitted;
|
|
5976
|
+
var onend = function onend2() {
|
|
5977
|
+
readable = false;
|
|
5978
|
+
readableEnded = true;
|
|
5979
|
+
if (!writable) callback.call(stream);
|
|
5980
|
+
};
|
|
5981
|
+
var onerror = function onerror2(err) {
|
|
5982
|
+
callback.call(stream, err);
|
|
5983
|
+
};
|
|
5984
|
+
var onclose = function onclose2() {
|
|
5985
|
+
var err;
|
|
5986
|
+
if (readable && !readableEnded) {
|
|
5987
|
+
if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
|
|
5988
|
+
return callback.call(stream, err);
|
|
5989
|
+
}
|
|
5990
|
+
if (writable && !writableEnded) {
|
|
5991
|
+
if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
|
|
5992
|
+
return callback.call(stream, err);
|
|
5993
|
+
}
|
|
5994
|
+
};
|
|
5995
|
+
var onrequest = function onrequest2() {
|
|
5996
|
+
stream.req.on("finish", onfinish);
|
|
5997
|
+
};
|
|
5998
|
+
if (isRequest(stream)) {
|
|
5999
|
+
stream.on("complete", onfinish);
|
|
6000
|
+
stream.on("abort", onclose);
|
|
6001
|
+
if (stream.req) onrequest();
|
|
6002
|
+
else stream.on("request", onrequest);
|
|
6003
|
+
} else if (writable && !stream._writableState) {
|
|
6004
|
+
stream.on("end", onlegacyfinish);
|
|
6005
|
+
stream.on("close", onlegacyfinish);
|
|
6006
|
+
}
|
|
6007
|
+
stream.on("end", onend);
|
|
6008
|
+
stream.on("finish", onfinish);
|
|
6009
|
+
if (opts.error !== false) stream.on("error", onerror);
|
|
6010
|
+
stream.on("close", onclose);
|
|
6011
|
+
return function() {
|
|
6012
|
+
stream.removeListener("complete", onfinish);
|
|
6013
|
+
stream.removeListener("abort", onclose);
|
|
6014
|
+
stream.removeListener("request", onrequest);
|
|
6015
|
+
if (stream.req) stream.req.removeListener("finish", onfinish);
|
|
6016
|
+
stream.removeListener("end", onlegacyfinish);
|
|
6017
|
+
stream.removeListener("close", onlegacyfinish);
|
|
6018
|
+
stream.removeListener("finish", onfinish);
|
|
6019
|
+
stream.removeListener("end", onend);
|
|
6020
|
+
stream.removeListener("error", onerror);
|
|
6021
|
+
stream.removeListener("close", onclose);
|
|
6022
|
+
};
|
|
6023
|
+
}
|
|
6024
|
+
endOfStream = eos;
|
|
6025
|
+
return endOfStream;
|
|
5991
6026
|
}
|
|
5992
|
-
var endOfStream = eos$1;
|
|
5993
6027
|
var async_iterator;
|
|
5994
6028
|
var hasRequiredAsync_iterator;
|
|
5995
6029
|
function requireAsync_iterator() {
|
|
@@ -6019,7 +6053,7 @@ function requireAsync_iterator() {
|
|
|
6019
6053
|
}
|
|
6020
6054
|
return (hint === "string" ? String : Number)(input);
|
|
6021
6055
|
}
|
|
6022
|
-
var finished =
|
|
6056
|
+
var finished = requireEndOfStream();
|
|
6023
6057
|
var kLastResolve = Symbol("lastResolve");
|
|
6024
6058
|
var kLastReject = Symbol("lastReject");
|
|
6025
6059
|
var kError = Symbol("error");
|
|
@@ -6195,7 +6229,7 @@ function require_stream_readable$1() {
|
|
|
6195
6229
|
var EElistenerCount = function EElistenerCount2(emitter, type2) {
|
|
6196
6230
|
return emitter.listeners(type2).length;
|
|
6197
6231
|
};
|
|
6198
|
-
var Stream2 =
|
|
6232
|
+
var Stream2 = requireStreamBrowser();
|
|
6199
6233
|
var Buffer2 = dist.Buffer;
|
|
6200
6234
|
var OurUint8Array = (typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
6201
6235
|
};
|
|
@@ -6214,14 +6248,14 @@ function require_stream_readable$1() {
|
|
|
6214
6248
|
};
|
|
6215
6249
|
}
|
|
6216
6250
|
var BufferList2 = requireBuffer_list();
|
|
6217
|
-
var destroyImpl =
|
|
6218
|
-
var _require =
|
|
6219
|
-
var _require$
|
|
6251
|
+
var destroyImpl = requireDestroy();
|
|
6252
|
+
var _require = requireState(), getHighWaterMark = _require.getHighWaterMark;
|
|
6253
|
+
var _require$codes = requireErrorsBrowser().codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
|
|
6220
6254
|
var StringDecoder2;
|
|
6221
6255
|
var createReadableStreamAsyncIterator;
|
|
6222
6256
|
var from;
|
|
6223
6257
|
inherits_browserExports(Readable, Stream2);
|
|
6224
|
-
var
|
|
6258
|
+
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
6225
6259
|
var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
|
|
6226
6260
|
function prependListener2(emitter, event, fn) {
|
|
6227
6261
|
if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
|
|
@@ -6235,7 +6269,7 @@ function require_stream_readable$1() {
|
|
|
6235
6269
|
if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex2;
|
|
6236
6270
|
this.objectMode = !!options2.objectMode;
|
|
6237
6271
|
if (isDuplex) this.objectMode = this.objectMode || !!options2.readableObjectMode;
|
|
6238
|
-
this.highWaterMark =
|
|
6272
|
+
this.highWaterMark = getHighWaterMark(this, options2, "readableHighWaterMark", isDuplex);
|
|
6239
6273
|
this.buffer = new BufferList2();
|
|
6240
6274
|
this.length = 0;
|
|
6241
6275
|
this.pipes = null;
|
|
@@ -6329,16 +6363,16 @@ function require_stream_readable$1() {
|
|
|
6329
6363
|
var er;
|
|
6330
6364
|
if (!skipChunkCheck) er = chunkInvalid(state2, chunk);
|
|
6331
6365
|
if (er) {
|
|
6332
|
-
|
|
6366
|
+
errorOrDestroy(stream, er);
|
|
6333
6367
|
} else if (state2.objectMode || chunk && chunk.length > 0) {
|
|
6334
6368
|
if (typeof chunk !== "string" && !state2.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
|
|
6335
6369
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
6336
6370
|
}
|
|
6337
6371
|
if (addToFront) {
|
|
6338
|
-
if (state2.endEmitted)
|
|
6372
|
+
if (state2.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());
|
|
6339
6373
|
else addChunk(stream, state2, chunk, true);
|
|
6340
6374
|
} else if (state2.ended) {
|
|
6341
|
-
|
|
6375
|
+
errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
|
|
6342
6376
|
} else if (state2.destroyed) {
|
|
6343
6377
|
return false;
|
|
6344
6378
|
} else {
|
|
@@ -6536,7 +6570,7 @@ function require_stream_readable$1() {
|
|
|
6536
6570
|
state2.readingMore = false;
|
|
6537
6571
|
}
|
|
6538
6572
|
Readable.prototype._read = function(n) {
|
|
6539
|
-
|
|
6573
|
+
errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
|
|
6540
6574
|
};
|
|
6541
6575
|
Readable.prototype.pipe = function(dest, pipeOpts) {
|
|
6542
6576
|
var src = this;
|
|
@@ -6605,7 +6639,7 @@ function require_stream_readable$1() {
|
|
|
6605
6639
|
debug("onerror", er);
|
|
6606
6640
|
unpipe();
|
|
6607
6641
|
dest.removeListener("error", onerror);
|
|
6608
|
-
if (EElistenerCount(dest, "error") === 0)
|
|
6642
|
+
if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er);
|
|
6609
6643
|
}
|
|
6610
6644
|
prependListener2(dest, "error", onerror);
|
|
6611
6645
|
function onclose() {
|
|
@@ -6911,192 +6945,213 @@ function require_stream_readable$1() {
|
|
|
6911
6945
|
}
|
|
6912
6946
|
return _stream_readable$1;
|
|
6913
6947
|
}
|
|
6914
|
-
var _stream_transform$1
|
|
6915
|
-
var
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
var
|
|
6922
|
-
|
|
6923
|
-
|
|
6948
|
+
var _stream_transform$1;
|
|
6949
|
+
var hasRequired_stream_transform;
|
|
6950
|
+
function require_stream_transform() {
|
|
6951
|
+
if (hasRequired_stream_transform) return _stream_transform$1;
|
|
6952
|
+
hasRequired_stream_transform = 1;
|
|
6953
|
+
_stream_transform$1 = Transform2;
|
|
6954
|
+
var _require$codes = requireErrorsBrowser().codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
|
|
6955
|
+
var Duplex2 = require_stream_duplex$1();
|
|
6956
|
+
inherits_browserExports(Transform2, Duplex2);
|
|
6957
|
+
function afterTransform2(er, data) {
|
|
6958
|
+
var ts = this._transformState;
|
|
6959
|
+
ts.transforming = false;
|
|
6960
|
+
var cb = ts.writecb;
|
|
6961
|
+
if (cb === null) {
|
|
6962
|
+
return this.emit("error", new ERR_MULTIPLE_CALLBACK());
|
|
6963
|
+
}
|
|
6964
|
+
ts.writechunk = null;
|
|
6965
|
+
ts.writecb = null;
|
|
6966
|
+
if (data != null)
|
|
6967
|
+
this.push(data);
|
|
6968
|
+
cb(er);
|
|
6969
|
+
var rs = this._readableState;
|
|
6970
|
+
rs.reading = false;
|
|
6971
|
+
if (rs.needReadable || rs.length < rs.highWaterMark) {
|
|
6972
|
+
this._read(rs.highWaterMark);
|
|
6973
|
+
}
|
|
6974
|
+
}
|
|
6975
|
+
function Transform2(options2) {
|
|
6976
|
+
if (!(this instanceof Transform2)) return new Transform2(options2);
|
|
6977
|
+
Duplex2.call(this, options2);
|
|
6978
|
+
this._transformState = {
|
|
6979
|
+
afterTransform: afterTransform2.bind(this),
|
|
6980
|
+
needTransform: false,
|
|
6981
|
+
transforming: false,
|
|
6982
|
+
writecb: null,
|
|
6983
|
+
writechunk: null,
|
|
6984
|
+
writeencoding: null
|
|
6985
|
+
};
|
|
6986
|
+
this._readableState.needReadable = true;
|
|
6987
|
+
this._readableState.sync = false;
|
|
6988
|
+
if (options2) {
|
|
6989
|
+
if (typeof options2.transform === "function") this._transform = options2.transform;
|
|
6990
|
+
if (typeof options2.flush === "function") this._flush = options2.flush;
|
|
6991
|
+
}
|
|
6992
|
+
this.on("prefinish", prefinish2);
|
|
6924
6993
|
}
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6994
|
+
function prefinish2() {
|
|
6995
|
+
var _this = this;
|
|
6996
|
+
if (typeof this._flush === "function" && !this._readableState.destroyed) {
|
|
6997
|
+
this._flush(function(er, data) {
|
|
6998
|
+
done2(_this, er, data);
|
|
6999
|
+
});
|
|
7000
|
+
} else {
|
|
7001
|
+
done2(this, null, null);
|
|
7002
|
+
}
|
|
6934
7003
|
}
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
Duplex$1.call(this, options2);
|
|
6939
|
-
this._transformState = {
|
|
6940
|
-
afterTransform: afterTransform$1.bind(this),
|
|
6941
|
-
needTransform: false,
|
|
6942
|
-
transforming: false,
|
|
6943
|
-
writecb: null,
|
|
6944
|
-
writechunk: null,
|
|
6945
|
-
writeencoding: null
|
|
7004
|
+
Transform2.prototype.push = function(chunk, encoding) {
|
|
7005
|
+
this._transformState.needTransform = false;
|
|
7006
|
+
return Duplex2.prototype.push.call(this, chunk, encoding);
|
|
6946
7007
|
};
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
7008
|
+
Transform2.prototype._transform = function(chunk, encoding, cb) {
|
|
7009
|
+
cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
|
|
7010
|
+
};
|
|
7011
|
+
Transform2.prototype._write = function(chunk, encoding, cb) {
|
|
7012
|
+
var ts = this._transformState;
|
|
7013
|
+
ts.writecb = cb;
|
|
7014
|
+
ts.writechunk = chunk;
|
|
7015
|
+
ts.writeencoding = encoding;
|
|
7016
|
+
if (!ts.transforming) {
|
|
7017
|
+
var rs = this._readableState;
|
|
7018
|
+
if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
|
|
7019
|
+
}
|
|
7020
|
+
};
|
|
7021
|
+
Transform2.prototype._read = function(n) {
|
|
7022
|
+
var ts = this._transformState;
|
|
7023
|
+
if (ts.writechunk !== null && !ts.transforming) {
|
|
7024
|
+
ts.transforming = true;
|
|
7025
|
+
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
|
|
7026
|
+
} else {
|
|
7027
|
+
ts.needTransform = true;
|
|
7028
|
+
}
|
|
7029
|
+
};
|
|
7030
|
+
Transform2.prototype._destroy = function(err, cb) {
|
|
7031
|
+
Duplex2.prototype._destroy.call(this, err, function(err2) {
|
|
7032
|
+
cb(err2);
|
|
6960
7033
|
});
|
|
6961
|
-
}
|
|
6962
|
-
|
|
7034
|
+
};
|
|
7035
|
+
function done2(stream, er, data) {
|
|
7036
|
+
if (er) return stream.emit("error", er);
|
|
7037
|
+
if (data != null)
|
|
7038
|
+
stream.push(data);
|
|
7039
|
+
if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
|
|
7040
|
+
if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
|
|
7041
|
+
return stream.push(null);
|
|
7042
|
+
}
|
|
7043
|
+
return _stream_transform$1;
|
|
7044
|
+
}
|
|
7045
|
+
var _stream_passthrough$1;
|
|
7046
|
+
var hasRequired_stream_passthrough;
|
|
7047
|
+
function require_stream_passthrough() {
|
|
7048
|
+
if (hasRequired_stream_passthrough) return _stream_passthrough$1;
|
|
7049
|
+
hasRequired_stream_passthrough = 1;
|
|
7050
|
+
_stream_passthrough$1 = PassThrough2;
|
|
7051
|
+
var Transform2 = require_stream_transform();
|
|
7052
|
+
inherits_browserExports(PassThrough2, Transform2);
|
|
7053
|
+
function PassThrough2(options2) {
|
|
7054
|
+
if (!(this instanceof PassThrough2)) return new PassThrough2(options2);
|
|
7055
|
+
Transform2.call(this, options2);
|
|
7056
|
+
}
|
|
7057
|
+
PassThrough2.prototype._transform = function(chunk, encoding, cb) {
|
|
7058
|
+
cb(null, chunk);
|
|
7059
|
+
};
|
|
7060
|
+
return _stream_passthrough$1;
|
|
7061
|
+
}
|
|
7062
|
+
var pipeline_1;
|
|
7063
|
+
var hasRequiredPipeline;
|
|
7064
|
+
function requirePipeline() {
|
|
7065
|
+
if (hasRequiredPipeline) return pipeline_1;
|
|
7066
|
+
hasRequiredPipeline = 1;
|
|
7067
|
+
var eos;
|
|
7068
|
+
function once3(callback) {
|
|
7069
|
+
var called = false;
|
|
7070
|
+
return function() {
|
|
7071
|
+
if (called) return;
|
|
7072
|
+
called = true;
|
|
7073
|
+
callback.apply(void 0, arguments);
|
|
7074
|
+
};
|
|
6963
7075
|
}
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
return Duplex$1.prototype.push.call(this, chunk, encoding);
|
|
6968
|
-
};
|
|
6969
|
-
Transform$9.prototype._transform = function(chunk, encoding, cb) {
|
|
6970
|
-
cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
|
|
6971
|
-
};
|
|
6972
|
-
Transform$9.prototype._write = function(chunk, encoding, cb) {
|
|
6973
|
-
var ts = this._transformState;
|
|
6974
|
-
ts.writecb = cb;
|
|
6975
|
-
ts.writechunk = chunk;
|
|
6976
|
-
ts.writeencoding = encoding;
|
|
6977
|
-
if (!ts.transforming) {
|
|
6978
|
-
var rs = this._readableState;
|
|
6979
|
-
if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
|
|
7076
|
+
var _require$codes = requireErrorsBrowser().codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
|
|
7077
|
+
function noop2(err) {
|
|
7078
|
+
if (err) throw err;
|
|
6980
7079
|
}
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
var ts = this._transformState;
|
|
6984
|
-
if (ts.writechunk !== null && !ts.transforming) {
|
|
6985
|
-
ts.transforming = true;
|
|
6986
|
-
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
|
|
6987
|
-
} else {
|
|
6988
|
-
ts.needTransform = true;
|
|
7080
|
+
function isRequest(stream) {
|
|
7081
|
+
return stream.setHeader && typeof stream.abort === "function";
|
|
6989
7082
|
}
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
};
|
|
6996
|
-
function done$1(stream, er, data) {
|
|
6997
|
-
if (er) return stream.emit("error", er);
|
|
6998
|
-
if (data != null)
|
|
6999
|
-
stream.push(data);
|
|
7000
|
-
if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
|
|
7001
|
-
if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
|
|
7002
|
-
return stream.push(null);
|
|
7003
|
-
}
|
|
7004
|
-
var _stream_passthrough$1 = PassThrough$1;
|
|
7005
|
-
var Transform$8 = _stream_transform$1;
|
|
7006
|
-
inherits_browserExports(PassThrough$1, Transform$8);
|
|
7007
|
-
function PassThrough$1(options2) {
|
|
7008
|
-
if (!(this instanceof PassThrough$1)) return new PassThrough$1(options2);
|
|
7009
|
-
Transform$8.call(this, options2);
|
|
7010
|
-
}
|
|
7011
|
-
PassThrough$1.prototype._transform = function(chunk, encoding, cb) {
|
|
7012
|
-
cb(null, chunk);
|
|
7013
|
-
};
|
|
7014
|
-
var eos;
|
|
7015
|
-
function once(callback) {
|
|
7016
|
-
var called = false;
|
|
7017
|
-
return function() {
|
|
7018
|
-
if (called) return;
|
|
7019
|
-
called = true;
|
|
7020
|
-
callback.apply(void 0, arguments);
|
|
7021
|
-
};
|
|
7022
|
-
}
|
|
7023
|
-
var _require$codes = errorsBrowser.codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
|
|
7024
|
-
function noop(err) {
|
|
7025
|
-
if (err) throw err;
|
|
7026
|
-
}
|
|
7027
|
-
function isRequest(stream) {
|
|
7028
|
-
return stream.setHeader && typeof stream.abort === "function";
|
|
7029
|
-
}
|
|
7030
|
-
function destroyer(stream, reading, writing, callback) {
|
|
7031
|
-
callback = once(callback);
|
|
7032
|
-
var closed = false;
|
|
7033
|
-
stream.on("close", function() {
|
|
7034
|
-
closed = true;
|
|
7035
|
-
});
|
|
7036
|
-
if (eos === void 0) eos = endOfStream;
|
|
7037
|
-
eos(stream, {
|
|
7038
|
-
readable: reading,
|
|
7039
|
-
writable: writing
|
|
7040
|
-
}, function(err) {
|
|
7041
|
-
if (err) return callback(err);
|
|
7042
|
-
closed = true;
|
|
7043
|
-
callback();
|
|
7044
|
-
});
|
|
7045
|
-
var destroyed = false;
|
|
7046
|
-
return function(err) {
|
|
7047
|
-
if (closed) return;
|
|
7048
|
-
if (destroyed) return;
|
|
7049
|
-
destroyed = true;
|
|
7050
|
-
if (isRequest(stream)) return stream.abort();
|
|
7051
|
-
if (typeof stream.destroy === "function") return stream.destroy();
|
|
7052
|
-
callback(err || new ERR_STREAM_DESTROYED("pipe"));
|
|
7053
|
-
};
|
|
7054
|
-
}
|
|
7055
|
-
function call(fn) {
|
|
7056
|
-
fn();
|
|
7057
|
-
}
|
|
7058
|
-
function pipe(from, to) {
|
|
7059
|
-
return from.pipe(to);
|
|
7060
|
-
}
|
|
7061
|
-
function popCallback(streams) {
|
|
7062
|
-
if (!streams.length) return noop;
|
|
7063
|
-
if (typeof streams[streams.length - 1] !== "function") return noop;
|
|
7064
|
-
return streams.pop();
|
|
7065
|
-
}
|
|
7066
|
-
function pipeline() {
|
|
7067
|
-
for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
7068
|
-
streams[_key] = arguments[_key];
|
|
7069
|
-
}
|
|
7070
|
-
var callback = popCallback(streams);
|
|
7071
|
-
if (Array.isArray(streams[0])) streams = streams[0];
|
|
7072
|
-
if (streams.length < 2) {
|
|
7073
|
-
throw new ERR_MISSING_ARGS("streams");
|
|
7074
|
-
}
|
|
7075
|
-
var error2;
|
|
7076
|
-
var destroys = streams.map(function(stream, i) {
|
|
7077
|
-
var reading = i < streams.length - 1;
|
|
7078
|
-
var writing = i > 0;
|
|
7079
|
-
return destroyer(stream, reading, writing, function(err) {
|
|
7080
|
-
if (!error2) error2 = err;
|
|
7081
|
-
if (err) destroys.forEach(call);
|
|
7082
|
-
if (reading) return;
|
|
7083
|
-
destroys.forEach(call);
|
|
7084
|
-
callback(error2);
|
|
7083
|
+
function destroyer(stream, reading, writing, callback) {
|
|
7084
|
+
callback = once3(callback);
|
|
7085
|
+
var closed = false;
|
|
7086
|
+
stream.on("close", function() {
|
|
7087
|
+
closed = true;
|
|
7085
7088
|
});
|
|
7086
|
-
|
|
7087
|
-
|
|
7089
|
+
if (eos === void 0) eos = requireEndOfStream();
|
|
7090
|
+
eos(stream, {
|
|
7091
|
+
readable: reading,
|
|
7092
|
+
writable: writing
|
|
7093
|
+
}, function(err) {
|
|
7094
|
+
if (err) return callback(err);
|
|
7095
|
+
closed = true;
|
|
7096
|
+
callback();
|
|
7097
|
+
});
|
|
7098
|
+
var destroyed = false;
|
|
7099
|
+
return function(err) {
|
|
7100
|
+
if (closed) return;
|
|
7101
|
+
if (destroyed) return;
|
|
7102
|
+
destroyed = true;
|
|
7103
|
+
if (isRequest(stream)) return stream.abort();
|
|
7104
|
+
if (typeof stream.destroy === "function") return stream.destroy();
|
|
7105
|
+
callback(err || new ERR_STREAM_DESTROYED("pipe"));
|
|
7106
|
+
};
|
|
7107
|
+
}
|
|
7108
|
+
function call2(fn) {
|
|
7109
|
+
fn();
|
|
7110
|
+
}
|
|
7111
|
+
function pipe(from, to) {
|
|
7112
|
+
return from.pipe(to);
|
|
7113
|
+
}
|
|
7114
|
+
function popCallback(streams) {
|
|
7115
|
+
if (!streams.length) return noop2;
|
|
7116
|
+
if (typeof streams[streams.length - 1] !== "function") return noop2;
|
|
7117
|
+
return streams.pop();
|
|
7118
|
+
}
|
|
7119
|
+
function pipeline() {
|
|
7120
|
+
for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
7121
|
+
streams[_key] = arguments[_key];
|
|
7122
|
+
}
|
|
7123
|
+
var callback = popCallback(streams);
|
|
7124
|
+
if (Array.isArray(streams[0])) streams = streams[0];
|
|
7125
|
+
if (streams.length < 2) {
|
|
7126
|
+
throw new ERR_MISSING_ARGS("streams");
|
|
7127
|
+
}
|
|
7128
|
+
var error2;
|
|
7129
|
+
var destroys = streams.map(function(stream, i) {
|
|
7130
|
+
var reading = i < streams.length - 1;
|
|
7131
|
+
var writing = i > 0;
|
|
7132
|
+
return destroyer(stream, reading, writing, function(err) {
|
|
7133
|
+
if (!error2) error2 = err;
|
|
7134
|
+
if (err) destroys.forEach(call2);
|
|
7135
|
+
if (reading) return;
|
|
7136
|
+
destroys.forEach(call2);
|
|
7137
|
+
callback(error2);
|
|
7138
|
+
});
|
|
7139
|
+
});
|
|
7140
|
+
return streams.reduce(pipe);
|
|
7141
|
+
}
|
|
7142
|
+
pipeline_1 = pipeline;
|
|
7143
|
+
return pipeline_1;
|
|
7088
7144
|
}
|
|
7089
|
-
var pipeline_1 = pipeline;
|
|
7090
7145
|
(function(module, exports2) {
|
|
7091
7146
|
exports2 = module.exports = require_stream_readable$1();
|
|
7092
7147
|
exports2.Stream = exports2;
|
|
7093
7148
|
exports2.Readable = exports2;
|
|
7094
7149
|
exports2.Writable = require_stream_writable$1();
|
|
7095
7150
|
exports2.Duplex = require_stream_duplex$1();
|
|
7096
|
-
exports2.Transform =
|
|
7097
|
-
exports2.PassThrough =
|
|
7098
|
-
exports2.finished =
|
|
7099
|
-
exports2.pipeline =
|
|
7151
|
+
exports2.Transform = require_stream_transform();
|
|
7152
|
+
exports2.PassThrough = require_stream_passthrough();
|
|
7153
|
+
exports2.finished = requireEndOfStream();
|
|
7154
|
+
exports2.pipeline = requirePipeline();
|
|
7100
7155
|
})(readableBrowser$1, readableBrowser$1.exports);
|
|
7101
7156
|
var readableBrowserExports$1 = readableBrowser$1.exports;
|
|
7102
7157
|
var Buffer$z = safeBufferExports$1.Buffer;
|
|
@@ -8507,10 +8562,10 @@ inherits$h(Stream, EE);
|
|
|
8507
8562
|
Stream.Readable = require_stream_readable$1();
|
|
8508
8563
|
Stream.Writable = require_stream_writable$1();
|
|
8509
8564
|
Stream.Duplex = require_stream_duplex$1();
|
|
8510
|
-
Stream.Transform =
|
|
8511
|
-
Stream.PassThrough =
|
|
8512
|
-
Stream.finished =
|
|
8513
|
-
Stream.pipeline =
|
|
8565
|
+
Stream.Transform = require_stream_transform();
|
|
8566
|
+
Stream.PassThrough = require_stream_passthrough();
|
|
8567
|
+
Stream.finished = requireEndOfStream();
|
|
8568
|
+
Stream.pipeline = requirePipeline();
|
|
8514
8569
|
Stream.Stream = Stream;
|
|
8515
8570
|
function Stream() {
|
|
8516
8571
|
EE.call(this);
|