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