yves 1.0.90 → 1.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/yves.js +1188 -935
- package/package.json +3 -3
package/dist/yves.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
(function (global){(function (){
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
var objectAssign = require('object
|
|
5
|
+
var objectAssign = require('object.assign/polyfill')();
|
|
6
6
|
|
|
7
7
|
// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
|
|
8
8
|
// original notice:
|
|
@@ -508,7 +508,7 @@ var objectKeys = Object.keys || function (obj) {
|
|
|
508
508
|
};
|
|
509
509
|
|
|
510
510
|
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
511
|
-
},{"object
|
|
511
|
+
},{"object.assign/polyfill":55,"util/":4}],2:[function(require,module,exports){
|
|
512
512
|
if (typeof Object.create === 'function') {
|
|
513
513
|
// implementation from standard node.js 'util' module
|
|
514
514
|
module.exports = function inherits(ctor, superCtor) {
|
|
@@ -1130,7 +1130,7 @@ function hasOwnProperty(obj, prop) {
|
|
|
1130
1130
|
}
|
|
1131
1131
|
|
|
1132
1132
|
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
1133
|
-
},{"./support/isBuffer":3,"_process":
|
|
1133
|
+
},{"./support/isBuffer":3,"_process":58,"inherits":2}],5:[function(require,module,exports){
|
|
1134
1134
|
(function (global){(function (){
|
|
1135
1135
|
'use strict';
|
|
1136
1136
|
|
|
@@ -3098,7 +3098,7 @@ function numberIsNaN (obj) {
|
|
|
3098
3098
|
}
|
|
3099
3099
|
|
|
3100
3100
|
}).call(this)}).call(this,require("buffer").Buffer)
|
|
3101
|
-
},{"base64-js":6,"buffer":9,"ieee754":
|
|
3101
|
+
},{"base64-js":6,"buffer":9,"ieee754":35}],10:[function(require,module,exports){
|
|
3102
3102
|
'use strict';
|
|
3103
3103
|
|
|
3104
3104
|
var GetIntrinsic = require('get-intrinsic');
|
|
@@ -3120,12 +3120,13 @@ module.exports = function callBoundIntrinsic(name, allowMissing) {
|
|
|
3120
3120
|
|
|
3121
3121
|
var bind = require('function-bind');
|
|
3122
3122
|
var GetIntrinsic = require('get-intrinsic');
|
|
3123
|
+
var setFunctionLength = require('set-function-length');
|
|
3123
3124
|
|
|
3125
|
+
var $TypeError = GetIntrinsic('%TypeError%');
|
|
3124
3126
|
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
|
3125
3127
|
var $call = GetIntrinsic('%Function.prototype.call%');
|
|
3126
3128
|
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
|
3127
3129
|
|
|
3128
|
-
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
3129
3130
|
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
|
3130
3131
|
var $max = GetIntrinsic('%Math.max%');
|
|
3131
3132
|
|
|
@@ -3139,19 +3140,15 @@ if ($defineProperty) {
|
|
|
3139
3140
|
}
|
|
3140
3141
|
|
|
3141
3142
|
module.exports = function callBind(originalFunction) {
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
var desc = $gOPD(func, 'length');
|
|
3145
|
-
if (desc.configurable) {
|
|
3146
|
-
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
|
3147
|
-
$defineProperty(
|
|
3148
|
-
func,
|
|
3149
|
-
'length',
|
|
3150
|
-
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
|
3151
|
-
);
|
|
3152
|
-
}
|
|
3143
|
+
if (typeof originalFunction !== 'function') {
|
|
3144
|
+
throw new $TypeError('a function is required');
|
|
3153
3145
|
}
|
|
3154
|
-
|
|
3146
|
+
var func = $reflectApply(bind, $call, arguments);
|
|
3147
|
+
return setFunctionLength(
|
|
3148
|
+
func,
|
|
3149
|
+
1 + $max(0, originalFunction.length - (arguments.length - 1)),
|
|
3150
|
+
true
|
|
3151
|
+
);
|
|
3155
3152
|
};
|
|
3156
3153
|
|
|
3157
3154
|
var applyBind = function applyBind() {
|
|
@@ -3164,7 +3161,7 @@ if ($defineProperty) {
|
|
|
3164
3161
|
module.exports.apply = applyBind;
|
|
3165
3162
|
}
|
|
3166
3163
|
|
|
3167
|
-
},{"function-bind":22,"get-intrinsic":23}],12:[function(require,module,exports){
|
|
3164
|
+
},{"function-bind":22,"get-intrinsic":23,"set-function-length":60}],12:[function(require,module,exports){
|
|
3168
3165
|
module.exports={
|
|
3169
3166
|
"O_RDONLY": 0,
|
|
3170
3167
|
"O_WRONLY": 1,
|
|
@@ -3648,7 +3645,7 @@ formatters.j = function (v) {
|
|
|
3648
3645
|
};
|
|
3649
3646
|
|
|
3650
3647
|
}).call(this)}).call(this,require('_process'))
|
|
3651
|
-
},{"./common":14,"_process":
|
|
3648
|
+
},{"./common":14,"_process":58}],14:[function(require,module,exports){
|
|
3652
3649
|
|
|
3653
3650
|
/**
|
|
3654
3651
|
* This is the common logic for both the Node.js and web browser
|
|
@@ -3924,7 +3921,7 @@ function setup(env) {
|
|
|
3924
3921
|
|
|
3925
3922
|
module.exports = setup;
|
|
3926
3923
|
|
|
3927
|
-
},{"ms":
|
|
3924
|
+
},{"ms":50}],15:[function(require,module,exports){
|
|
3928
3925
|
'use strict';
|
|
3929
3926
|
|
|
3930
3927
|
var isPlainObject = require('is-plain-object');
|
|
@@ -3957,7 +3954,77 @@ function sort(src, comparator) {
|
|
|
3957
3954
|
|
|
3958
3955
|
module.exports = sort;
|
|
3959
3956
|
|
|
3960
|
-
},{"is-plain-object":
|
|
3957
|
+
},{"is-plain-object":41}],16:[function(require,module,exports){
|
|
3958
|
+
'use strict';
|
|
3959
|
+
|
|
3960
|
+
var hasPropertyDescriptors = require('has-property-descriptors')();
|
|
3961
|
+
|
|
3962
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
3963
|
+
|
|
3964
|
+
var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);
|
|
3965
|
+
if ($defineProperty) {
|
|
3966
|
+
try {
|
|
3967
|
+
$defineProperty({}, 'a', { value: 1 });
|
|
3968
|
+
} catch (e) {
|
|
3969
|
+
// IE 8 has a broken defineProperty
|
|
3970
|
+
$defineProperty = false;
|
|
3971
|
+
}
|
|
3972
|
+
}
|
|
3973
|
+
|
|
3974
|
+
var $SyntaxError = GetIntrinsic('%SyntaxError%');
|
|
3975
|
+
var $TypeError = GetIntrinsic('%TypeError%');
|
|
3976
|
+
|
|
3977
|
+
var gopd = require('gopd');
|
|
3978
|
+
|
|
3979
|
+
/** @type {(obj: Record<PropertyKey, unknown>, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */
|
|
3980
|
+
module.exports = function defineDataProperty(
|
|
3981
|
+
obj,
|
|
3982
|
+
property,
|
|
3983
|
+
value
|
|
3984
|
+
) {
|
|
3985
|
+
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
|
3986
|
+
throw new $TypeError('`obj` must be an object or a function`');
|
|
3987
|
+
}
|
|
3988
|
+
if (typeof property !== 'string' && typeof property !== 'symbol') {
|
|
3989
|
+
throw new $TypeError('`property` must be a string or a symbol`');
|
|
3990
|
+
}
|
|
3991
|
+
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
|
3992
|
+
throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
|
|
3993
|
+
}
|
|
3994
|
+
if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
|
|
3995
|
+
throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
|
|
3996
|
+
}
|
|
3997
|
+
if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
|
|
3998
|
+
throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
|
|
3999
|
+
}
|
|
4000
|
+
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
|
|
4001
|
+
throw new $TypeError('`loose`, if provided, must be a boolean');
|
|
4002
|
+
}
|
|
4003
|
+
|
|
4004
|
+
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
|
4005
|
+
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
|
4006
|
+
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
|
4007
|
+
var loose = arguments.length > 6 ? arguments[6] : false;
|
|
4008
|
+
|
|
4009
|
+
/* @type {false | TypedPropertyDescriptor<unknown>} */
|
|
4010
|
+
var desc = !!gopd && gopd(obj, property);
|
|
4011
|
+
|
|
4012
|
+
if ($defineProperty) {
|
|
4013
|
+
$defineProperty(obj, property, {
|
|
4014
|
+
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
|
4015
|
+
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
|
4016
|
+
value: value,
|
|
4017
|
+
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
|
4018
|
+
});
|
|
4019
|
+
} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
|
|
4020
|
+
// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
|
|
4021
|
+
obj[property] = value; // eslint-disable-line no-param-reassign
|
|
4022
|
+
} else {
|
|
4023
|
+
throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
|
|
4024
|
+
}
|
|
4025
|
+
};
|
|
4026
|
+
|
|
4027
|
+
},{"get-intrinsic":23,"gopd":24,"has-property-descriptors":29}],17:[function(require,module,exports){
|
|
3961
4028
|
'use strict';
|
|
3962
4029
|
|
|
3963
4030
|
var util = require('util');
|
|
@@ -4100,24 +4167,7 @@ errorEx.line = function (str, def) {
|
|
|
4100
4167
|
|
|
4101
4168
|
module.exports = errorEx;
|
|
4102
4169
|
|
|
4103
|
-
},{"is-arrayish":
|
|
4104
|
-
'use strict';
|
|
4105
|
-
|
|
4106
|
-
var GetIntrinsic = require('get-intrinsic');
|
|
4107
|
-
|
|
4108
|
-
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
4109
|
-
if ($gOPD) {
|
|
4110
|
-
try {
|
|
4111
|
-
$gOPD([], 'length');
|
|
4112
|
-
} catch (e) {
|
|
4113
|
-
// IE 8 has a broken gOPD
|
|
4114
|
-
$gOPD = null;
|
|
4115
|
-
}
|
|
4116
|
-
}
|
|
4117
|
-
|
|
4118
|
-
module.exports = $gOPD;
|
|
4119
|
-
|
|
4120
|
-
},{"get-intrinsic":23}],18:[function(require,module,exports){
|
|
4170
|
+
},{"is-arrayish":38,"util":82}],18:[function(require,module,exports){
|
|
4121
4171
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
4122
4172
|
//
|
|
4123
4173
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -4848,72 +4898,144 @@ function replaceGetterValues (replacer) {
|
|
|
4848
4898
|
}
|
|
4849
4899
|
|
|
4850
4900
|
},{}],20:[function(require,module,exports){
|
|
4901
|
+
'use strict';
|
|
4851
4902
|
|
|
4852
|
-
var
|
|
4853
|
-
var toString = Object.prototype.toString;
|
|
4903
|
+
var isCallable = require('is-callable');
|
|
4854
4904
|
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4905
|
+
var toStr = Object.prototype.toString;
|
|
4906
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
4907
|
+
|
|
4908
|
+
var forEachArray = function forEachArray(array, iterator, receiver) {
|
|
4909
|
+
for (var i = 0, len = array.length; i < len; i++) {
|
|
4910
|
+
if (hasOwnProperty.call(array, i)) {
|
|
4911
|
+
if (receiver == null) {
|
|
4912
|
+
iterator(array[i], i, array);
|
|
4913
|
+
} else {
|
|
4914
|
+
iterator.call(receiver, array[i], i, array);
|
|
4915
|
+
}
|
|
4916
|
+
}
|
|
4858
4917
|
}
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4918
|
+
};
|
|
4919
|
+
|
|
4920
|
+
var forEachString = function forEachString(string, iterator, receiver) {
|
|
4921
|
+
for (var i = 0, len = string.length; i < len; i++) {
|
|
4922
|
+
// no such thing as a sparse string.
|
|
4923
|
+
if (receiver == null) {
|
|
4924
|
+
iterator(string.charAt(i), i, string);
|
|
4925
|
+
} else {
|
|
4926
|
+
iterator.call(receiver, string.charAt(i), i, string);
|
|
4863
4927
|
}
|
|
4864
|
-
}
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4928
|
+
}
|
|
4929
|
+
};
|
|
4930
|
+
|
|
4931
|
+
var forEachObject = function forEachObject(object, iterator, receiver) {
|
|
4932
|
+
for (var k in object) {
|
|
4933
|
+
if (hasOwnProperty.call(object, k)) {
|
|
4934
|
+
if (receiver == null) {
|
|
4935
|
+
iterator(object[k], k, object);
|
|
4936
|
+
} else {
|
|
4937
|
+
iterator.call(receiver, object[k], k, object);
|
|
4868
4938
|
}
|
|
4869
4939
|
}
|
|
4870
4940
|
}
|
|
4871
4941
|
};
|
|
4872
4942
|
|
|
4943
|
+
var forEach = function forEach(list, iterator, thisArg) {
|
|
4944
|
+
if (!isCallable(iterator)) {
|
|
4945
|
+
throw new TypeError('iterator must be a function');
|
|
4946
|
+
}
|
|
4947
|
+
|
|
4948
|
+
var receiver;
|
|
4949
|
+
if (arguments.length >= 3) {
|
|
4950
|
+
receiver = thisArg;
|
|
4951
|
+
}
|
|
4952
|
+
|
|
4953
|
+
if (toStr.call(list) === '[object Array]') {
|
|
4954
|
+
forEachArray(list, iterator, receiver);
|
|
4955
|
+
} else if (typeof list === 'string') {
|
|
4956
|
+
forEachString(list, iterator, receiver);
|
|
4957
|
+
} else {
|
|
4958
|
+
forEachObject(list, iterator, receiver);
|
|
4959
|
+
}
|
|
4960
|
+
};
|
|
4961
|
+
|
|
4962
|
+
module.exports = forEach;
|
|
4873
4963
|
|
|
4874
|
-
},{}],21:[function(require,module,exports){
|
|
4964
|
+
},{"is-callable":39}],21:[function(require,module,exports){
|
|
4875
4965
|
'use strict';
|
|
4876
4966
|
|
|
4877
4967
|
/* eslint no-invalid-this: 1 */
|
|
4878
4968
|
|
|
4879
4969
|
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
4880
|
-
var slice = Array.prototype.slice;
|
|
4881
4970
|
var toStr = Object.prototype.toString;
|
|
4971
|
+
var max = Math.max;
|
|
4882
4972
|
var funcType = '[object Function]';
|
|
4883
4973
|
|
|
4974
|
+
var concatty = function concatty(a, b) {
|
|
4975
|
+
var arr = [];
|
|
4976
|
+
|
|
4977
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
4978
|
+
arr[i] = a[i];
|
|
4979
|
+
}
|
|
4980
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
4981
|
+
arr[j + a.length] = b[j];
|
|
4982
|
+
}
|
|
4983
|
+
|
|
4984
|
+
return arr;
|
|
4985
|
+
};
|
|
4986
|
+
|
|
4987
|
+
var slicy = function slicy(arrLike, offset) {
|
|
4988
|
+
var arr = [];
|
|
4989
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
4990
|
+
arr[j] = arrLike[i];
|
|
4991
|
+
}
|
|
4992
|
+
return arr;
|
|
4993
|
+
};
|
|
4994
|
+
|
|
4995
|
+
var joiny = function (arr, joiner) {
|
|
4996
|
+
var str = '';
|
|
4997
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
4998
|
+
str += arr[i];
|
|
4999
|
+
if (i + 1 < arr.length) {
|
|
5000
|
+
str += joiner;
|
|
5001
|
+
}
|
|
5002
|
+
}
|
|
5003
|
+
return str;
|
|
5004
|
+
};
|
|
5005
|
+
|
|
4884
5006
|
module.exports = function bind(that) {
|
|
4885
5007
|
var target = this;
|
|
4886
|
-
if (typeof target !== 'function' || toStr.
|
|
5008
|
+
if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
|
|
4887
5009
|
throw new TypeError(ERROR_MESSAGE + target);
|
|
4888
5010
|
}
|
|
4889
|
-
var args =
|
|
5011
|
+
var args = slicy(arguments, 1);
|
|
4890
5012
|
|
|
4891
5013
|
var bound;
|
|
4892
5014
|
var binder = function () {
|
|
4893
5015
|
if (this instanceof bound) {
|
|
4894
5016
|
var result = target.apply(
|
|
4895
5017
|
this,
|
|
4896
|
-
args
|
|
5018
|
+
concatty(args, arguments)
|
|
4897
5019
|
);
|
|
4898
5020
|
if (Object(result) === result) {
|
|
4899
5021
|
return result;
|
|
4900
5022
|
}
|
|
4901
5023
|
return this;
|
|
4902
|
-
} else {
|
|
4903
|
-
return target.apply(
|
|
4904
|
-
that,
|
|
4905
|
-
args.concat(slice.call(arguments))
|
|
4906
|
-
);
|
|
4907
5024
|
}
|
|
5025
|
+
return target.apply(
|
|
5026
|
+
that,
|
|
5027
|
+
concatty(args, arguments)
|
|
5028
|
+
);
|
|
5029
|
+
|
|
4908
5030
|
};
|
|
4909
5031
|
|
|
4910
|
-
var boundLength =
|
|
5032
|
+
var boundLength = max(0, target.length - args.length);
|
|
4911
5033
|
var boundArgs = [];
|
|
4912
5034
|
for (var i = 0; i < boundLength; i++) {
|
|
4913
|
-
boundArgs
|
|
5035
|
+
boundArgs[i] = '$' + i;
|
|
4914
5036
|
}
|
|
4915
5037
|
|
|
4916
|
-
bound = Function('binder', 'return function (' + boundArgs
|
|
5038
|
+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
4917
5039
|
|
|
4918
5040
|
if (target.prototype) {
|
|
4919
5041
|
var Empty = function Empty() {};
|
|
@@ -4978,18 +5100,23 @@ var ThrowTypeError = $gOPD
|
|
|
4978
5100
|
: throwTypeError;
|
|
4979
5101
|
|
|
4980
5102
|
var hasSymbols = require('has-symbols')();
|
|
5103
|
+
var hasProto = require('has-proto')();
|
|
4981
5104
|
|
|
4982
|
-
var getProto = Object.getPrototypeOf ||
|
|
5105
|
+
var getProto = Object.getPrototypeOf || (
|
|
5106
|
+
hasProto
|
|
5107
|
+
? function (x) { return x.__proto__; } // eslint-disable-line no-proto
|
|
5108
|
+
: null
|
|
5109
|
+
);
|
|
4983
5110
|
|
|
4984
5111
|
var needsEval = {};
|
|
4985
5112
|
|
|
4986
|
-
var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
|
|
5113
|
+
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
|
|
4987
5114
|
|
|
4988
5115
|
var INTRINSICS = {
|
|
4989
5116
|
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
|
|
4990
5117
|
'%Array%': Array,
|
|
4991
5118
|
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
|
|
4992
|
-
'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
|
|
5119
|
+
'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
|
|
4993
5120
|
'%AsyncFromSyncIteratorPrototype%': undefined,
|
|
4994
5121
|
'%AsyncFunction%': needsEval,
|
|
4995
5122
|
'%AsyncGenerator%': needsEval,
|
|
@@ -4997,6 +5124,8 @@ var INTRINSICS = {
|
|
|
4997
5124
|
'%AsyncIteratorPrototype%': needsEval,
|
|
4998
5125
|
'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
|
|
4999
5126
|
'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
|
|
5127
|
+
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
|
|
5128
|
+
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
|
|
5000
5129
|
'%Boolean%': Boolean,
|
|
5001
5130
|
'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
|
|
5002
5131
|
'%Date%': Date,
|
|
@@ -5017,10 +5146,10 @@ var INTRINSICS = {
|
|
|
5017
5146
|
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
|
|
5018
5147
|
'%isFinite%': isFinite,
|
|
5019
5148
|
'%isNaN%': isNaN,
|
|
5020
|
-
'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
|
5149
|
+
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
|
5021
5150
|
'%JSON%': typeof JSON === 'object' ? JSON : undefined,
|
|
5022
5151
|
'%Map%': typeof Map === 'undefined' ? undefined : Map,
|
|
5023
|
-
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
|
|
5152
|
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
|
|
5024
5153
|
'%Math%': Math,
|
|
5025
5154
|
'%Number%': Number,
|
|
5026
5155
|
'%Object%': Object,
|
|
@@ -5033,10 +5162,10 @@ var INTRINSICS = {
|
|
|
5033
5162
|
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
|
|
5034
5163
|
'%RegExp%': RegExp,
|
|
5035
5164
|
'%Set%': typeof Set === 'undefined' ? undefined : Set,
|
|
5036
|
-
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
|
|
5165
|
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
|
|
5037
5166
|
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
|
|
5038
5167
|
'%String%': String,
|
|
5039
|
-
'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
|
|
5168
|
+
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
|
|
5040
5169
|
'%Symbol%': hasSymbols ? Symbol : undefined,
|
|
5041
5170
|
'%SyntaxError%': $SyntaxError,
|
|
5042
5171
|
'%ThrowTypeError%': ThrowTypeError,
|
|
@@ -5052,6 +5181,16 @@ var INTRINSICS = {
|
|
|
5052
5181
|
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
|
|
5053
5182
|
};
|
|
5054
5183
|
|
|
5184
|
+
if (getProto) {
|
|
5185
|
+
try {
|
|
5186
|
+
null.error; // eslint-disable-line no-unused-expressions
|
|
5187
|
+
} catch (e) {
|
|
5188
|
+
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
|
|
5189
|
+
var errorProto = getProto(getProto(e));
|
|
5190
|
+
INTRINSICS['%Error.prototype%'] = errorProto;
|
|
5191
|
+
}
|
|
5192
|
+
}
|
|
5193
|
+
|
|
5055
5194
|
var doEval = function doEval(name) {
|
|
5056
5195
|
var value;
|
|
5057
5196
|
if (name === '%AsyncFunction%') {
|
|
@@ -5067,7 +5206,7 @@ var doEval = function doEval(name) {
|
|
|
5067
5206
|
}
|
|
5068
5207
|
} else if (name === '%AsyncIteratorPrototype%') {
|
|
5069
5208
|
var gen = doEval('%AsyncGenerator%');
|
|
5070
|
-
if (gen) {
|
|
5209
|
+
if (gen && getProto) {
|
|
5071
5210
|
value = getProto(gen.prototype);
|
|
5072
5211
|
}
|
|
5073
5212
|
}
|
|
@@ -5137,6 +5276,7 @@ var $concat = bind.call(Function.call, Array.prototype.concat);
|
|
|
5137
5276
|
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
|
5138
5277
|
var $replace = bind.call(Function.call, String.prototype.replace);
|
|
5139
5278
|
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
|
5279
|
+
var $exec = bind.call(Function.call, RegExp.prototype.exec);
|
|
5140
5280
|
|
|
5141
5281
|
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
5142
5282
|
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
@@ -5192,6 +5332,9 @@ module.exports = function GetIntrinsic(name, allowMissing) {
|
|
|
5192
5332
|
throw new $TypeError('"allowMissing" argument must be a boolean');
|
|
5193
5333
|
}
|
|
5194
5334
|
|
|
5335
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
5336
|
+
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
5337
|
+
}
|
|
5195
5338
|
var parts = stringToPath(name);
|
|
5196
5339
|
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
5197
5340
|
|
|
@@ -5264,7 +5407,25 @@ module.exports = function GetIntrinsic(name, allowMissing) {
|
|
|
5264
5407
|
return value;
|
|
5265
5408
|
};
|
|
5266
5409
|
|
|
5267
|
-
},{"function-bind":22,"has":
|
|
5410
|
+
},{"function-bind":22,"has":34,"has-proto":30,"has-symbols":31}],24:[function(require,module,exports){
|
|
5411
|
+
'use strict';
|
|
5412
|
+
|
|
5413
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
5414
|
+
|
|
5415
|
+
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
5416
|
+
|
|
5417
|
+
if ($gOPD) {
|
|
5418
|
+
try {
|
|
5419
|
+
$gOPD([], 'length');
|
|
5420
|
+
} catch (e) {
|
|
5421
|
+
// IE 8 has a broken gOPD
|
|
5422
|
+
$gOPD = null;
|
|
5423
|
+
}
|
|
5424
|
+
}
|
|
5425
|
+
|
|
5426
|
+
module.exports = $gOPD;
|
|
5427
|
+
|
|
5428
|
+
},{"get-intrinsic":23}],25:[function(require,module,exports){
|
|
5268
5429
|
'use strict'
|
|
5269
5430
|
|
|
5270
5431
|
module.exports = clone
|
|
@@ -5289,7 +5450,7 @@ function clone (obj) {
|
|
|
5289
5450
|
return copy
|
|
5290
5451
|
}
|
|
5291
5452
|
|
|
5292
|
-
},{}],
|
|
5453
|
+
},{}],26:[function(require,module,exports){
|
|
5293
5454
|
(function (process,global){(function (){
|
|
5294
5455
|
var fs = require('fs')
|
|
5295
5456
|
var polyfills = require('./polyfills.js')
|
|
@@ -5741,7 +5902,7 @@ function retry () {
|
|
|
5741
5902
|
}
|
|
5742
5903
|
|
|
5743
5904
|
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
5744
|
-
},{"./clone.js":
|
|
5905
|
+
},{"./clone.js":25,"./legacy-streams.js":27,"./polyfills.js":28,"_process":58,"assert":1,"fs":8,"util":82}],27:[function(require,module,exports){
|
|
5745
5906
|
(function (process){(function (){
|
|
5746
5907
|
var Stream = require('stream').Stream
|
|
5747
5908
|
|
|
@@ -5863,7 +6024,7 @@ function legacy (fs) {
|
|
|
5863
6024
|
}
|
|
5864
6025
|
|
|
5865
6026
|
}).call(this)}).call(this,require('_process'))
|
|
5866
|
-
},{"_process":
|
|
6027
|
+
},{"_process":58,"stream":61}],28:[function(require,module,exports){
|
|
5867
6028
|
(function (process){(function (){
|
|
5868
6029
|
var constants = require('constants')
|
|
5869
6030
|
|
|
@@ -5968,7 +6129,7 @@ function patch (fs) {
|
|
|
5968
6129
|
var backoff = 0;
|
|
5969
6130
|
fs$rename(from, to, function CB (er) {
|
|
5970
6131
|
if (er
|
|
5971
|
-
&& (er.code === "EACCES" || er.code === "EPERM")
|
|
6132
|
+
&& (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY")
|
|
5972
6133
|
&& Date.now() - start < 60000) {
|
|
5973
6134
|
setTimeout(function() {
|
|
5974
6135
|
fs.stat(to, function (stater, st) {
|
|
@@ -6222,7 +6383,55 @@ function patch (fs) {
|
|
|
6222
6383
|
}
|
|
6223
6384
|
|
|
6224
6385
|
}).call(this)}).call(this,require('_process'))
|
|
6225
|
-
},{"_process":
|
|
6386
|
+
},{"_process":58,"constants":12}],29:[function(require,module,exports){
|
|
6387
|
+
'use strict';
|
|
6388
|
+
|
|
6389
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
6390
|
+
|
|
6391
|
+
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
|
6392
|
+
|
|
6393
|
+
var hasPropertyDescriptors = function hasPropertyDescriptors() {
|
|
6394
|
+
if ($defineProperty) {
|
|
6395
|
+
try {
|
|
6396
|
+
$defineProperty({}, 'a', { value: 1 });
|
|
6397
|
+
return true;
|
|
6398
|
+
} catch (e) {
|
|
6399
|
+
// IE 8 has a broken defineProperty
|
|
6400
|
+
return false;
|
|
6401
|
+
}
|
|
6402
|
+
}
|
|
6403
|
+
return false;
|
|
6404
|
+
};
|
|
6405
|
+
|
|
6406
|
+
hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
|
6407
|
+
// node v0.6 has a bug where array lengths can be Set but not Defined
|
|
6408
|
+
if (!hasPropertyDescriptors()) {
|
|
6409
|
+
return null;
|
|
6410
|
+
}
|
|
6411
|
+
try {
|
|
6412
|
+
return $defineProperty([], 'length', { value: 1 }).length !== 1;
|
|
6413
|
+
} catch (e) {
|
|
6414
|
+
// In Firefox 4-22, defining length on an array throws an exception.
|
|
6415
|
+
return true;
|
|
6416
|
+
}
|
|
6417
|
+
};
|
|
6418
|
+
|
|
6419
|
+
module.exports = hasPropertyDescriptors;
|
|
6420
|
+
|
|
6421
|
+
},{"get-intrinsic":23}],30:[function(require,module,exports){
|
|
6422
|
+
'use strict';
|
|
6423
|
+
|
|
6424
|
+
var test = {
|
|
6425
|
+
foo: {}
|
|
6426
|
+
};
|
|
6427
|
+
|
|
6428
|
+
var $Object = Object;
|
|
6429
|
+
|
|
6430
|
+
module.exports = function hasProto() {
|
|
6431
|
+
return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
|
|
6432
|
+
};
|
|
6433
|
+
|
|
6434
|
+
},{}],31:[function(require,module,exports){
|
|
6226
6435
|
'use strict';
|
|
6227
6436
|
|
|
6228
6437
|
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
|
@@ -6237,7 +6446,7 @@ module.exports = function hasNativeSymbols() {
|
|
|
6237
6446
|
return hasSymbolSham();
|
|
6238
6447
|
};
|
|
6239
6448
|
|
|
6240
|
-
},{"./shams":
|
|
6449
|
+
},{"./shams":32}],32:[function(require,module,exports){
|
|
6241
6450
|
'use strict';
|
|
6242
6451
|
|
|
6243
6452
|
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
@@ -6281,7 +6490,7 @@ module.exports = function hasSymbols() {
|
|
|
6281
6490
|
return true;
|
|
6282
6491
|
};
|
|
6283
6492
|
|
|
6284
|
-
},{}],
|
|
6493
|
+
},{}],33:[function(require,module,exports){
|
|
6285
6494
|
'use strict';
|
|
6286
6495
|
|
|
6287
6496
|
var hasSymbols = require('has-symbols/shams');
|
|
@@ -6290,14 +6499,17 @@ module.exports = function hasToStringTagShams() {
|
|
|
6290
6499
|
return hasSymbols() && !!Symbol.toStringTag;
|
|
6291
6500
|
};
|
|
6292
6501
|
|
|
6293
|
-
},{"has-symbols/shams":
|
|
6502
|
+
},{"has-symbols/shams":32}],34:[function(require,module,exports){
|
|
6294
6503
|
'use strict';
|
|
6295
6504
|
|
|
6296
|
-
var
|
|
6505
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
|
6506
|
+
var call = Function.prototype.call;
|
|
6297
6507
|
|
|
6298
|
-
module.exports =
|
|
6508
|
+
module.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) {
|
|
6509
|
+
return call.call(hasOwnProperty, O, P);
|
|
6510
|
+
};
|
|
6299
6511
|
|
|
6300
|
-
},{
|
|
6512
|
+
},{}],35:[function(require,module,exports){
|
|
6301
6513
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
6302
6514
|
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
|
|
6303
6515
|
var e, m
|
|
@@ -6384,7 +6596,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
|
|
6384
6596
|
buffer[offset + i - d] |= s * 128
|
|
6385
6597
|
}
|
|
6386
6598
|
|
|
6387
|
-
},{}],
|
|
6599
|
+
},{}],36:[function(require,module,exports){
|
|
6388
6600
|
if (typeof Object.create === 'function') {
|
|
6389
6601
|
// implementation from standard node.js 'util' module
|
|
6390
6602
|
module.exports = function inherits(ctor, superCtor) {
|
|
@@ -6413,7 +6625,7 @@ if (typeof Object.create === 'function') {
|
|
|
6413
6625
|
}
|
|
6414
6626
|
}
|
|
6415
6627
|
|
|
6416
|
-
},{}],
|
|
6628
|
+
},{}],37:[function(require,module,exports){
|
|
6417
6629
|
'use strict';
|
|
6418
6630
|
|
|
6419
6631
|
var hasToStringTag = require('has-tostringtag/shams')();
|
|
@@ -6448,7 +6660,7 @@ isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests
|
|
|
6448
6660
|
|
|
6449
6661
|
module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
|
|
6450
6662
|
|
|
6451
|
-
},{"call-bind/callBound":10,"has-tostringtag/shams":
|
|
6663
|
+
},{"call-bind/callBound":10,"has-tostringtag/shams":33}],38:[function(require,module,exports){
|
|
6452
6664
|
'use strict';
|
|
6453
6665
|
|
|
6454
6666
|
module.exports = function isArrayish(obj) {
|
|
@@ -6460,7 +6672,110 @@ module.exports = function isArrayish(obj) {
|
|
|
6460
6672
|
(obj.length >= 0 && obj.splice instanceof Function);
|
|
6461
6673
|
};
|
|
6462
6674
|
|
|
6463
|
-
},{}],
|
|
6675
|
+
},{}],39:[function(require,module,exports){
|
|
6676
|
+
'use strict';
|
|
6677
|
+
|
|
6678
|
+
var fnToStr = Function.prototype.toString;
|
|
6679
|
+
var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
|
|
6680
|
+
var badArrayLike;
|
|
6681
|
+
var isCallableMarker;
|
|
6682
|
+
if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
|
|
6683
|
+
try {
|
|
6684
|
+
badArrayLike = Object.defineProperty({}, 'length', {
|
|
6685
|
+
get: function () {
|
|
6686
|
+
throw isCallableMarker;
|
|
6687
|
+
}
|
|
6688
|
+
});
|
|
6689
|
+
isCallableMarker = {};
|
|
6690
|
+
// eslint-disable-next-line no-throw-literal
|
|
6691
|
+
reflectApply(function () { throw 42; }, null, badArrayLike);
|
|
6692
|
+
} catch (_) {
|
|
6693
|
+
if (_ !== isCallableMarker) {
|
|
6694
|
+
reflectApply = null;
|
|
6695
|
+
}
|
|
6696
|
+
}
|
|
6697
|
+
} else {
|
|
6698
|
+
reflectApply = null;
|
|
6699
|
+
}
|
|
6700
|
+
|
|
6701
|
+
var constructorRegex = /^\s*class\b/;
|
|
6702
|
+
var isES6ClassFn = function isES6ClassFunction(value) {
|
|
6703
|
+
try {
|
|
6704
|
+
var fnStr = fnToStr.call(value);
|
|
6705
|
+
return constructorRegex.test(fnStr);
|
|
6706
|
+
} catch (e) {
|
|
6707
|
+
return false; // not a function
|
|
6708
|
+
}
|
|
6709
|
+
};
|
|
6710
|
+
|
|
6711
|
+
var tryFunctionObject = function tryFunctionToStr(value) {
|
|
6712
|
+
try {
|
|
6713
|
+
if (isES6ClassFn(value)) { return false; }
|
|
6714
|
+
fnToStr.call(value);
|
|
6715
|
+
return true;
|
|
6716
|
+
} catch (e) {
|
|
6717
|
+
return false;
|
|
6718
|
+
}
|
|
6719
|
+
};
|
|
6720
|
+
var toStr = Object.prototype.toString;
|
|
6721
|
+
var objectClass = '[object Object]';
|
|
6722
|
+
var fnClass = '[object Function]';
|
|
6723
|
+
var genClass = '[object GeneratorFunction]';
|
|
6724
|
+
var ddaClass = '[object HTMLAllCollection]'; // IE 11
|
|
6725
|
+
var ddaClass2 = '[object HTML document.all class]';
|
|
6726
|
+
var ddaClass3 = '[object HTMLCollection]'; // IE 9-10
|
|
6727
|
+
var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`
|
|
6728
|
+
|
|
6729
|
+
var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing
|
|
6730
|
+
|
|
6731
|
+
var isDDA = function isDocumentDotAll() { return false; };
|
|
6732
|
+
if (typeof document === 'object') {
|
|
6733
|
+
// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly
|
|
6734
|
+
var all = document.all;
|
|
6735
|
+
if (toStr.call(all) === toStr.call(document.all)) {
|
|
6736
|
+
isDDA = function isDocumentDotAll(value) {
|
|
6737
|
+
/* globals document: false */
|
|
6738
|
+
// in IE 6-8, typeof document.all is "object" and it's truthy
|
|
6739
|
+
if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {
|
|
6740
|
+
try {
|
|
6741
|
+
var str = toStr.call(value);
|
|
6742
|
+
return (
|
|
6743
|
+
str === ddaClass
|
|
6744
|
+
|| str === ddaClass2
|
|
6745
|
+
|| str === ddaClass3 // opera 12.16
|
|
6746
|
+
|| str === objectClass // IE 6-8
|
|
6747
|
+
) && value('') == null; // eslint-disable-line eqeqeq
|
|
6748
|
+
} catch (e) { /**/ }
|
|
6749
|
+
}
|
|
6750
|
+
return false;
|
|
6751
|
+
};
|
|
6752
|
+
}
|
|
6753
|
+
}
|
|
6754
|
+
|
|
6755
|
+
module.exports = reflectApply
|
|
6756
|
+
? function isCallable(value) {
|
|
6757
|
+
if (isDDA(value)) { return true; }
|
|
6758
|
+
if (!value) { return false; }
|
|
6759
|
+
if (typeof value !== 'function' && typeof value !== 'object') { return false; }
|
|
6760
|
+
try {
|
|
6761
|
+
reflectApply(value, null, badArrayLike);
|
|
6762
|
+
} catch (e) {
|
|
6763
|
+
if (e !== isCallableMarker) { return false; }
|
|
6764
|
+
}
|
|
6765
|
+
return !isES6ClassFn(value) && tryFunctionObject(value);
|
|
6766
|
+
}
|
|
6767
|
+
: function isCallable(value) {
|
|
6768
|
+
if (isDDA(value)) { return true; }
|
|
6769
|
+
if (!value) { return false; }
|
|
6770
|
+
if (typeof value !== 'function' && typeof value !== 'object') { return false; }
|
|
6771
|
+
if (hasToStringTag) { return tryFunctionObject(value); }
|
|
6772
|
+
if (isES6ClassFn(value)) { return false; }
|
|
6773
|
+
var strClass = toStr.call(value);
|
|
6774
|
+
if (strClass !== fnClass && strClass !== genClass && !(/^\[object HTML/).test(strClass)) { return false; }
|
|
6775
|
+
return tryFunctionObject(value);
|
|
6776
|
+
};
|
|
6777
|
+
|
|
6778
|
+
},{}],40:[function(require,module,exports){
|
|
6464
6779
|
'use strict';
|
|
6465
6780
|
|
|
6466
6781
|
var toStr = Object.prototype.toString;
|
|
@@ -6500,7 +6815,7 @@ module.exports = function isGeneratorFunction(fn) {
|
|
|
6500
6815
|
return getProto(fn) === GeneratorFunction;
|
|
6501
6816
|
};
|
|
6502
6817
|
|
|
6503
|
-
},{"has-tostringtag/shams":
|
|
6818
|
+
},{"has-tostringtag/shams":33}],41:[function(require,module,exports){
|
|
6504
6819
|
/*!
|
|
6505
6820
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
6506
6821
|
*
|
|
@@ -6539,71 +6854,16 @@ module.exports = function isPlainObject(o) {
|
|
|
6539
6854
|
return true;
|
|
6540
6855
|
};
|
|
6541
6856
|
|
|
6542
|
-
},{"isobject":
|
|
6543
|
-
(function (global){(function (){
|
|
6857
|
+
},{"isobject":43}],42:[function(require,module,exports){
|
|
6544
6858
|
'use strict';
|
|
6545
6859
|
|
|
6546
|
-
var
|
|
6547
|
-
var availableTypedArrays = require('available-typed-arrays');
|
|
6548
|
-
var callBound = require('call-bind/callBound');
|
|
6549
|
-
|
|
6550
|
-
var $toString = callBound('Object.prototype.toString');
|
|
6551
|
-
var hasToStringTag = require('has-tostringtag/shams')();
|
|
6552
|
-
|
|
6553
|
-
var g = typeof globalThis === 'undefined' ? global : globalThis;
|
|
6554
|
-
var typedArrays = availableTypedArrays();
|
|
6555
|
-
|
|
6556
|
-
var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {
|
|
6557
|
-
for (var i = 0; i < array.length; i += 1) {
|
|
6558
|
-
if (array[i] === value) {
|
|
6559
|
-
return i;
|
|
6560
|
-
}
|
|
6561
|
-
}
|
|
6562
|
-
return -1;
|
|
6563
|
-
};
|
|
6564
|
-
var $slice = callBound('String.prototype.slice');
|
|
6565
|
-
var toStrTags = {};
|
|
6566
|
-
var gOPD = require('es-abstract/helpers/getOwnPropertyDescriptor');
|
|
6567
|
-
var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');
|
|
6568
|
-
if (hasToStringTag && gOPD && getPrototypeOf) {
|
|
6569
|
-
forEach(typedArrays, function (typedArray) {
|
|
6570
|
-
var arr = new g[typedArray]();
|
|
6571
|
-
if (Symbol.toStringTag in arr) {
|
|
6572
|
-
var proto = getPrototypeOf(arr);
|
|
6573
|
-
var descriptor = gOPD(proto, Symbol.toStringTag);
|
|
6574
|
-
if (!descriptor) {
|
|
6575
|
-
var superProto = getPrototypeOf(proto);
|
|
6576
|
-
descriptor = gOPD(superProto, Symbol.toStringTag);
|
|
6577
|
-
}
|
|
6578
|
-
toStrTags[typedArray] = descriptor.get;
|
|
6579
|
-
}
|
|
6580
|
-
});
|
|
6581
|
-
}
|
|
6582
|
-
|
|
6583
|
-
var tryTypedArrays = function tryAllTypedArrays(value) {
|
|
6584
|
-
var anyTrue = false;
|
|
6585
|
-
forEach(toStrTags, function (getter, typedArray) {
|
|
6586
|
-
if (!anyTrue) {
|
|
6587
|
-
try {
|
|
6588
|
-
anyTrue = getter.call(value) === typedArray;
|
|
6589
|
-
} catch (e) { /**/ }
|
|
6590
|
-
}
|
|
6591
|
-
});
|
|
6592
|
-
return anyTrue;
|
|
6593
|
-
};
|
|
6860
|
+
var whichTypedArray = require('which-typed-array');
|
|
6594
6861
|
|
|
6595
6862
|
module.exports = function isTypedArray(value) {
|
|
6596
|
-
|
|
6597
|
-
if (!hasToStringTag || !(Symbol.toStringTag in value)) {
|
|
6598
|
-
var tag = $slice($toString(value), 8, -1);
|
|
6599
|
-
return $indexOf(typedArrays, tag) > -1;
|
|
6600
|
-
}
|
|
6601
|
-
if (!gOPD) { return false; }
|
|
6602
|
-
return tryTypedArrays(value);
|
|
6863
|
+
return !!whichTypedArray(value);
|
|
6603
6864
|
};
|
|
6604
6865
|
|
|
6605
|
-
}
|
|
6606
|
-
},{"available-typed-arrays":5,"call-bind/callBound":10,"es-abstract/helpers/getOwnPropertyDescriptor":17,"foreach":20,"has-tostringtag/shams":30}],39:[function(require,module,exports){
|
|
6866
|
+
},{"which-typed-array":83}],43:[function(require,module,exports){
|
|
6607
6867
|
/*!
|
|
6608
6868
|
* isobject <https://github.com/jonschlinkert/isobject>
|
|
6609
6869
|
*
|
|
@@ -6617,7 +6877,7 @@ module.exports = function isObject(val) {
|
|
|
6617
6877
|
return val != null && typeof val === 'object' && Array.isArray(val) === false;
|
|
6618
6878
|
};
|
|
6619
6879
|
|
|
6620
|
-
},{}],
|
|
6880
|
+
},{}],44:[function(require,module,exports){
|
|
6621
6881
|
'use strict'
|
|
6622
6882
|
|
|
6623
6883
|
module.exports = parseJson
|
|
@@ -6657,13 +6917,13 @@ function parseJson (txt, reviver, context) {
|
|
|
6657
6917
|
}
|
|
6658
6918
|
}
|
|
6659
6919
|
|
|
6660
|
-
},{}],
|
|
6920
|
+
},{}],45:[function(require,module,exports){
|
|
6661
6921
|
var jsonc = require('./lib/jsonc').jsonc;
|
|
6662
6922
|
module.exports = jsonc;
|
|
6663
6923
|
// adding circular ref to allow easy importing in both ES5/6 and TS projects
|
|
6664
6924
|
module.exports.jsonc = jsonc;
|
|
6665
6925
|
module.exports.safe = jsonc.safe;
|
|
6666
|
-
},{"./lib/jsonc":
|
|
6926
|
+
},{"./lib/jsonc":47}],46:[function(require,module,exports){
|
|
6667
6927
|
"use strict";
|
|
6668
6928
|
var __assign = (this && this.__assign) || function () {
|
|
6669
6929
|
__assign = Object.assign || function(t) {
|
|
@@ -6783,7 +7043,7 @@ var helper = {
|
|
|
6783
7043
|
};
|
|
6784
7044
|
exports.helper = helper;
|
|
6785
7045
|
|
|
6786
|
-
},{"fast-safe-stringify":19,"graceful-fs":
|
|
7046
|
+
},{"fast-safe-stringify":19,"graceful-fs":26,"mkdirp":49}],47:[function(require,module,exports){
|
|
6787
7047
|
(function (process){(function (){
|
|
6788
7048
|
"use strict";
|
|
6789
7049
|
|
|
@@ -7429,7 +7689,7 @@ jsonc.config(null);
|
|
|
7429
7689
|
exports.jsonc = jsonc;
|
|
7430
7690
|
|
|
7431
7691
|
}).call(this)}).call(this,require('_process'))
|
|
7432
|
-
},{"./helper":
|
|
7692
|
+
},{"./helper":46,"./jsonc.safe":48,"_process":58,"fast-safe-stringify":19,"parse-json":56,"path":57,"strip-bom":77,"strip-json-comments":78}],48:[function(require,module,exports){
|
|
7433
7693
|
"use strict";
|
|
7434
7694
|
|
|
7435
7695
|
/* tslint:disable:class-name no-require-imports no-default-export max-line-length interface-name max-classes-per-file max-file-line-count */
|
|
@@ -7901,7 +8161,7 @@ var jsoncSafe = /** @class */function () {
|
|
|
7901
8161
|
}();
|
|
7902
8162
|
exports.jsoncSafe = jsoncSafe;
|
|
7903
8163
|
|
|
7904
|
-
},{"./helper":
|
|
8164
|
+
},{"./helper":46,"./jsonc":47,"fast-safe-stringify":19,"strip-json-comments":78}],49:[function(require,module,exports){
|
|
7905
8165
|
var path = require('path');
|
|
7906
8166
|
var fs = require('fs');
|
|
7907
8167
|
var _0777 = parseInt('0777', 8);
|
|
@@ -8005,7 +8265,7 @@ mkdirP.sync = function sync (p, opts, made) {
|
|
|
8005
8265
|
return made;
|
|
8006
8266
|
};
|
|
8007
8267
|
|
|
8008
|
-
},{"fs":8,"path":
|
|
8268
|
+
},{"fs":8,"path":57}],50:[function(require,module,exports){
|
|
8009
8269
|
/**
|
|
8010
8270
|
* Helpers.
|
|
8011
8271
|
*/
|
|
@@ -8169,99 +8429,289 @@ function plural(ms, msAbs, n, name) {
|
|
|
8169
8429
|
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
8170
8430
|
}
|
|
8171
8431
|
|
|
8172
|
-
},{}],
|
|
8173
|
-
/*
|
|
8174
|
-
object-assign
|
|
8175
|
-
(c) Sindre Sorhus
|
|
8176
|
-
@license MIT
|
|
8177
|
-
*/
|
|
8178
|
-
|
|
8432
|
+
},{}],51:[function(require,module,exports){
|
|
8179
8433
|
'use strict';
|
|
8180
|
-
/* eslint-disable no-unused-vars */
|
|
8181
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
8182
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
8183
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
8184
8434
|
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
function
|
|
8194
|
-
|
|
8195
|
-
|
|
8435
|
+
var keysShim;
|
|
8436
|
+
if (!Object.keys) {
|
|
8437
|
+
// modified from https://github.com/es-shims/es5-shim
|
|
8438
|
+
var has = Object.prototype.hasOwnProperty;
|
|
8439
|
+
var toStr = Object.prototype.toString;
|
|
8440
|
+
var isArgs = require('./isArguments'); // eslint-disable-line global-require
|
|
8441
|
+
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
8442
|
+
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
|
|
8443
|
+
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
|
|
8444
|
+
var dontEnums = [
|
|
8445
|
+
'toString',
|
|
8446
|
+
'toLocaleString',
|
|
8447
|
+
'valueOf',
|
|
8448
|
+
'hasOwnProperty',
|
|
8449
|
+
'isPrototypeOf',
|
|
8450
|
+
'propertyIsEnumerable',
|
|
8451
|
+
'constructor'
|
|
8452
|
+
];
|
|
8453
|
+
var equalsConstructorPrototype = function (o) {
|
|
8454
|
+
var ctor = o.constructor;
|
|
8455
|
+
return ctor && ctor.prototype === o;
|
|
8456
|
+
};
|
|
8457
|
+
var excludedKeys = {
|
|
8458
|
+
$applicationCache: true,
|
|
8459
|
+
$console: true,
|
|
8460
|
+
$external: true,
|
|
8461
|
+
$frame: true,
|
|
8462
|
+
$frameElement: true,
|
|
8463
|
+
$frames: true,
|
|
8464
|
+
$innerHeight: true,
|
|
8465
|
+
$innerWidth: true,
|
|
8466
|
+
$onmozfullscreenchange: true,
|
|
8467
|
+
$onmozfullscreenerror: true,
|
|
8468
|
+
$outerHeight: true,
|
|
8469
|
+
$outerWidth: true,
|
|
8470
|
+
$pageXOffset: true,
|
|
8471
|
+
$pageYOffset: true,
|
|
8472
|
+
$parent: true,
|
|
8473
|
+
$scrollLeft: true,
|
|
8474
|
+
$scrollTop: true,
|
|
8475
|
+
$scrollX: true,
|
|
8476
|
+
$scrollY: true,
|
|
8477
|
+
$self: true,
|
|
8478
|
+
$webkitIndexedDB: true,
|
|
8479
|
+
$webkitStorageInfo: true,
|
|
8480
|
+
$window: true
|
|
8481
|
+
};
|
|
8482
|
+
var hasAutomationEqualityBug = (function () {
|
|
8483
|
+
/* global window */
|
|
8484
|
+
if (typeof window === 'undefined') { return false; }
|
|
8485
|
+
for (var k in window) {
|
|
8486
|
+
try {
|
|
8487
|
+
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
|
|
8488
|
+
try {
|
|
8489
|
+
equalsConstructorPrototype(window[k]);
|
|
8490
|
+
} catch (e) {
|
|
8491
|
+
return true;
|
|
8492
|
+
}
|
|
8493
|
+
}
|
|
8494
|
+
} catch (e) {
|
|
8495
|
+
return true;
|
|
8496
|
+
}
|
|
8497
|
+
}
|
|
8498
|
+
return false;
|
|
8499
|
+
}());
|
|
8500
|
+
var equalsConstructorPrototypeIfNotBuggy = function (o) {
|
|
8501
|
+
/* global window */
|
|
8502
|
+
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
|
|
8503
|
+
return equalsConstructorPrototype(o);
|
|
8504
|
+
}
|
|
8505
|
+
try {
|
|
8506
|
+
return equalsConstructorPrototype(o);
|
|
8507
|
+
} catch (e) {
|
|
8196
8508
|
return false;
|
|
8197
8509
|
}
|
|
8510
|
+
};
|
|
8198
8511
|
|
|
8199
|
-
|
|
8512
|
+
keysShim = function keys(object) {
|
|
8513
|
+
var isObject = object !== null && typeof object === 'object';
|
|
8514
|
+
var isFunction = toStr.call(object) === '[object Function]';
|
|
8515
|
+
var isArguments = isArgs(object);
|
|
8516
|
+
var isString = isObject && toStr.call(object) === '[object String]';
|
|
8517
|
+
var theKeys = [];
|
|
8200
8518
|
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
test1[5] = 'de';
|
|
8204
|
-
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
8205
|
-
return false;
|
|
8519
|
+
if (!isObject && !isFunction && !isArguments) {
|
|
8520
|
+
throw new TypeError('Object.keys called on a non-object');
|
|
8206
8521
|
}
|
|
8207
8522
|
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8523
|
+
var skipProto = hasProtoEnumBug && isFunction;
|
|
8524
|
+
if (isString && object.length > 0 && !has.call(object, 0)) {
|
|
8525
|
+
for (var i = 0; i < object.length; ++i) {
|
|
8526
|
+
theKeys.push(String(i));
|
|
8527
|
+
}
|
|
8212
8528
|
}
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8529
|
+
|
|
8530
|
+
if (isArguments && object.length > 0) {
|
|
8531
|
+
for (var j = 0; j < object.length; ++j) {
|
|
8532
|
+
theKeys.push(String(j));
|
|
8533
|
+
}
|
|
8534
|
+
} else {
|
|
8535
|
+
for (var name in object) {
|
|
8536
|
+
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
|
|
8537
|
+
theKeys.push(String(name));
|
|
8538
|
+
}
|
|
8539
|
+
}
|
|
8218
8540
|
}
|
|
8219
8541
|
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8542
|
+
if (hasDontEnumBug) {
|
|
8543
|
+
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
|
|
8544
|
+
|
|
8545
|
+
for (var k = 0; k < dontEnums.length; ++k) {
|
|
8546
|
+
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
|
|
8547
|
+
theKeys.push(dontEnums[k]);
|
|
8548
|
+
}
|
|
8549
|
+
}
|
|
8228
8550
|
}
|
|
8551
|
+
return theKeys;
|
|
8552
|
+
};
|
|
8553
|
+
}
|
|
8554
|
+
module.exports = keysShim;
|
|
8229
8555
|
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8556
|
+
},{"./isArguments":53}],52:[function(require,module,exports){
|
|
8557
|
+
'use strict';
|
|
8558
|
+
|
|
8559
|
+
var slice = Array.prototype.slice;
|
|
8560
|
+
var isArgs = require('./isArguments');
|
|
8561
|
+
|
|
8562
|
+
var origKeys = Object.keys;
|
|
8563
|
+
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');
|
|
8564
|
+
|
|
8565
|
+
var originalKeys = Object.keys;
|
|
8566
|
+
|
|
8567
|
+
keysShim.shim = function shimObjectKeys() {
|
|
8568
|
+
if (Object.keys) {
|
|
8569
|
+
var keysWorksWithArguments = (function () {
|
|
8570
|
+
// Safari 5.0 bug
|
|
8571
|
+
var args = Object.keys(arguments);
|
|
8572
|
+
return args && args.length === arguments.length;
|
|
8573
|
+
}(1, 2));
|
|
8574
|
+
if (!keysWorksWithArguments) {
|
|
8575
|
+
Object.keys = function keys(object) { // eslint-disable-line func-name-matching
|
|
8576
|
+
if (isArgs(object)) {
|
|
8577
|
+
return originalKeys(slice.call(object));
|
|
8578
|
+
}
|
|
8579
|
+
return originalKeys(object);
|
|
8580
|
+
};
|
|
8581
|
+
}
|
|
8582
|
+
} else {
|
|
8583
|
+
Object.keys = keysShim;
|
|
8234
8584
|
}
|
|
8235
|
-
|
|
8585
|
+
return Object.keys || keysShim;
|
|
8586
|
+
};
|
|
8587
|
+
|
|
8588
|
+
module.exports = keysShim;
|
|
8589
|
+
|
|
8590
|
+
},{"./implementation":51,"./isArguments":53}],53:[function(require,module,exports){
|
|
8591
|
+
'use strict';
|
|
8592
|
+
|
|
8593
|
+
var toStr = Object.prototype.toString;
|
|
8236
8594
|
|
|
8237
|
-
module.exports =
|
|
8238
|
-
var
|
|
8239
|
-
var
|
|
8240
|
-
|
|
8595
|
+
module.exports = function isArguments(value) {
|
|
8596
|
+
var str = toStr.call(value);
|
|
8597
|
+
var isArgs = str === '[object Arguments]';
|
|
8598
|
+
if (!isArgs) {
|
|
8599
|
+
isArgs = str !== '[object Array]' &&
|
|
8600
|
+
value !== null &&
|
|
8601
|
+
typeof value === 'object' &&
|
|
8602
|
+
typeof value.length === 'number' &&
|
|
8603
|
+
value.length >= 0 &&
|
|
8604
|
+
toStr.call(value.callee) === '[object Function]';
|
|
8605
|
+
}
|
|
8606
|
+
return isArgs;
|
|
8607
|
+
};
|
|
8241
8608
|
|
|
8242
|
-
|
|
8243
|
-
|
|
8609
|
+
},{}],54:[function(require,module,exports){
|
|
8610
|
+
'use strict';
|
|
8244
8611
|
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8612
|
+
// modified from https://github.com/es-shims/es6-shim
|
|
8613
|
+
var objectKeys = require('object-keys');
|
|
8614
|
+
var hasSymbols = require('has-symbols/shams')();
|
|
8615
|
+
var callBound = require('call-bind/callBound');
|
|
8616
|
+
var toObject = Object;
|
|
8617
|
+
var $push = callBound('Array.prototype.push');
|
|
8618
|
+
var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
|
|
8619
|
+
var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;
|
|
8620
|
+
|
|
8621
|
+
// eslint-disable-next-line no-unused-vars
|
|
8622
|
+
module.exports = function assign(target, source1) {
|
|
8623
|
+
if (target == null) { throw new TypeError('target must be an object'); }
|
|
8624
|
+
var to = toObject(target); // step 1
|
|
8625
|
+
if (arguments.length === 1) {
|
|
8626
|
+
return to; // step 2
|
|
8627
|
+
}
|
|
8628
|
+
for (var s = 1; s < arguments.length; ++s) {
|
|
8629
|
+
var from = toObject(arguments[s]); // step 3.a.i
|
|
8630
|
+
|
|
8631
|
+
// step 3.a.ii:
|
|
8632
|
+
var keys = objectKeys(from);
|
|
8633
|
+
var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
|
|
8634
|
+
if (getSymbols) {
|
|
8635
|
+
var syms = getSymbols(from);
|
|
8636
|
+
for (var j = 0; j < syms.length; ++j) {
|
|
8637
|
+
var key = syms[j];
|
|
8638
|
+
if ($propIsEnumerable(from, key)) {
|
|
8639
|
+
$push(keys, key);
|
|
8640
|
+
}
|
|
8248
8641
|
}
|
|
8249
8642
|
}
|
|
8250
8643
|
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
|
|
8644
|
+
// step 3.a.iii:
|
|
8645
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
8646
|
+
var nextKey = keys[i];
|
|
8647
|
+
if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2
|
|
8648
|
+
var propValue = from[nextKey]; // step 3.a.iii.2.a
|
|
8649
|
+
to[nextKey] = propValue; // step 3.a.iii.2.b
|
|
8257
8650
|
}
|
|
8258
8651
|
}
|
|
8259
8652
|
}
|
|
8260
8653
|
|
|
8261
|
-
return to;
|
|
8654
|
+
return to; // step 4
|
|
8655
|
+
};
|
|
8656
|
+
|
|
8657
|
+
},{"call-bind/callBound":10,"has-symbols/shams":32,"object-keys":52}],55:[function(require,module,exports){
|
|
8658
|
+
'use strict';
|
|
8659
|
+
|
|
8660
|
+
var implementation = require('./implementation');
|
|
8661
|
+
|
|
8662
|
+
var lacksProperEnumerationOrder = function () {
|
|
8663
|
+
if (!Object.assign) {
|
|
8664
|
+
return false;
|
|
8665
|
+
}
|
|
8666
|
+
/*
|
|
8667
|
+
* v8, specifically in node 4.x, has a bug with incorrect property enumeration order
|
|
8668
|
+
* note: this does not detect the bug unless there's 20 characters
|
|
8669
|
+
*/
|
|
8670
|
+
var str = 'abcdefghijklmnopqrst';
|
|
8671
|
+
var letters = str.split('');
|
|
8672
|
+
var map = {};
|
|
8673
|
+
for (var i = 0; i < letters.length; ++i) {
|
|
8674
|
+
map[letters[i]] = letters[i];
|
|
8675
|
+
}
|
|
8676
|
+
var obj = Object.assign({}, map);
|
|
8677
|
+
var actual = '';
|
|
8678
|
+
for (var k in obj) {
|
|
8679
|
+
actual += k;
|
|
8680
|
+
}
|
|
8681
|
+
return str !== actual;
|
|
8682
|
+
};
|
|
8683
|
+
|
|
8684
|
+
var assignHasPendingExceptions = function () {
|
|
8685
|
+
if (!Object.assign || !Object.preventExtensions) {
|
|
8686
|
+
return false;
|
|
8687
|
+
}
|
|
8688
|
+
/*
|
|
8689
|
+
* Firefox 37 still has "pending exception" logic in its Object.assign implementation,
|
|
8690
|
+
* which is 72% slower than our shim, and Firefox 40's native implementation.
|
|
8691
|
+
*/
|
|
8692
|
+
var thrower = Object.preventExtensions({ 1: 2 });
|
|
8693
|
+
try {
|
|
8694
|
+
Object.assign(thrower, 'xy');
|
|
8695
|
+
} catch (e) {
|
|
8696
|
+
return thrower[1] === 'y';
|
|
8697
|
+
}
|
|
8698
|
+
return false;
|
|
8699
|
+
};
|
|
8700
|
+
|
|
8701
|
+
module.exports = function getPolyfill() {
|
|
8702
|
+
if (!Object.assign) {
|
|
8703
|
+
return implementation;
|
|
8704
|
+
}
|
|
8705
|
+
if (lacksProperEnumerationOrder()) {
|
|
8706
|
+
return implementation;
|
|
8707
|
+
}
|
|
8708
|
+
if (assignHasPendingExceptions()) {
|
|
8709
|
+
return implementation;
|
|
8710
|
+
}
|
|
8711
|
+
return Object.assign;
|
|
8262
8712
|
};
|
|
8263
8713
|
|
|
8264
|
-
},{}],
|
|
8714
|
+
},{"./implementation":54}],56:[function(require,module,exports){
|
|
8265
8715
|
'use strict';
|
|
8266
8716
|
const errorEx = require('error-ex');
|
|
8267
8717
|
const fallback = require('json-parse-better-errors');
|
|
@@ -8296,7 +8746,7 @@ module.exports = (input, reviver, filename) => {
|
|
|
8296
8746
|
}
|
|
8297
8747
|
};
|
|
8298
8748
|
|
|
8299
|
-
},{"error-ex":
|
|
8749
|
+
},{"error-ex":17,"json-parse-better-errors":44}],57:[function(require,module,exports){
|
|
8300
8750
|
(function (process){(function (){
|
|
8301
8751
|
// 'path' module extracted from Node.js v8.11.1 (only the posix part)
|
|
8302
8752
|
// transplited with Babel
|
|
@@ -8829,7 +9279,7 @@ posix.posix = posix;
|
|
|
8829
9279
|
module.exports = posix;
|
|
8830
9280
|
|
|
8831
9281
|
}).call(this)}).call(this,require('_process'))
|
|
8832
|
-
},{"_process":
|
|
9282
|
+
},{"_process":58}],58:[function(require,module,exports){
|
|
8833
9283
|
// shim for using process in browser
|
|
8834
9284
|
var process = module.exports = {};
|
|
8835
9285
|
|
|
@@ -9015,7 +9465,7 @@ process.chdir = function (dir) {
|
|
|
9015
9465
|
};
|
|
9016
9466
|
process.umask = function() { return 0; };
|
|
9017
9467
|
|
|
9018
|
-
},{}],
|
|
9468
|
+
},{}],59:[function(require,module,exports){
|
|
9019
9469
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
9020
9470
|
/* eslint-disable node/no-deprecated-api */
|
|
9021
9471
|
var buffer = require('buffer')
|
|
@@ -9082,7 +9532,50 @@ SafeBuffer.allocUnsafeSlow = function (size) {
|
|
|
9082
9532
|
return buffer.SlowBuffer(size)
|
|
9083
9533
|
}
|
|
9084
9534
|
|
|
9085
|
-
},{"buffer":9}],
|
|
9535
|
+
},{"buffer":9}],60:[function(require,module,exports){
|
|
9536
|
+
'use strict';
|
|
9537
|
+
|
|
9538
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
9539
|
+
var define = require('define-data-property');
|
|
9540
|
+
var hasDescriptors = require('has-property-descriptors')();
|
|
9541
|
+
var gOPD = require('gopd');
|
|
9542
|
+
|
|
9543
|
+
var $TypeError = GetIntrinsic('%TypeError%');
|
|
9544
|
+
var $floor = GetIntrinsic('%Math.floor%');
|
|
9545
|
+
|
|
9546
|
+
module.exports = function setFunctionLength(fn, length) {
|
|
9547
|
+
if (typeof fn !== 'function') {
|
|
9548
|
+
throw new $TypeError('`fn` is not a function');
|
|
9549
|
+
}
|
|
9550
|
+
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
|
|
9551
|
+
throw new $TypeError('`length` must be a positive 32-bit integer');
|
|
9552
|
+
}
|
|
9553
|
+
|
|
9554
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
|
9555
|
+
|
|
9556
|
+
var functionLengthIsConfigurable = true;
|
|
9557
|
+
var functionLengthIsWritable = true;
|
|
9558
|
+
if ('length' in fn && gOPD) {
|
|
9559
|
+
var desc = gOPD(fn, 'length');
|
|
9560
|
+
if (desc && !desc.configurable) {
|
|
9561
|
+
functionLengthIsConfigurable = false;
|
|
9562
|
+
}
|
|
9563
|
+
if (desc && !desc.writable) {
|
|
9564
|
+
functionLengthIsWritable = false;
|
|
9565
|
+
}
|
|
9566
|
+
}
|
|
9567
|
+
|
|
9568
|
+
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
9569
|
+
if (hasDescriptors) {
|
|
9570
|
+
define(fn, 'length', length, true, true);
|
|
9571
|
+
} else {
|
|
9572
|
+
define(fn, 'length', length);
|
|
9573
|
+
}
|
|
9574
|
+
}
|
|
9575
|
+
return fn;
|
|
9576
|
+
};
|
|
9577
|
+
|
|
9578
|
+
},{"define-data-property":16,"get-intrinsic":23,"gopd":24,"has-property-descriptors":29}],61:[function(require,module,exports){
|
|
9086
9579
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
9087
9580
|
//
|
|
9088
9581
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -9213,7 +9706,7 @@ Stream.prototype.pipe = function(dest, options) {
|
|
|
9213
9706
|
return dest;
|
|
9214
9707
|
};
|
|
9215
9708
|
|
|
9216
|
-
},{"events":18,"inherits":
|
|
9709
|
+
},{"events":18,"inherits":36,"readable-stream/lib/_stream_duplex.js":63,"readable-stream/lib/_stream_passthrough.js":64,"readable-stream/lib/_stream_readable.js":65,"readable-stream/lib/_stream_transform.js":66,"readable-stream/lib/_stream_writable.js":67,"readable-stream/lib/internal/streams/end-of-stream.js":71,"readable-stream/lib/internal/streams/pipeline.js":73}],62:[function(require,module,exports){
|
|
9217
9710
|
'use strict';
|
|
9218
9711
|
|
|
9219
9712
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
@@ -9342,7 +9835,7 @@ createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
|
|
|
9342
9835
|
createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
|
|
9343
9836
|
module.exports.codes = codes;
|
|
9344
9837
|
|
|
9345
|
-
},{}],
|
|
9838
|
+
},{}],63:[function(require,module,exports){
|
|
9346
9839
|
(function (process){(function (){
|
|
9347
9840
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
9348
9841
|
//
|
|
@@ -9364,60 +9857,48 @@ module.exports.codes = codes;
|
|
|
9364
9857
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
9365
9858
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
9366
9859
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
9860
|
+
|
|
9367
9861
|
// a duplex stream is just a stream that is both readable and writable.
|
|
9368
9862
|
// Since JS doesn't have multiple prototypal inheritance, this class
|
|
9369
9863
|
// prototypally inherits from Readable, and then parasitically from
|
|
9370
9864
|
// Writable.
|
|
9865
|
+
|
|
9371
9866
|
'use strict';
|
|
9372
|
-
/*<replacement>*/
|
|
9373
9867
|
|
|
9868
|
+
/*<replacement>*/
|
|
9374
9869
|
var objectKeys = Object.keys || function (obj) {
|
|
9375
9870
|
var keys = [];
|
|
9376
|
-
|
|
9377
|
-
for (var key in obj) {
|
|
9378
|
-
keys.push(key);
|
|
9379
|
-
}
|
|
9380
|
-
|
|
9871
|
+
for (var key in obj) keys.push(key);
|
|
9381
9872
|
return keys;
|
|
9382
9873
|
};
|
|
9383
9874
|
/*</replacement>*/
|
|
9384
9875
|
|
|
9385
|
-
|
|
9386
9876
|
module.exports = Duplex;
|
|
9387
|
-
|
|
9388
9877
|
var Readable = require('./_stream_readable');
|
|
9389
|
-
|
|
9390
9878
|
var Writable = require('./_stream_writable');
|
|
9391
|
-
|
|
9392
9879
|
require('inherits')(Duplex, Readable);
|
|
9393
|
-
|
|
9394
9880
|
{
|
|
9395
9881
|
// Allow the keys array to be GC'ed.
|
|
9396
9882
|
var keys = objectKeys(Writable.prototype);
|
|
9397
|
-
|
|
9398
9883
|
for (var v = 0; v < keys.length; v++) {
|
|
9399
9884
|
var method = keys[v];
|
|
9400
9885
|
if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
|
|
9401
9886
|
}
|
|
9402
9887
|
}
|
|
9403
|
-
|
|
9404
9888
|
function Duplex(options) {
|
|
9405
9889
|
if (!(this instanceof Duplex)) return new Duplex(options);
|
|
9406
9890
|
Readable.call(this, options);
|
|
9407
9891
|
Writable.call(this, options);
|
|
9408
9892
|
this.allowHalfOpen = true;
|
|
9409
|
-
|
|
9410
9893
|
if (options) {
|
|
9411
9894
|
if (options.readable === false) this.readable = false;
|
|
9412
9895
|
if (options.writable === false) this.writable = false;
|
|
9413
|
-
|
|
9414
9896
|
if (options.allowHalfOpen === false) {
|
|
9415
9897
|
this.allowHalfOpen = false;
|
|
9416
9898
|
this.once('end', onend);
|
|
9417
9899
|
}
|
|
9418
9900
|
}
|
|
9419
9901
|
}
|
|
9420
|
-
|
|
9421
9902
|
Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
|
|
9422
9903
|
// making it explicit this property is not enumerable
|
|
9423
9904
|
// because otherwise some prototype manipulation in
|
|
@@ -9444,20 +9925,20 @@ Object.defineProperty(Duplex.prototype, 'writableLength', {
|
|
|
9444
9925
|
get: function get() {
|
|
9445
9926
|
return this._writableState.length;
|
|
9446
9927
|
}
|
|
9447
|
-
});
|
|
9928
|
+
});
|
|
9448
9929
|
|
|
9930
|
+
// the no-half-open enforcer
|
|
9449
9931
|
function onend() {
|
|
9450
9932
|
// If the writable side ended, then we're ok.
|
|
9451
|
-
if (this._writableState.ended) return;
|
|
9452
|
-
// But allow more writes to happen in this tick.
|
|
9933
|
+
if (this._writableState.ended) return;
|
|
9453
9934
|
|
|
9935
|
+
// no more data can be written.
|
|
9936
|
+
// But allow more writes to happen in this tick.
|
|
9454
9937
|
process.nextTick(onEndNT, this);
|
|
9455
9938
|
}
|
|
9456
|
-
|
|
9457
9939
|
function onEndNT(self) {
|
|
9458
9940
|
self.end();
|
|
9459
9941
|
}
|
|
9460
|
-
|
|
9461
9942
|
Object.defineProperty(Duplex.prototype, 'destroyed', {
|
|
9462
9943
|
// making it explicit this property is not enumerable
|
|
9463
9944
|
// because otherwise some prototype manipulation in
|
|
@@ -9467,7 +9948,6 @@ Object.defineProperty(Duplex.prototype, 'destroyed', {
|
|
|
9467
9948
|
if (this._readableState === undefined || this._writableState === undefined) {
|
|
9468
9949
|
return false;
|
|
9469
9950
|
}
|
|
9470
|
-
|
|
9471
9951
|
return this._readableState.destroyed && this._writableState.destroyed;
|
|
9472
9952
|
},
|
|
9473
9953
|
set: function set(value) {
|
|
@@ -9475,16 +9955,16 @@ Object.defineProperty(Duplex.prototype, 'destroyed', {
|
|
|
9475
9955
|
// has not been initialized yet
|
|
9476
9956
|
if (this._readableState === undefined || this._writableState === undefined) {
|
|
9477
9957
|
return;
|
|
9478
|
-
}
|
|
9479
|
-
// managing destroyed
|
|
9480
|
-
|
|
9958
|
+
}
|
|
9481
9959
|
|
|
9960
|
+
// backward compatibility, the user is explicitly
|
|
9961
|
+
// managing destroyed
|
|
9482
9962
|
this._readableState.destroyed = value;
|
|
9483
9963
|
this._writableState.destroyed = value;
|
|
9484
9964
|
}
|
|
9485
9965
|
});
|
|
9486
9966
|
}).call(this)}).call(this,require('_process'))
|
|
9487
|
-
},{"./_stream_readable":
|
|
9967
|
+
},{"./_stream_readable":65,"./_stream_writable":67,"_process":58,"inherits":36}],64:[function(require,module,exports){
|
|
9488
9968
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
9489
9969
|
//
|
|
9490
9970
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -9505,26 +9985,24 @@ Object.defineProperty(Duplex.prototype, 'destroyed', {
|
|
|
9505
9985
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
9506
9986
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
9507
9987
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
9988
|
+
|
|
9508
9989
|
// a passthrough stream.
|
|
9509
9990
|
// basically just the most minimal sort of Transform stream.
|
|
9510
9991
|
// Every written chunk gets output as-is.
|
|
9992
|
+
|
|
9511
9993
|
'use strict';
|
|
9512
9994
|
|
|
9513
9995
|
module.exports = PassThrough;
|
|
9514
|
-
|
|
9515
9996
|
var Transform = require('./_stream_transform');
|
|
9516
|
-
|
|
9517
9997
|
require('inherits')(PassThrough, Transform);
|
|
9518
|
-
|
|
9519
9998
|
function PassThrough(options) {
|
|
9520
9999
|
if (!(this instanceof PassThrough)) return new PassThrough(options);
|
|
9521
10000
|
Transform.call(this, options);
|
|
9522
10001
|
}
|
|
9523
|
-
|
|
9524
10002
|
PassThrough.prototype._transform = function (chunk, encoding, cb) {
|
|
9525
10003
|
cb(null, chunk);
|
|
9526
10004
|
};
|
|
9527
|
-
},{"./_stream_transform":
|
|
10005
|
+
},{"./_stream_transform":66,"inherits":36}],65:[function(require,module,exports){
|
|
9528
10006
|
(function (process,global){(function (){
|
|
9529
10007
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
9530
10008
|
//
|
|
@@ -9546,49 +10024,40 @@ PassThrough.prototype._transform = function (chunk, encoding, cb) {
|
|
|
9546
10024
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
9547
10025
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
9548
10026
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
10027
|
+
|
|
9549
10028
|
'use strict';
|
|
9550
10029
|
|
|
9551
10030
|
module.exports = Readable;
|
|
9552
|
-
/*<replacement>*/
|
|
9553
10031
|
|
|
10032
|
+
/*<replacement>*/
|
|
9554
10033
|
var Duplex;
|
|
9555
10034
|
/*</replacement>*/
|
|
9556
10035
|
|
|
9557
10036
|
Readable.ReadableState = ReadableState;
|
|
9558
|
-
/*<replacement>*/
|
|
9559
10037
|
|
|
10038
|
+
/*<replacement>*/
|
|
9560
10039
|
var EE = require('events').EventEmitter;
|
|
9561
|
-
|
|
9562
10040
|
var EElistenerCount = function EElistenerCount(emitter, type) {
|
|
9563
10041
|
return emitter.listeners(type).length;
|
|
9564
10042
|
};
|
|
9565
10043
|
/*</replacement>*/
|
|
9566
10044
|
|
|
9567
10045
|
/*<replacement>*/
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
10046
|
var Stream = require('./internal/streams/stream');
|
|
9571
10047
|
/*</replacement>*/
|
|
9572
10048
|
|
|
9573
|
-
|
|
9574
10049
|
var Buffer = require('buffer').Buffer;
|
|
9575
|
-
|
|
9576
|
-
var OurUint8Array = global.Uint8Array || function () {};
|
|
9577
|
-
|
|
10050
|
+
var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
|
|
9578
10051
|
function _uint8ArrayToBuffer(chunk) {
|
|
9579
10052
|
return Buffer.from(chunk);
|
|
9580
10053
|
}
|
|
9581
|
-
|
|
9582
10054
|
function _isUint8Array(obj) {
|
|
9583
10055
|
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
9584
10056
|
}
|
|
9585
|
-
/*<replacement>*/
|
|
9586
|
-
|
|
9587
10057
|
|
|
10058
|
+
/*<replacement>*/
|
|
9588
10059
|
var debugUtil = require('util');
|
|
9589
|
-
|
|
9590
10060
|
var debug;
|
|
9591
|
-
|
|
9592
10061
|
if (debugUtil && debugUtil.debuglog) {
|
|
9593
10062
|
debug = debugUtil.debuglog('stream');
|
|
9594
10063
|
} else {
|
|
@@ -9596,60 +10065,57 @@ if (debugUtil && debugUtil.debuglog) {
|
|
|
9596
10065
|
}
|
|
9597
10066
|
/*</replacement>*/
|
|
9598
10067
|
|
|
9599
|
-
|
|
9600
10068
|
var BufferList = require('./internal/streams/buffer_list');
|
|
9601
|
-
|
|
9602
10069
|
var destroyImpl = require('./internal/streams/destroy');
|
|
9603
|
-
|
|
9604
10070
|
var _require = require('./internal/streams/state'),
|
|
9605
|
-
|
|
9606
|
-
|
|
10071
|
+
getHighWaterMark = _require.getHighWaterMark;
|
|
9607
10072
|
var _require$codes = require('../errors').codes,
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
10073
|
+
ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
|
|
10074
|
+
ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
|
|
10075
|
+
ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
|
|
10076
|
+
ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
|
|
9613
10077
|
|
|
10078
|
+
// Lazy loaded to improve the startup performance.
|
|
9614
10079
|
var StringDecoder;
|
|
9615
10080
|
var createReadableStreamAsyncIterator;
|
|
9616
10081
|
var from;
|
|
9617
|
-
|
|
9618
10082
|
require('inherits')(Readable, Stream);
|
|
9619
|
-
|
|
9620
10083
|
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
9621
10084
|
var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
|
|
9622
|
-
|
|
9623
10085
|
function prependListener(emitter, event, fn) {
|
|
9624
10086
|
// Sadly this is not cacheable as some libraries bundle their own
|
|
9625
10087
|
// event emitter implementation with them.
|
|
9626
|
-
if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
|
|
10088
|
+
if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
|
|
10089
|
+
|
|
10090
|
+
// This is a hack to make sure that our error handler is attached before any
|
|
9627
10091
|
// userland ones. NEVER DO THIS. This is here only because this code needs
|
|
9628
10092
|
// to continue to work with older versions of Node.js that do not include
|
|
9629
10093
|
// the prependListener() method. The goal is to eventually remove this hack.
|
|
9630
|
-
|
|
9631
10094
|
if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
|
|
9632
10095
|
}
|
|
9633
|
-
|
|
9634
10096
|
function ReadableState(options, stream, isDuplex) {
|
|
9635
10097
|
Duplex = Duplex || require('./_stream_duplex');
|
|
9636
|
-
options = options || {};
|
|
10098
|
+
options = options || {};
|
|
10099
|
+
|
|
10100
|
+
// Duplex streams are both readable and writable, but share
|
|
9637
10101
|
// the same options object.
|
|
9638
10102
|
// However, some cases require setting options to different
|
|
9639
10103
|
// values for the readable and the writable sides of the duplex stream.
|
|
9640
10104
|
// These options can be provided separately as readableXXX and writableXXX.
|
|
10105
|
+
if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;
|
|
9641
10106
|
|
|
9642
|
-
|
|
10107
|
+
// object stream flag. Used to make read(n) ignore n and to
|
|
9643
10108
|
// make all the buffer merging and length checks go away
|
|
9644
|
-
|
|
9645
10109
|
this.objectMode = !!options.objectMode;
|
|
9646
|
-
if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
|
|
10110
|
+
if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
|
|
10111
|
+
|
|
10112
|
+
// the point at which it stops calling _read() to fill the buffer
|
|
9647
10113
|
// Note: 0 is a valid value, means "don't call _read preemptively ever"
|
|
10114
|
+
this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex);
|
|
9648
10115
|
|
|
9649
|
-
|
|
10116
|
+
// A linked list is used to store data chunks instead of an array because the
|
|
9650
10117
|
// linked list can remove elements from the beginning faster than
|
|
9651
10118
|
// array.shift()
|
|
9652
|
-
|
|
9653
10119
|
this.buffer = new BufferList();
|
|
9654
10120
|
this.length = 0;
|
|
9655
10121
|
this.pipes = null;
|
|
@@ -9657,61 +10123,66 @@ function ReadableState(options, stream, isDuplex) {
|
|
|
9657
10123
|
this.flowing = null;
|
|
9658
10124
|
this.ended = false;
|
|
9659
10125
|
this.endEmitted = false;
|
|
9660
|
-
this.reading = false;
|
|
10126
|
+
this.reading = false;
|
|
10127
|
+
|
|
10128
|
+
// a flag to be able to tell if the event 'readable'/'data' is emitted
|
|
9661
10129
|
// immediately, or on a later tick. We set this to true at first, because
|
|
9662
10130
|
// any actions that shouldn't happen until "later" should generally also
|
|
9663
10131
|
// not happen before the first read call.
|
|
10132
|
+
this.sync = true;
|
|
9664
10133
|
|
|
9665
|
-
|
|
10134
|
+
// whenever we return null, then we set a flag to say
|
|
9666
10135
|
// that we're awaiting a 'readable' event emission.
|
|
9667
|
-
|
|
9668
10136
|
this.needReadable = false;
|
|
9669
10137
|
this.emittedReadable = false;
|
|
9670
10138
|
this.readableListening = false;
|
|
9671
10139
|
this.resumeScheduled = false;
|
|
9672
|
-
this.paused = true;
|
|
10140
|
+
this.paused = true;
|
|
10141
|
+
|
|
10142
|
+
// Should close be emitted on destroy. Defaults to true.
|
|
10143
|
+
this.emitClose = options.emitClose !== false;
|
|
9673
10144
|
|
|
9674
|
-
|
|
10145
|
+
// Should .destroy() be called after 'end' (and potentially 'finish')
|
|
10146
|
+
this.autoDestroy = !!options.autoDestroy;
|
|
9675
10147
|
|
|
9676
|
-
|
|
10148
|
+
// has it been destroyed
|
|
10149
|
+
this.destroyed = false;
|
|
9677
10150
|
|
|
9678
|
-
|
|
10151
|
+
// Crypto is kind of old and crusty. Historically, its default string
|
|
9679
10152
|
// encoding is 'binary' so we have to make this configurable.
|
|
9680
10153
|
// Everything else in the universe uses 'utf8', though.
|
|
10154
|
+
this.defaultEncoding = options.defaultEncoding || 'utf8';
|
|
9681
10155
|
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled
|
|
10156
|
+
// the number of writers that are awaiting a drain event in .pipe()s
|
|
10157
|
+
this.awaitDrain = 0;
|
|
9685
10158
|
|
|
10159
|
+
// if true, a maybeReadMore has been scheduled
|
|
9686
10160
|
this.readingMore = false;
|
|
9687
10161
|
this.decoder = null;
|
|
9688
10162
|
this.encoding = null;
|
|
9689
|
-
|
|
9690
10163
|
if (options.encoding) {
|
|
9691
10164
|
if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
|
|
9692
10165
|
this.decoder = new StringDecoder(options.encoding);
|
|
9693
10166
|
this.encoding = options.encoding;
|
|
9694
10167
|
}
|
|
9695
10168
|
}
|
|
9696
|
-
|
|
9697
10169
|
function Readable(options) {
|
|
9698
10170
|
Duplex = Duplex || require('./_stream_duplex');
|
|
9699
|
-
if (!(this instanceof Readable)) return new Readable(options);
|
|
9700
|
-
// the ReadableState constructor, at least with V8 6.5
|
|
10171
|
+
if (!(this instanceof Readable)) return new Readable(options);
|
|
9701
10172
|
|
|
10173
|
+
// Checking for a Stream.Duplex instance is faster here instead of inside
|
|
10174
|
+
// the ReadableState constructor, at least with V8 6.5
|
|
9702
10175
|
var isDuplex = this instanceof Duplex;
|
|
9703
|
-
this._readableState = new ReadableState(options, this, isDuplex);
|
|
10176
|
+
this._readableState = new ReadableState(options, this, isDuplex);
|
|
9704
10177
|
|
|
10178
|
+
// legacy
|
|
9705
10179
|
this.readable = true;
|
|
9706
|
-
|
|
9707
10180
|
if (options) {
|
|
9708
10181
|
if (typeof options.read === 'function') this._read = options.read;
|
|
9709
10182
|
if (typeof options.destroy === 'function') this._destroy = options.destroy;
|
|
9710
10183
|
}
|
|
9711
|
-
|
|
9712
10184
|
Stream.call(this);
|
|
9713
10185
|
}
|
|
9714
|
-
|
|
9715
10186
|
Object.defineProperty(Readable.prototype, 'destroyed', {
|
|
9716
10187
|
// making it explicit this property is not enumerable
|
|
9717
10188
|
// because otherwise some prototype manipulation in
|
|
@@ -9721,7 +10192,6 @@ Object.defineProperty(Readable.prototype, 'destroyed', {
|
|
|
9721
10192
|
if (this._readableState === undefined) {
|
|
9722
10193
|
return false;
|
|
9723
10194
|
}
|
|
9724
|
-
|
|
9725
10195
|
return this._readableState.destroyed;
|
|
9726
10196
|
},
|
|
9727
10197
|
set: function set(value) {
|
|
@@ -9729,69 +10199,60 @@ Object.defineProperty(Readable.prototype, 'destroyed', {
|
|
|
9729
10199
|
// has not been initialized yet
|
|
9730
10200
|
if (!this._readableState) {
|
|
9731
10201
|
return;
|
|
9732
|
-
}
|
|
9733
|
-
// managing destroyed
|
|
9734
|
-
|
|
10202
|
+
}
|
|
9735
10203
|
|
|
10204
|
+
// backward compatibility, the user is explicitly
|
|
10205
|
+
// managing destroyed
|
|
9736
10206
|
this._readableState.destroyed = value;
|
|
9737
10207
|
}
|
|
9738
10208
|
});
|
|
9739
10209
|
Readable.prototype.destroy = destroyImpl.destroy;
|
|
9740
10210
|
Readable.prototype._undestroy = destroyImpl.undestroy;
|
|
9741
|
-
|
|
9742
10211
|
Readable.prototype._destroy = function (err, cb) {
|
|
9743
10212
|
cb(err);
|
|
9744
|
-
};
|
|
10213
|
+
};
|
|
10214
|
+
|
|
10215
|
+
// Manually shove something into the read() buffer.
|
|
9745
10216
|
// This returns true if the highWaterMark has not been hit yet,
|
|
9746
10217
|
// similar to how Writable.write() returns true if you should
|
|
9747
10218
|
// write() some more.
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
10219
|
Readable.prototype.push = function (chunk, encoding) {
|
|
9751
10220
|
var state = this._readableState;
|
|
9752
10221
|
var skipChunkCheck;
|
|
9753
|
-
|
|
9754
10222
|
if (!state.objectMode) {
|
|
9755
10223
|
if (typeof chunk === 'string') {
|
|
9756
10224
|
encoding = encoding || state.defaultEncoding;
|
|
9757
|
-
|
|
9758
10225
|
if (encoding !== state.encoding) {
|
|
9759
10226
|
chunk = Buffer.from(chunk, encoding);
|
|
9760
10227
|
encoding = '';
|
|
9761
10228
|
}
|
|
9762
|
-
|
|
9763
10229
|
skipChunkCheck = true;
|
|
9764
10230
|
}
|
|
9765
10231
|
} else {
|
|
9766
10232
|
skipChunkCheck = true;
|
|
9767
10233
|
}
|
|
9768
|
-
|
|
9769
10234
|
return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
|
|
9770
|
-
};
|
|
9771
|
-
|
|
10235
|
+
};
|
|
9772
10236
|
|
|
10237
|
+
// Unshift should *always* be something directly out of read()
|
|
9773
10238
|
Readable.prototype.unshift = function (chunk) {
|
|
9774
10239
|
return readableAddChunk(this, chunk, null, true, false);
|
|
9775
10240
|
};
|
|
9776
|
-
|
|
9777
10241
|
function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
|
|
9778
10242
|
debug('readableAddChunk', chunk);
|
|
9779
10243
|
var state = stream._readableState;
|
|
9780
|
-
|
|
9781
10244
|
if (chunk === null) {
|
|
9782
10245
|
state.reading = false;
|
|
9783
10246
|
onEofChunk(stream, state);
|
|
9784
10247
|
} else {
|
|
9785
10248
|
var er;
|
|
9786
10249
|
if (!skipChunkCheck) er = chunkInvalid(state, chunk);
|
|
9787
|
-
|
|
9788
10250
|
if (er) {
|
|
9789
10251
|
errorOrDestroy(stream, er);
|
|
9790
10252
|
} else if (state.objectMode || chunk && chunk.length > 0) {
|
|
9791
10253
|
if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
|
|
9792
10254
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
9793
10255
|
}
|
|
9794
|
-
|
|
9795
10256
|
if (addToFront) {
|
|
9796
10257
|
if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);
|
|
9797
10258
|
} else if (state.ended) {
|
|
@@ -9800,7 +10261,6 @@ function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
|
|
|
9800
10261
|
return false;
|
|
9801
10262
|
} else {
|
|
9802
10263
|
state.reading = false;
|
|
9803
|
-
|
|
9804
10264
|
if (state.decoder && !encoding) {
|
|
9805
10265
|
chunk = state.decoder.write(chunk);
|
|
9806
10266
|
if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
|
|
@@ -9812,14 +10272,13 @@ function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
|
|
|
9812
10272
|
state.reading = false;
|
|
9813
10273
|
maybeReadMore(stream, state);
|
|
9814
10274
|
}
|
|
9815
|
-
}
|
|
10275
|
+
}
|
|
10276
|
+
|
|
10277
|
+
// We can push more data if we are below the highWaterMark.
|
|
9816
10278
|
// Also, if we have no data yet, we can stand some more bytes.
|
|
9817
10279
|
// This is to work around cases where hwm=0, such as the repl.
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
10280
|
return !state.ended && (state.length < state.highWaterMark || state.length === 0);
|
|
9821
10281
|
}
|
|
9822
|
-
|
|
9823
10282
|
function addChunk(stream, state, chunk, addToFront) {
|
|
9824
10283
|
if (state.flowing && state.length === 0 && !state.sync) {
|
|
9825
10284
|
state.awaitDrain = 0;
|
|
@@ -9830,50 +10289,42 @@ function addChunk(stream, state, chunk, addToFront) {
|
|
|
9830
10289
|
if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
|
|
9831
10290
|
if (state.needReadable) emitReadable(stream);
|
|
9832
10291
|
}
|
|
9833
|
-
|
|
9834
10292
|
maybeReadMore(stream, state);
|
|
9835
10293
|
}
|
|
9836
|
-
|
|
9837
10294
|
function chunkInvalid(state, chunk) {
|
|
9838
10295
|
var er;
|
|
9839
|
-
|
|
9840
10296
|
if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
|
|
9841
10297
|
er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);
|
|
9842
10298
|
}
|
|
9843
|
-
|
|
9844
10299
|
return er;
|
|
9845
10300
|
}
|
|
9846
|
-
|
|
9847
10301
|
Readable.prototype.isPaused = function () {
|
|
9848
10302
|
return this._readableState.flowing === false;
|
|
9849
|
-
};
|
|
9850
|
-
|
|
10303
|
+
};
|
|
9851
10304
|
|
|
10305
|
+
// backwards compatibility.
|
|
9852
10306
|
Readable.prototype.setEncoding = function (enc) {
|
|
9853
10307
|
if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
|
|
9854
10308
|
var decoder = new StringDecoder(enc);
|
|
9855
|
-
this._readableState.decoder = decoder;
|
|
9856
|
-
|
|
9857
|
-
this._readableState.encoding = this._readableState.decoder.encoding;
|
|
10309
|
+
this._readableState.decoder = decoder;
|
|
10310
|
+
// If setEncoding(null), decoder.encoding equals utf8
|
|
10311
|
+
this._readableState.encoding = this._readableState.decoder.encoding;
|
|
9858
10312
|
|
|
10313
|
+
// Iterate over current buffer to convert already stored Buffers:
|
|
9859
10314
|
var p = this._readableState.buffer.head;
|
|
9860
10315
|
var content = '';
|
|
9861
|
-
|
|
9862
10316
|
while (p !== null) {
|
|
9863
10317
|
content += decoder.write(p.data);
|
|
9864
10318
|
p = p.next;
|
|
9865
10319
|
}
|
|
9866
|
-
|
|
9867
10320
|
this._readableState.buffer.clear();
|
|
9868
|
-
|
|
9869
10321
|
if (content !== '') this._readableState.buffer.push(content);
|
|
9870
10322
|
this._readableState.length = content.length;
|
|
9871
10323
|
return this;
|
|
9872
|
-
};
|
|
9873
|
-
|
|
10324
|
+
};
|
|
9874
10325
|
|
|
10326
|
+
// Don't raise the hwm > 1GB
|
|
9875
10327
|
var MAX_HWM = 0x40000000;
|
|
9876
|
-
|
|
9877
10328
|
function computeNewHighWaterMark(n) {
|
|
9878
10329
|
if (n >= MAX_HWM) {
|
|
9879
10330
|
// TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.
|
|
@@ -9889,55 +10340,54 @@ function computeNewHighWaterMark(n) {
|
|
|
9889
10340
|
n |= n >>> 16;
|
|
9890
10341
|
n++;
|
|
9891
10342
|
}
|
|
9892
|
-
|
|
9893
10343
|
return n;
|
|
9894
|
-
}
|
|
9895
|
-
// changes to the function body.
|
|
9896
|
-
|
|
10344
|
+
}
|
|
9897
10345
|
|
|
10346
|
+
// This function is designed to be inlinable, so please take care when making
|
|
10347
|
+
// changes to the function body.
|
|
9898
10348
|
function howMuchToRead(n, state) {
|
|
9899
10349
|
if (n <= 0 || state.length === 0 && state.ended) return 0;
|
|
9900
10350
|
if (state.objectMode) return 1;
|
|
9901
|
-
|
|
9902
10351
|
if (n !== n) {
|
|
9903
10352
|
// Only flow one buffer at a time
|
|
9904
10353
|
if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
|
|
9905
|
-
}
|
|
9906
|
-
|
|
9907
|
-
|
|
10354
|
+
}
|
|
10355
|
+
// If we're asking for more than the current hwm, then raise the hwm.
|
|
9908
10356
|
if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
|
|
9909
|
-
if (n <= state.length) return n;
|
|
9910
|
-
|
|
10357
|
+
if (n <= state.length) return n;
|
|
10358
|
+
// Don't have enough
|
|
9911
10359
|
if (!state.ended) {
|
|
9912
10360
|
state.needReadable = true;
|
|
9913
10361
|
return 0;
|
|
9914
10362
|
}
|
|
9915
|
-
|
|
9916
10363
|
return state.length;
|
|
9917
|
-
}
|
|
9918
|
-
|
|
10364
|
+
}
|
|
9919
10365
|
|
|
10366
|
+
// you can override either this method, or the async _read(n) below.
|
|
9920
10367
|
Readable.prototype.read = function (n) {
|
|
9921
10368
|
debug('read', n);
|
|
9922
10369
|
n = parseInt(n, 10);
|
|
9923
10370
|
var state = this._readableState;
|
|
9924
10371
|
var nOrig = n;
|
|
9925
|
-
if (n !== 0) state.emittedReadable = false;
|
|
10372
|
+
if (n !== 0) state.emittedReadable = false;
|
|
10373
|
+
|
|
10374
|
+
// if we're doing read(0) to trigger a readable event, but we
|
|
9926
10375
|
// already have a bunch of data in the buffer, then just trigger
|
|
9927
10376
|
// the 'readable' event and move on.
|
|
9928
|
-
|
|
9929
10377
|
if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
|
|
9930
10378
|
debug('read: emitReadable', state.length, state.ended);
|
|
9931
10379
|
if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
|
|
9932
10380
|
return null;
|
|
9933
10381
|
}
|
|
10382
|
+
n = howMuchToRead(n, state);
|
|
9934
10383
|
|
|
9935
|
-
|
|
9936
|
-
|
|
10384
|
+
// if we've ended, and we're now clear, then finish it up.
|
|
9937
10385
|
if (n === 0 && state.ended) {
|
|
9938
10386
|
if (state.length === 0) endReadable(this);
|
|
9939
10387
|
return null;
|
|
9940
|
-
}
|
|
10388
|
+
}
|
|
10389
|
+
|
|
10390
|
+
// All the actual chunk generation logic needs to be
|
|
9941
10391
|
// *below* the call to _read. The reason is that in certain
|
|
9942
10392
|
// synthetic stream cases, such as passthrough streams, _read
|
|
9943
10393
|
// may be a completely synchronous operation which may change
|
|
@@ -9958,40 +10408,37 @@ Readable.prototype.read = function (n) {
|
|
|
9958
10408
|
// 'readable' etc.
|
|
9959
10409
|
//
|
|
9960
10410
|
// 3. Actually pull the requested chunks out of the buffer and return.
|
|
9961
|
-
// if we need a readable event, then we need to do some reading.
|
|
9962
|
-
|
|
9963
10411
|
|
|
10412
|
+
// if we need a readable event, then we need to do some reading.
|
|
9964
10413
|
var doRead = state.needReadable;
|
|
9965
|
-
debug('need readable', doRead);
|
|
10414
|
+
debug('need readable', doRead);
|
|
9966
10415
|
|
|
10416
|
+
// if we currently have less than the highWaterMark, then also read some
|
|
9967
10417
|
if (state.length === 0 || state.length - n < state.highWaterMark) {
|
|
9968
10418
|
doRead = true;
|
|
9969
10419
|
debug('length less than watermark', doRead);
|
|
9970
|
-
}
|
|
9971
|
-
// reading, then it's unnecessary.
|
|
9972
|
-
|
|
10420
|
+
}
|
|
9973
10421
|
|
|
10422
|
+
// however, if we've ended, then there's no point, and if we're already
|
|
10423
|
+
// reading, then it's unnecessary.
|
|
9974
10424
|
if (state.ended || state.reading) {
|
|
9975
10425
|
doRead = false;
|
|
9976
10426
|
debug('reading or ended', doRead);
|
|
9977
10427
|
} else if (doRead) {
|
|
9978
10428
|
debug('do read');
|
|
9979
10429
|
state.reading = true;
|
|
9980
|
-
state.sync = true;
|
|
9981
|
-
|
|
9982
|
-
if (state.length === 0) state.needReadable = true;
|
|
9983
|
-
|
|
10430
|
+
state.sync = true;
|
|
10431
|
+
// if the length is currently zero, then we *need* a readable event.
|
|
10432
|
+
if (state.length === 0) state.needReadable = true;
|
|
10433
|
+
// call internal read method
|
|
9984
10434
|
this._read(state.highWaterMark);
|
|
9985
|
-
|
|
9986
|
-
|
|
10435
|
+
state.sync = false;
|
|
10436
|
+
// If _read pushed data synchronously, then `reading` will be false,
|
|
9987
10437
|
// and we need to re-evaluate how much data we can return to the user.
|
|
9988
|
-
|
|
9989
10438
|
if (!state.reading) n = howMuchToRead(nOrig, state);
|
|
9990
10439
|
}
|
|
9991
|
-
|
|
9992
10440
|
var ret;
|
|
9993
10441
|
if (n > 0) ret = fromList(n, state);else ret = null;
|
|
9994
|
-
|
|
9995
10442
|
if (ret === null) {
|
|
9996
10443
|
state.needReadable = state.length <= state.highWaterMark;
|
|
9997
10444
|
n = 0;
|
|
@@ -9999,34 +10446,28 @@ Readable.prototype.read = function (n) {
|
|
|
9999
10446
|
state.length -= n;
|
|
10000
10447
|
state.awaitDrain = 0;
|
|
10001
10448
|
}
|
|
10002
|
-
|
|
10003
10449
|
if (state.length === 0) {
|
|
10004
10450
|
// If we have nothing in the buffer, then we want to know
|
|
10005
10451
|
// as soon as we *do* get something into the buffer.
|
|
10006
|
-
if (!state.ended) state.needReadable = true;
|
|
10452
|
+
if (!state.ended) state.needReadable = true;
|
|
10007
10453
|
|
|
10454
|
+
// If we tried to read() past the EOF, then emit end on the next tick.
|
|
10008
10455
|
if (nOrig !== n && state.ended) endReadable(this);
|
|
10009
10456
|
}
|
|
10010
|
-
|
|
10011
10457
|
if (ret !== null) this.emit('data', ret);
|
|
10012
10458
|
return ret;
|
|
10013
10459
|
};
|
|
10014
|
-
|
|
10015
10460
|
function onEofChunk(stream, state) {
|
|
10016
10461
|
debug('onEofChunk');
|
|
10017
10462
|
if (state.ended) return;
|
|
10018
|
-
|
|
10019
10463
|
if (state.decoder) {
|
|
10020
10464
|
var chunk = state.decoder.end();
|
|
10021
|
-
|
|
10022
10465
|
if (chunk && chunk.length) {
|
|
10023
10466
|
state.buffer.push(chunk);
|
|
10024
10467
|
state.length += state.objectMode ? 1 : chunk.length;
|
|
10025
10468
|
}
|
|
10026
10469
|
}
|
|
10027
|
-
|
|
10028
10470
|
state.ended = true;
|
|
10029
|
-
|
|
10030
10471
|
if (state.sync) {
|
|
10031
10472
|
// if we are sync, wait until next tick to emit the data.
|
|
10032
10473
|
// Otherwise we risk emitting data in the flow()
|
|
@@ -10035,61 +10476,56 @@ function onEofChunk(stream, state) {
|
|
|
10035
10476
|
} else {
|
|
10036
10477
|
// emit 'readable' now to make sure it gets picked up.
|
|
10037
10478
|
state.needReadable = false;
|
|
10038
|
-
|
|
10039
10479
|
if (!state.emittedReadable) {
|
|
10040
10480
|
state.emittedReadable = true;
|
|
10041
10481
|
emitReadable_(stream);
|
|
10042
10482
|
}
|
|
10043
10483
|
}
|
|
10044
|
-
}
|
|
10484
|
+
}
|
|
10485
|
+
|
|
10486
|
+
// Don't emit readable right away in sync mode, because this can trigger
|
|
10045
10487
|
// another read() call => stack overflow. This way, it might trigger
|
|
10046
10488
|
// a nextTick recursion warning, but that's not so bad.
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
10489
|
function emitReadable(stream) {
|
|
10050
10490
|
var state = stream._readableState;
|
|
10051
10491
|
debug('emitReadable', state.needReadable, state.emittedReadable);
|
|
10052
10492
|
state.needReadable = false;
|
|
10053
|
-
|
|
10054
10493
|
if (!state.emittedReadable) {
|
|
10055
10494
|
debug('emitReadable', state.flowing);
|
|
10056
10495
|
state.emittedReadable = true;
|
|
10057
10496
|
process.nextTick(emitReadable_, stream);
|
|
10058
10497
|
}
|
|
10059
10498
|
}
|
|
10060
|
-
|
|
10061
10499
|
function emitReadable_(stream) {
|
|
10062
10500
|
var state = stream._readableState;
|
|
10063
10501
|
debug('emitReadable_', state.destroyed, state.length, state.ended);
|
|
10064
|
-
|
|
10065
10502
|
if (!state.destroyed && (state.length || state.ended)) {
|
|
10066
10503
|
stream.emit('readable');
|
|
10067
10504
|
state.emittedReadable = false;
|
|
10068
|
-
}
|
|
10505
|
+
}
|
|
10506
|
+
|
|
10507
|
+
// The stream needs another readable event if
|
|
10069
10508
|
// 1. It is not flowing, as the flow mechanism will take
|
|
10070
10509
|
// care of it.
|
|
10071
10510
|
// 2. It is not ended.
|
|
10072
10511
|
// 3. It is below the highWaterMark, so we can schedule
|
|
10073
10512
|
// another readable later.
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
10513
|
state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
|
|
10077
10514
|
flow(stream);
|
|
10078
|
-
}
|
|
10515
|
+
}
|
|
10516
|
+
|
|
10517
|
+
// at this point, the user has presumably seen the 'readable' event,
|
|
10079
10518
|
// and called read() to consume some data. that may have triggered
|
|
10080
10519
|
// in turn another _read(n) call, in which case reading = true if
|
|
10081
10520
|
// it's in progress.
|
|
10082
10521
|
// However, if we're not ended, or reading, and the length < hwm,
|
|
10083
10522
|
// then go ahead and try to read some more preemptively.
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
10523
|
function maybeReadMore(stream, state) {
|
|
10087
10524
|
if (!state.readingMore) {
|
|
10088
10525
|
state.readingMore = true;
|
|
10089
10526
|
process.nextTick(maybeReadMore_, stream, state);
|
|
10090
10527
|
}
|
|
10091
10528
|
}
|
|
10092
|
-
|
|
10093
10529
|
function maybeReadMore_(stream, state) {
|
|
10094
10530
|
// Attempt to read more data if we should.
|
|
10095
10531
|
//
|
|
@@ -10118,49 +10554,42 @@ function maybeReadMore_(stream, state) {
|
|
|
10118
10554
|
var len = state.length;
|
|
10119
10555
|
debug('maybeReadMore read 0');
|
|
10120
10556
|
stream.read(0);
|
|
10121
|
-
if (len === state.length)
|
|
10557
|
+
if (len === state.length)
|
|
10558
|
+
// didn't get any data, stop spinning.
|
|
10122
10559
|
break;
|
|
10123
10560
|
}
|
|
10124
|
-
|
|
10125
10561
|
state.readingMore = false;
|
|
10126
|
-
}
|
|
10562
|
+
}
|
|
10563
|
+
|
|
10564
|
+
// abstract method. to be overridden in specific implementation classes.
|
|
10127
10565
|
// call cb(er, data) where data is <= n in length.
|
|
10128
10566
|
// for virtual (non-string, non-buffer) streams, "length" is somewhat
|
|
10129
10567
|
// arbitrary, and perhaps not very meaningful.
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
10568
|
Readable.prototype._read = function (n) {
|
|
10133
10569
|
errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));
|
|
10134
10570
|
};
|
|
10135
|
-
|
|
10136
10571
|
Readable.prototype.pipe = function (dest, pipeOpts) {
|
|
10137
10572
|
var src = this;
|
|
10138
10573
|
var state = this._readableState;
|
|
10139
|
-
|
|
10140
10574
|
switch (state.pipesCount) {
|
|
10141
10575
|
case 0:
|
|
10142
10576
|
state.pipes = dest;
|
|
10143
10577
|
break;
|
|
10144
|
-
|
|
10145
10578
|
case 1:
|
|
10146
10579
|
state.pipes = [state.pipes, dest];
|
|
10147
10580
|
break;
|
|
10148
|
-
|
|
10149
10581
|
default:
|
|
10150
10582
|
state.pipes.push(dest);
|
|
10151
10583
|
break;
|
|
10152
10584
|
}
|
|
10153
|
-
|
|
10154
10585
|
state.pipesCount += 1;
|
|
10155
10586
|
debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
|
|
10156
10587
|
var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
|
|
10157
10588
|
var endFn = doEnd ? onend : unpipe;
|
|
10158
10589
|
if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);
|
|
10159
10590
|
dest.on('unpipe', onunpipe);
|
|
10160
|
-
|
|
10161
10591
|
function onunpipe(readable, unpipeInfo) {
|
|
10162
10592
|
debug('onunpipe');
|
|
10163
|
-
|
|
10164
10593
|
if (readable === src) {
|
|
10165
10594
|
if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
|
|
10166
10595
|
unpipeInfo.hasUnpiped = true;
|
|
@@ -10168,23 +10597,21 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
|
|
|
10168
10597
|
}
|
|
10169
10598
|
}
|
|
10170
10599
|
}
|
|
10171
|
-
|
|
10172
10600
|
function onend() {
|
|
10173
10601
|
debug('onend');
|
|
10174
10602
|
dest.end();
|
|
10175
|
-
}
|
|
10603
|
+
}
|
|
10604
|
+
|
|
10605
|
+
// when the dest drains, it reduces the awaitDrain counter
|
|
10176
10606
|
// on the source. This would be more elegant with a .once()
|
|
10177
10607
|
// handler in flow(), but adding and removing repeatedly is
|
|
10178
10608
|
// too slow.
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
10609
|
var ondrain = pipeOnDrain(src);
|
|
10182
10610
|
dest.on('drain', ondrain);
|
|
10183
10611
|
var cleanedUp = false;
|
|
10184
|
-
|
|
10185
10612
|
function cleanup() {
|
|
10186
|
-
debug('cleanup');
|
|
10187
|
-
|
|
10613
|
+
debug('cleanup');
|
|
10614
|
+
// cleanup event handlers once the pipe is broken
|
|
10188
10615
|
dest.removeListener('close', onclose);
|
|
10189
10616
|
dest.removeListener('finish', onfinish);
|
|
10190
10617
|
dest.removeListener('drain', ondrain);
|
|
@@ -10193,22 +10620,20 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
|
|
|
10193
10620
|
src.removeListener('end', onend);
|
|
10194
10621
|
src.removeListener('end', unpipe);
|
|
10195
10622
|
src.removeListener('data', ondata);
|
|
10196
|
-
cleanedUp = true;
|
|
10623
|
+
cleanedUp = true;
|
|
10624
|
+
|
|
10625
|
+
// if the reader is waiting for a drain event from this
|
|
10197
10626
|
// specific writer, then it would cause it to never start
|
|
10198
10627
|
// flowing again.
|
|
10199
10628
|
// So, if this is awaiting a drain, then we just call it now.
|
|
10200
10629
|
// If we don't know, then assume that we are waiting for one.
|
|
10201
|
-
|
|
10202
10630
|
if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
|
|
10203
10631
|
}
|
|
10204
|
-
|
|
10205
10632
|
src.on('data', ondata);
|
|
10206
|
-
|
|
10207
10633
|
function ondata(chunk) {
|
|
10208
10634
|
debug('ondata');
|
|
10209
10635
|
var ret = dest.write(chunk);
|
|
10210
10636
|
debug('dest.write', ret);
|
|
10211
|
-
|
|
10212
10637
|
if (ret === false) {
|
|
10213
10638
|
// If the user unpiped during `dest.write()`, it is possible
|
|
10214
10639
|
// to get stuck in a permanently paused state if that write
|
|
@@ -10218,87 +10643,84 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
|
|
|
10218
10643
|
debug('false write response, pause', state.awaitDrain);
|
|
10219
10644
|
state.awaitDrain++;
|
|
10220
10645
|
}
|
|
10221
|
-
|
|
10222
10646
|
src.pause();
|
|
10223
10647
|
}
|
|
10224
|
-
}
|
|
10225
|
-
// however, don't suppress the throwing behavior for this.
|
|
10226
|
-
|
|
10648
|
+
}
|
|
10227
10649
|
|
|
10650
|
+
// if the dest has an error, then stop piping into it.
|
|
10651
|
+
// however, don't suppress the throwing behavior for this.
|
|
10228
10652
|
function onerror(er) {
|
|
10229
10653
|
debug('onerror', er);
|
|
10230
10654
|
unpipe();
|
|
10231
10655
|
dest.removeListener('error', onerror);
|
|
10232
10656
|
if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);
|
|
10233
|
-
}
|
|
10234
|
-
|
|
10657
|
+
}
|
|
10235
10658
|
|
|
10236
|
-
|
|
10659
|
+
// Make sure our error handler is attached before userland ones.
|
|
10660
|
+
prependListener(dest, 'error', onerror);
|
|
10237
10661
|
|
|
10662
|
+
// Both close and finish should trigger unpipe, but only once.
|
|
10238
10663
|
function onclose() {
|
|
10239
10664
|
dest.removeListener('finish', onfinish);
|
|
10240
10665
|
unpipe();
|
|
10241
10666
|
}
|
|
10242
|
-
|
|
10243
10667
|
dest.once('close', onclose);
|
|
10244
|
-
|
|
10245
10668
|
function onfinish() {
|
|
10246
10669
|
debug('onfinish');
|
|
10247
10670
|
dest.removeListener('close', onclose);
|
|
10248
10671
|
unpipe();
|
|
10249
10672
|
}
|
|
10250
|
-
|
|
10251
10673
|
dest.once('finish', onfinish);
|
|
10252
|
-
|
|
10253
10674
|
function unpipe() {
|
|
10254
10675
|
debug('unpipe');
|
|
10255
10676
|
src.unpipe(dest);
|
|
10256
|
-
}
|
|
10257
|
-
|
|
10677
|
+
}
|
|
10258
10678
|
|
|
10259
|
-
|
|
10679
|
+
// tell the dest that it's being piped to
|
|
10680
|
+
dest.emit('pipe', src);
|
|
10260
10681
|
|
|
10682
|
+
// start the flow if it hasn't been started already.
|
|
10261
10683
|
if (!state.flowing) {
|
|
10262
10684
|
debug('pipe resume');
|
|
10263
10685
|
src.resume();
|
|
10264
10686
|
}
|
|
10265
|
-
|
|
10266
10687
|
return dest;
|
|
10267
10688
|
};
|
|
10268
|
-
|
|
10269
10689
|
function pipeOnDrain(src) {
|
|
10270
10690
|
return function pipeOnDrainFunctionResult() {
|
|
10271
10691
|
var state = src._readableState;
|
|
10272
10692
|
debug('pipeOnDrain', state.awaitDrain);
|
|
10273
10693
|
if (state.awaitDrain) state.awaitDrain--;
|
|
10274
|
-
|
|
10275
10694
|
if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
|
|
10276
10695
|
state.flowing = true;
|
|
10277
10696
|
flow(src);
|
|
10278
10697
|
}
|
|
10279
10698
|
};
|
|
10280
10699
|
}
|
|
10281
|
-
|
|
10282
10700
|
Readable.prototype.unpipe = function (dest) {
|
|
10283
10701
|
var state = this._readableState;
|
|
10284
10702
|
var unpipeInfo = {
|
|
10285
10703
|
hasUnpiped: false
|
|
10286
|
-
};
|
|
10704
|
+
};
|
|
10287
10705
|
|
|
10288
|
-
if
|
|
10706
|
+
// if we're not piping anywhere, then do nothing.
|
|
10707
|
+
if (state.pipesCount === 0) return this;
|
|
10289
10708
|
|
|
10709
|
+
// just one destination. most common case.
|
|
10290
10710
|
if (state.pipesCount === 1) {
|
|
10291
10711
|
// passed in one, but it's not the right one.
|
|
10292
10712
|
if (dest && dest !== state.pipes) return this;
|
|
10293
|
-
if (!dest) dest = state.pipes;
|
|
10713
|
+
if (!dest) dest = state.pipes;
|
|
10294
10714
|
|
|
10715
|
+
// got a match.
|
|
10295
10716
|
state.pipes = null;
|
|
10296
10717
|
state.pipesCount = 0;
|
|
10297
10718
|
state.flowing = false;
|
|
10298
10719
|
if (dest) dest.emit('unpipe', this, unpipeInfo);
|
|
10299
10720
|
return this;
|
|
10300
|
-
}
|
|
10721
|
+
}
|
|
10301
10722
|
|
|
10723
|
+
// slow case. multiple pipe destinations.
|
|
10302
10724
|
|
|
10303
10725
|
if (!dest) {
|
|
10304
10726
|
// remove all.
|
|
@@ -10307,17 +10729,13 @@ Readable.prototype.unpipe = function (dest) {
|
|
|
10307
10729
|
state.pipes = null;
|
|
10308
10730
|
state.pipesCount = 0;
|
|
10309
10731
|
state.flowing = false;
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
hasUnpiped: false
|
|
10314
|
-
});
|
|
10315
|
-
}
|
|
10316
|
-
|
|
10732
|
+
for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, {
|
|
10733
|
+
hasUnpiped: false
|
|
10734
|
+
});
|
|
10317
10735
|
return this;
|
|
10318
|
-
}
|
|
10319
|
-
|
|
10736
|
+
}
|
|
10320
10737
|
|
|
10738
|
+
// try to find the right one.
|
|
10321
10739
|
var index = indexOf(state.pipes, dest);
|
|
10322
10740
|
if (index === -1) return this;
|
|
10323
10741
|
state.pipes.splice(index, 1);
|
|
@@ -10325,19 +10743,19 @@ Readable.prototype.unpipe = function (dest) {
|
|
|
10325
10743
|
if (state.pipesCount === 1) state.pipes = state.pipes[0];
|
|
10326
10744
|
dest.emit('unpipe', this, unpipeInfo);
|
|
10327
10745
|
return this;
|
|
10328
|
-
};
|
|
10329
|
-
// Ensure readable listeners eventually get something
|
|
10330
|
-
|
|
10746
|
+
};
|
|
10331
10747
|
|
|
10748
|
+
// set up data events if they are asked for
|
|
10749
|
+
// Ensure readable listeners eventually get something
|
|
10332
10750
|
Readable.prototype.on = function (ev, fn) {
|
|
10333
10751
|
var res = Stream.prototype.on.call(this, ev, fn);
|
|
10334
10752
|
var state = this._readableState;
|
|
10335
|
-
|
|
10336
10753
|
if (ev === 'data') {
|
|
10337
10754
|
// update readableListening so that resume() may be a no-op
|
|
10338
10755
|
// a few lines down. This is needed to support once('readable').
|
|
10339
|
-
state.readableListening = this.listenerCount('readable') > 0;
|
|
10756
|
+
state.readableListening = this.listenerCount('readable') > 0;
|
|
10340
10757
|
|
|
10758
|
+
// Try start flowing on next tick if stream isn't explicitly paused
|
|
10341
10759
|
if (state.flowing !== false) this.resume();
|
|
10342
10760
|
} else if (ev === 'readable') {
|
|
10343
10761
|
if (!state.endEmitted && !state.readableListening) {
|
|
@@ -10345,7 +10763,6 @@ Readable.prototype.on = function (ev, fn) {
|
|
|
10345
10763
|
state.flowing = false;
|
|
10346
10764
|
state.emittedReadable = false;
|
|
10347
10765
|
debug('on readable', state.length, state.reading);
|
|
10348
|
-
|
|
10349
10766
|
if (state.length) {
|
|
10350
10767
|
emitReadable(this);
|
|
10351
10768
|
} else if (!state.reading) {
|
|
@@ -10353,15 +10770,11 @@ Readable.prototype.on = function (ev, fn) {
|
|
|
10353
10770
|
}
|
|
10354
10771
|
}
|
|
10355
10772
|
}
|
|
10356
|
-
|
|
10357
10773
|
return res;
|
|
10358
10774
|
};
|
|
10359
|
-
|
|
10360
10775
|
Readable.prototype.addListener = Readable.prototype.on;
|
|
10361
|
-
|
|
10362
10776
|
Readable.prototype.removeListener = function (ev, fn) {
|
|
10363
10777
|
var res = Stream.prototype.removeListener.call(this, ev, fn);
|
|
10364
|
-
|
|
10365
10778
|
if (ev === 'readable') {
|
|
10366
10779
|
// We need to check if there is someone still listening to
|
|
10367
10780
|
// readable and reset the state. However this needs to happen
|
|
@@ -10371,13 +10784,10 @@ Readable.prototype.removeListener = function (ev, fn) {
|
|
|
10371
10784
|
// effect.
|
|
10372
10785
|
process.nextTick(updateReadableListening, this);
|
|
10373
10786
|
}
|
|
10374
|
-
|
|
10375
10787
|
return res;
|
|
10376
10788
|
};
|
|
10377
|
-
|
|
10378
10789
|
Readable.prototype.removeAllListeners = function (ev) {
|
|
10379
10790
|
var res = Stream.prototype.removeAllListeners.apply(this, arguments);
|
|
10380
|
-
|
|
10381
10791
|
if (ev === 'readable' || ev === undefined) {
|
|
10382
10792
|
// We need to check if there is someone still listening to
|
|
10383
10793
|
// readable and reset the state. However this needs to happen
|
|
@@ -10387,121 +10797,103 @@ Readable.prototype.removeAllListeners = function (ev) {
|
|
|
10387
10797
|
// effect.
|
|
10388
10798
|
process.nextTick(updateReadableListening, this);
|
|
10389
10799
|
}
|
|
10390
|
-
|
|
10391
10800
|
return res;
|
|
10392
10801
|
};
|
|
10393
|
-
|
|
10394
10802
|
function updateReadableListening(self) {
|
|
10395
10803
|
var state = self._readableState;
|
|
10396
10804
|
state.readableListening = self.listenerCount('readable') > 0;
|
|
10397
|
-
|
|
10398
10805
|
if (state.resumeScheduled && !state.paused) {
|
|
10399
10806
|
// flowing needs to be set to true now, otherwise
|
|
10400
10807
|
// the upcoming resume will not flow.
|
|
10401
|
-
state.flowing = true;
|
|
10808
|
+
state.flowing = true;
|
|
10809
|
+
|
|
10810
|
+
// crude way to check if we should resume
|
|
10402
10811
|
} else if (self.listenerCount('data') > 0) {
|
|
10403
10812
|
self.resume();
|
|
10404
10813
|
}
|
|
10405
10814
|
}
|
|
10406
|
-
|
|
10407
10815
|
function nReadingNextTick(self) {
|
|
10408
10816
|
debug('readable nexttick read 0');
|
|
10409
10817
|
self.read(0);
|
|
10410
|
-
}
|
|
10411
|
-
// If the user uses them, then switch into old mode.
|
|
10412
|
-
|
|
10818
|
+
}
|
|
10413
10819
|
|
|
10820
|
+
// pause() and resume() are remnants of the legacy readable stream API
|
|
10821
|
+
// If the user uses them, then switch into old mode.
|
|
10414
10822
|
Readable.prototype.resume = function () {
|
|
10415
10823
|
var state = this._readableState;
|
|
10416
|
-
|
|
10417
10824
|
if (!state.flowing) {
|
|
10418
|
-
debug('resume');
|
|
10825
|
+
debug('resume');
|
|
10826
|
+
// we flow only if there is no one listening
|
|
10419
10827
|
// for readable, but we still have to call
|
|
10420
10828
|
// resume()
|
|
10421
|
-
|
|
10422
10829
|
state.flowing = !state.readableListening;
|
|
10423
10830
|
resume(this, state);
|
|
10424
10831
|
}
|
|
10425
|
-
|
|
10426
10832
|
state.paused = false;
|
|
10427
10833
|
return this;
|
|
10428
10834
|
};
|
|
10429
|
-
|
|
10430
10835
|
function resume(stream, state) {
|
|
10431
10836
|
if (!state.resumeScheduled) {
|
|
10432
10837
|
state.resumeScheduled = true;
|
|
10433
10838
|
process.nextTick(resume_, stream, state);
|
|
10434
10839
|
}
|
|
10435
10840
|
}
|
|
10436
|
-
|
|
10437
10841
|
function resume_(stream, state) {
|
|
10438
10842
|
debug('resume', state.reading);
|
|
10439
|
-
|
|
10440
10843
|
if (!state.reading) {
|
|
10441
10844
|
stream.read(0);
|
|
10442
10845
|
}
|
|
10443
|
-
|
|
10444
10846
|
state.resumeScheduled = false;
|
|
10445
10847
|
stream.emit('resume');
|
|
10446
10848
|
flow(stream);
|
|
10447
10849
|
if (state.flowing && !state.reading) stream.read(0);
|
|
10448
10850
|
}
|
|
10449
|
-
|
|
10450
10851
|
Readable.prototype.pause = function () {
|
|
10451
10852
|
debug('call pause flowing=%j', this._readableState.flowing);
|
|
10452
|
-
|
|
10453
10853
|
if (this._readableState.flowing !== false) {
|
|
10454
10854
|
debug('pause');
|
|
10455
10855
|
this._readableState.flowing = false;
|
|
10456
10856
|
this.emit('pause');
|
|
10457
10857
|
}
|
|
10458
|
-
|
|
10459
10858
|
this._readableState.paused = true;
|
|
10460
10859
|
return this;
|
|
10461
10860
|
};
|
|
10462
|
-
|
|
10463
10861
|
function flow(stream) {
|
|
10464
10862
|
var state = stream._readableState;
|
|
10465
10863
|
debug('flow', state.flowing);
|
|
10864
|
+
while (state.flowing && stream.read() !== null);
|
|
10865
|
+
}
|
|
10466
10866
|
|
|
10467
|
-
|
|
10468
|
-
;
|
|
10469
|
-
}
|
|
10470
|
-
} // wrap an old-style stream as the async data source.
|
|
10867
|
+
// wrap an old-style stream as the async data source.
|
|
10471
10868
|
// This is *not* part of the readable stream interface.
|
|
10472
10869
|
// It is an ugly unfortunate mess of history.
|
|
10473
|
-
|
|
10474
|
-
|
|
10475
10870
|
Readable.prototype.wrap = function (stream) {
|
|
10476
10871
|
var _this = this;
|
|
10477
|
-
|
|
10478
10872
|
var state = this._readableState;
|
|
10479
10873
|
var paused = false;
|
|
10480
10874
|
stream.on('end', function () {
|
|
10481
10875
|
debug('wrapped end');
|
|
10482
|
-
|
|
10483
10876
|
if (state.decoder && !state.ended) {
|
|
10484
10877
|
var chunk = state.decoder.end();
|
|
10485
10878
|
if (chunk && chunk.length) _this.push(chunk);
|
|
10486
10879
|
}
|
|
10487
|
-
|
|
10488
10880
|
_this.push(null);
|
|
10489
10881
|
});
|
|
10490
10882
|
stream.on('data', function (chunk) {
|
|
10491
10883
|
debug('wrapped data');
|
|
10492
|
-
if (state.decoder) chunk = state.decoder.write(chunk);
|
|
10884
|
+
if (state.decoder) chunk = state.decoder.write(chunk);
|
|
10493
10885
|
|
|
10886
|
+
// don't skip over falsy values in objectMode
|
|
10494
10887
|
if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
|
|
10495
|
-
|
|
10496
10888
|
var ret = _this.push(chunk);
|
|
10497
|
-
|
|
10498
10889
|
if (!ret) {
|
|
10499
10890
|
paused = true;
|
|
10500
10891
|
stream.pause();
|
|
10501
10892
|
}
|
|
10502
|
-
});
|
|
10503
|
-
// important when wrapping filters and duplexes.
|
|
10893
|
+
});
|
|
10504
10894
|
|
|
10895
|
+
// proxy all the other methods.
|
|
10896
|
+
// important when wrapping filters and duplexes.
|
|
10505
10897
|
for (var i in stream) {
|
|
10506
10898
|
if (this[i] === undefined && typeof stream[i] === 'function') {
|
|
10507
10899
|
this[i] = function methodWrap(method) {
|
|
@@ -10510,37 +10902,32 @@ Readable.prototype.wrap = function (stream) {
|
|
|
10510
10902
|
};
|
|
10511
10903
|
}(i);
|
|
10512
10904
|
}
|
|
10513
|
-
}
|
|
10514
|
-
|
|
10905
|
+
}
|
|
10515
10906
|
|
|
10907
|
+
// proxy certain important events.
|
|
10516
10908
|
for (var n = 0; n < kProxyEvents.length; n++) {
|
|
10517
10909
|
stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
|
|
10518
|
-
}
|
|
10519
|
-
// underlying stream.
|
|
10520
|
-
|
|
10910
|
+
}
|
|
10521
10911
|
|
|
10912
|
+
// when we try to consume some more bytes, simply unpause the
|
|
10913
|
+
// underlying stream.
|
|
10522
10914
|
this._read = function (n) {
|
|
10523
10915
|
debug('wrapped _read', n);
|
|
10524
|
-
|
|
10525
10916
|
if (paused) {
|
|
10526
10917
|
paused = false;
|
|
10527
10918
|
stream.resume();
|
|
10528
10919
|
}
|
|
10529
10920
|
};
|
|
10530
|
-
|
|
10531
10921
|
return this;
|
|
10532
10922
|
};
|
|
10533
|
-
|
|
10534
10923
|
if (typeof Symbol === 'function') {
|
|
10535
10924
|
Readable.prototype[Symbol.asyncIterator] = function () {
|
|
10536
10925
|
if (createReadableStreamAsyncIterator === undefined) {
|
|
10537
10926
|
createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');
|
|
10538
10927
|
}
|
|
10539
|
-
|
|
10540
10928
|
return createReadableStreamAsyncIterator(this);
|
|
10541
10929
|
};
|
|
10542
10930
|
}
|
|
10543
|
-
|
|
10544
10931
|
Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
|
|
10545
10932
|
// making it explicit this property is not enumerable
|
|
10546
10933
|
// because otherwise some prototype manipulation in
|
|
@@ -10572,8 +10959,9 @@ Object.defineProperty(Readable.prototype, 'readableFlowing', {
|
|
|
10572
10959
|
this._readableState.flowing = state;
|
|
10573
10960
|
}
|
|
10574
10961
|
}
|
|
10575
|
-
});
|
|
10962
|
+
});
|
|
10576
10963
|
|
|
10964
|
+
// exposed for testing purposes only.
|
|
10577
10965
|
Readable._fromList = fromList;
|
|
10578
10966
|
Object.defineProperty(Readable.prototype, 'readableLength', {
|
|
10579
10967
|
// making it explicit this property is not enumerable
|
|
@@ -10583,11 +10971,12 @@ Object.defineProperty(Readable.prototype, 'readableLength', {
|
|
|
10583
10971
|
get: function get() {
|
|
10584
10972
|
return this._readableState.length;
|
|
10585
10973
|
}
|
|
10586
|
-
});
|
|
10974
|
+
});
|
|
10975
|
+
|
|
10976
|
+
// Pluck off n bytes from an array of buffers.
|
|
10587
10977
|
// Length is the combined lengths of all the buffers in the list.
|
|
10588
10978
|
// This function is designed to be inlinable, so please take care when making
|
|
10589
10979
|
// changes to the function body.
|
|
10590
|
-
|
|
10591
10980
|
function fromList(n, state) {
|
|
10592
10981
|
// nothing buffered
|
|
10593
10982
|
if (state.length === 0) return null;
|
|
@@ -10602,56 +10991,48 @@ function fromList(n, state) {
|
|
|
10602
10991
|
}
|
|
10603
10992
|
return ret;
|
|
10604
10993
|
}
|
|
10605
|
-
|
|
10606
10994
|
function endReadable(stream) {
|
|
10607
10995
|
var state = stream._readableState;
|
|
10608
10996
|
debug('endReadable', state.endEmitted);
|
|
10609
|
-
|
|
10610
10997
|
if (!state.endEmitted) {
|
|
10611
10998
|
state.ended = true;
|
|
10612
10999
|
process.nextTick(endReadableNT, state, stream);
|
|
10613
11000
|
}
|
|
10614
11001
|
}
|
|
10615
|
-
|
|
10616
11002
|
function endReadableNT(state, stream) {
|
|
10617
|
-
debug('endReadableNT', state.endEmitted, state.length);
|
|
11003
|
+
debug('endReadableNT', state.endEmitted, state.length);
|
|
10618
11004
|
|
|
11005
|
+
// Check that we didn't get one last unshift.
|
|
10619
11006
|
if (!state.endEmitted && state.length === 0) {
|
|
10620
11007
|
state.endEmitted = true;
|
|
10621
11008
|
stream.readable = false;
|
|
10622
11009
|
stream.emit('end');
|
|
10623
|
-
|
|
10624
11010
|
if (state.autoDestroy) {
|
|
10625
11011
|
// In case of duplex streams we need a way to detect
|
|
10626
11012
|
// if the writable side is ready for autoDestroy as well
|
|
10627
11013
|
var wState = stream._writableState;
|
|
10628
|
-
|
|
10629
11014
|
if (!wState || wState.autoDestroy && wState.finished) {
|
|
10630
11015
|
stream.destroy();
|
|
10631
11016
|
}
|
|
10632
11017
|
}
|
|
10633
11018
|
}
|
|
10634
11019
|
}
|
|
10635
|
-
|
|
10636
11020
|
if (typeof Symbol === 'function') {
|
|
10637
11021
|
Readable.from = function (iterable, opts) {
|
|
10638
11022
|
if (from === undefined) {
|
|
10639
11023
|
from = require('./internal/streams/from');
|
|
10640
11024
|
}
|
|
10641
|
-
|
|
10642
11025
|
return from(Readable, iterable, opts);
|
|
10643
11026
|
};
|
|
10644
11027
|
}
|
|
10645
|
-
|
|
10646
11028
|
function indexOf(xs, x) {
|
|
10647
11029
|
for (var i = 0, l = xs.length; i < l; i++) {
|
|
10648
11030
|
if (xs[i] === x) return i;
|
|
10649
11031
|
}
|
|
10650
|
-
|
|
10651
11032
|
return -1;
|
|
10652
11033
|
}
|
|
10653
11034
|
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
10654
|
-
},{"../errors":
|
|
11035
|
+
},{"../errors":62,"./_stream_duplex":63,"./internal/streams/async_iterator":68,"./internal/streams/buffer_list":69,"./internal/streams/destroy":70,"./internal/streams/from":72,"./internal/streams/state":74,"./internal/streams/stream":75,"_process":58,"buffer":9,"events":18,"inherits":36,"string_decoder/":76,"util":7}],66:[function(require,module,exports){
|
|
10655
11036
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
10656
11037
|
//
|
|
10657
11038
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -10672,6 +11053,7 @@ function indexOf(xs, x) {
|
|
|
10672
11053
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
10673
11054
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
10674
11055
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
11056
|
+
|
|
10675
11057
|
// a transform stream is a readable/writable stream where you do
|
|
10676
11058
|
// something with the data. Sometimes it's called a "filter",
|
|
10677
11059
|
// but that's not a great name for it, since that implies a thing where
|
|
@@ -10713,42 +11095,36 @@ function indexOf(xs, x) {
|
|
|
10713
11095
|
// However, even in such a pathological case, only a single written chunk
|
|
10714
11096
|
// would be consumed, and then the rest would wait (un-transformed) until
|
|
10715
11097
|
// the results of the previous transformed chunk were consumed.
|
|
11098
|
+
|
|
10716
11099
|
'use strict';
|
|
10717
11100
|
|
|
10718
11101
|
module.exports = Transform;
|
|
10719
|
-
|
|
10720
11102
|
var _require$codes = require('../errors').codes,
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
11103
|
+
ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
|
|
11104
|
+
ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
|
|
11105
|
+
ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,
|
|
11106
|
+
ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
|
|
10726
11107
|
var Duplex = require('./_stream_duplex');
|
|
10727
|
-
|
|
10728
11108
|
require('inherits')(Transform, Duplex);
|
|
10729
|
-
|
|
10730
11109
|
function afterTransform(er, data) {
|
|
10731
11110
|
var ts = this._transformState;
|
|
10732
11111
|
ts.transforming = false;
|
|
10733
11112
|
var cb = ts.writecb;
|
|
10734
|
-
|
|
10735
11113
|
if (cb === null) {
|
|
10736
11114
|
return this.emit('error', new ERR_MULTIPLE_CALLBACK());
|
|
10737
11115
|
}
|
|
10738
|
-
|
|
10739
11116
|
ts.writechunk = null;
|
|
10740
11117
|
ts.writecb = null;
|
|
10741
|
-
if (data != null)
|
|
11118
|
+
if (data != null)
|
|
11119
|
+
// single equals check for both `null` and `undefined`
|
|
10742
11120
|
this.push(data);
|
|
10743
11121
|
cb(er);
|
|
10744
11122
|
var rs = this._readableState;
|
|
10745
11123
|
rs.reading = false;
|
|
10746
|
-
|
|
10747
11124
|
if (rs.needReadable || rs.length < rs.highWaterMark) {
|
|
10748
11125
|
this._read(rs.highWaterMark);
|
|
10749
11126
|
}
|
|
10750
11127
|
}
|
|
10751
|
-
|
|
10752
11128
|
function Transform(options) {
|
|
10753
11129
|
if (!(this instanceof Transform)) return new Transform(options);
|
|
10754
11130
|
Duplex.call(this, options);
|
|
@@ -10759,26 +11135,25 @@ function Transform(options) {
|
|
|
10759
11135
|
writecb: null,
|
|
10760
11136
|
writechunk: null,
|
|
10761
11137
|
writeencoding: null
|
|
10762
|
-
};
|
|
11138
|
+
};
|
|
11139
|
+
|
|
11140
|
+
// start out asking for a readable event once data is transformed.
|
|
11141
|
+
this._readableState.needReadable = true;
|
|
10763
11142
|
|
|
10764
|
-
|
|
11143
|
+
// we have implemented the _read method, and done the other things
|
|
10765
11144
|
// that Readable wants before the first _read call, so unset the
|
|
10766
11145
|
// sync guard flag.
|
|
10767
|
-
|
|
10768
11146
|
this._readableState.sync = false;
|
|
10769
|
-
|
|
10770
11147
|
if (options) {
|
|
10771
11148
|
if (typeof options.transform === 'function') this._transform = options.transform;
|
|
10772
11149
|
if (typeof options.flush === 'function') this._flush = options.flush;
|
|
10773
|
-
}
|
|
10774
|
-
|
|
11150
|
+
}
|
|
10775
11151
|
|
|
11152
|
+
// When the writable side finishes, then flush out anything remaining.
|
|
10776
11153
|
this.on('prefinish', prefinish);
|
|
10777
11154
|
}
|
|
10778
|
-
|
|
10779
11155
|
function prefinish() {
|
|
10780
11156
|
var _this = this;
|
|
10781
|
-
|
|
10782
11157
|
if (typeof this._flush === 'function' && !this._readableState.destroyed) {
|
|
10783
11158
|
this._flush(function (er, data) {
|
|
10784
11159
|
done(_this, er, data);
|
|
@@ -10787,11 +11162,12 @@ function prefinish() {
|
|
|
10787
11162
|
done(this, null, null);
|
|
10788
11163
|
}
|
|
10789
11164
|
}
|
|
10790
|
-
|
|
10791
11165
|
Transform.prototype.push = function (chunk, encoding) {
|
|
10792
11166
|
this._transformState.needTransform = false;
|
|
10793
11167
|
return Duplex.prototype.push.call(this, chunk, encoding);
|
|
10794
|
-
};
|
|
11168
|
+
};
|
|
11169
|
+
|
|
11170
|
+
// This is the part where you do stuff!
|
|
10795
11171
|
// override this function in implementation classes.
|
|
10796
11172
|
// 'chunk' is an input chunk.
|
|
10797
11173
|
//
|
|
@@ -10801,33 +11177,27 @@ Transform.prototype.push = function (chunk, encoding) {
|
|
|
10801
11177
|
// Call `cb(err)` when you are done with this chunk. If you pass
|
|
10802
11178
|
// an error, then that'll put the hurt on the whole operation. If you
|
|
10803
11179
|
// never call cb(), then you'll never get another chunk.
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
11180
|
Transform.prototype._transform = function (chunk, encoding, cb) {
|
|
10807
11181
|
cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));
|
|
10808
11182
|
};
|
|
10809
|
-
|
|
10810
11183
|
Transform.prototype._write = function (chunk, encoding, cb) {
|
|
10811
11184
|
var ts = this._transformState;
|
|
10812
11185
|
ts.writecb = cb;
|
|
10813
11186
|
ts.writechunk = chunk;
|
|
10814
11187
|
ts.writeencoding = encoding;
|
|
10815
|
-
|
|
10816
11188
|
if (!ts.transforming) {
|
|
10817
11189
|
var rs = this._readableState;
|
|
10818
11190
|
if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
|
|
10819
11191
|
}
|
|
10820
|
-
};
|
|
11192
|
+
};
|
|
11193
|
+
|
|
11194
|
+
// Doesn't matter what the args are here.
|
|
10821
11195
|
// _transform does all the work.
|
|
10822
11196
|
// That we got here means that the readable side wants more data.
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
11197
|
Transform.prototype._read = function (n) {
|
|
10826
11198
|
var ts = this._transformState;
|
|
10827
|
-
|
|
10828
11199
|
if (ts.writechunk !== null && !ts.transforming) {
|
|
10829
11200
|
ts.transforming = true;
|
|
10830
|
-
|
|
10831
11201
|
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
|
|
10832
11202
|
} else {
|
|
10833
11203
|
// mark that we need a transform, so that any data that comes in
|
|
@@ -10835,25 +11205,25 @@ Transform.prototype._read = function (n) {
|
|
|
10835
11205
|
ts.needTransform = true;
|
|
10836
11206
|
}
|
|
10837
11207
|
};
|
|
10838
|
-
|
|
10839
11208
|
Transform.prototype._destroy = function (err, cb) {
|
|
10840
11209
|
Duplex.prototype._destroy.call(this, err, function (err2) {
|
|
10841
11210
|
cb(err2);
|
|
10842
11211
|
});
|
|
10843
11212
|
};
|
|
10844
|
-
|
|
10845
11213
|
function done(stream, er, data) {
|
|
10846
11214
|
if (er) return stream.emit('error', er);
|
|
10847
|
-
if (data != null)
|
|
10848
|
-
|
|
11215
|
+
if (data != null)
|
|
11216
|
+
// single equals check for both `null` and `undefined`
|
|
11217
|
+
stream.push(data);
|
|
11218
|
+
|
|
11219
|
+
// TODO(BridgeAR): Write a test for these two error cases
|
|
10849
11220
|
// if there's nothing in the write buffer, then that means
|
|
10850
11221
|
// that nothing more will ever be provided
|
|
10851
|
-
|
|
10852
11222
|
if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
|
|
10853
11223
|
if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
|
|
10854
11224
|
return stream.push(null);
|
|
10855
11225
|
}
|
|
10856
|
-
},{"../errors":
|
|
11226
|
+
},{"../errors":62,"./_stream_duplex":63,"inherits":36}],67:[function(require,module,exports){
|
|
10857
11227
|
(function (process,global){(function (){
|
|
10858
11228
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
10859
11229
|
//
|
|
@@ -10875,29 +11245,29 @@ function done(stream, er, data) {
|
|
|
10875
11245
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
10876
11246
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
10877
11247
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
11248
|
+
|
|
10878
11249
|
// A bit simpler than readable streams.
|
|
10879
11250
|
// Implement an async ._write(chunk, encoding, cb), and it'll handle all
|
|
10880
11251
|
// the drain event emission and buffering.
|
|
11252
|
+
|
|
10881
11253
|
'use strict';
|
|
10882
11254
|
|
|
10883
11255
|
module.exports = Writable;
|
|
10884
|
-
/* <replacement> */
|
|
10885
11256
|
|
|
11257
|
+
/* <replacement> */
|
|
10886
11258
|
function WriteReq(chunk, encoding, cb) {
|
|
10887
11259
|
this.chunk = chunk;
|
|
10888
11260
|
this.encoding = encoding;
|
|
10889
11261
|
this.callback = cb;
|
|
10890
11262
|
this.next = null;
|
|
10891
|
-
}
|
|
10892
|
-
// there will be only 2 of these for each stream
|
|
10893
|
-
|
|
11263
|
+
}
|
|
10894
11264
|
|
|
11265
|
+
// It seems a linked list but it is not
|
|
11266
|
+
// there will be only 2 of these for each stream
|
|
10895
11267
|
function CorkedRequest(state) {
|
|
10896
11268
|
var _this = this;
|
|
10897
|
-
|
|
10898
11269
|
this.next = null;
|
|
10899
11270
|
this.entry = null;
|
|
10900
|
-
|
|
10901
11271
|
this.finish = function () {
|
|
10902
11272
|
onCorkedFinish(_this, state);
|
|
10903
11273
|
};
|
|
@@ -10905,155 +11275,159 @@ function CorkedRequest(state) {
|
|
|
10905
11275
|
/* </replacement> */
|
|
10906
11276
|
|
|
10907
11277
|
/*<replacement>*/
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
11278
|
var Duplex;
|
|
10911
11279
|
/*</replacement>*/
|
|
10912
11280
|
|
|
10913
11281
|
Writable.WritableState = WritableState;
|
|
10914
|
-
/*<replacement>*/
|
|
10915
11282
|
|
|
11283
|
+
/*<replacement>*/
|
|
10916
11284
|
var internalUtil = {
|
|
10917
11285
|
deprecate: require('util-deprecate')
|
|
10918
11286
|
};
|
|
10919
11287
|
/*</replacement>*/
|
|
10920
11288
|
|
|
10921
11289
|
/*<replacement>*/
|
|
10922
|
-
|
|
10923
11290
|
var Stream = require('./internal/streams/stream');
|
|
10924
11291
|
/*</replacement>*/
|
|
10925
11292
|
|
|
10926
|
-
|
|
10927
11293
|
var Buffer = require('buffer').Buffer;
|
|
10928
|
-
|
|
10929
|
-
var OurUint8Array = global.Uint8Array || function () {};
|
|
10930
|
-
|
|
11294
|
+
var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
|
|
10931
11295
|
function _uint8ArrayToBuffer(chunk) {
|
|
10932
11296
|
return Buffer.from(chunk);
|
|
10933
11297
|
}
|
|
10934
|
-
|
|
10935
11298
|
function _isUint8Array(obj) {
|
|
10936
11299
|
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
10937
11300
|
}
|
|
10938
|
-
|
|
10939
11301
|
var destroyImpl = require('./internal/streams/destroy');
|
|
10940
|
-
|
|
10941
11302
|
var _require = require('./internal/streams/state'),
|
|
10942
|
-
|
|
10943
|
-
|
|
11303
|
+
getHighWaterMark = _require.getHighWaterMark;
|
|
10944
11304
|
var _require$codes = require('../errors').codes,
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
11305
|
+
ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
|
|
11306
|
+
ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
|
|
11307
|
+
ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
|
|
11308
|
+
ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,
|
|
11309
|
+
ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,
|
|
11310
|
+
ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,
|
|
11311
|
+
ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,
|
|
11312
|
+
ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
|
|
10954
11313
|
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
10955
|
-
|
|
10956
11314
|
require('inherits')(Writable, Stream);
|
|
10957
|
-
|
|
10958
11315
|
function nop() {}
|
|
10959
|
-
|
|
10960
11316
|
function WritableState(options, stream, isDuplex) {
|
|
10961
11317
|
Duplex = Duplex || require('./_stream_duplex');
|
|
10962
|
-
options = options || {};
|
|
11318
|
+
options = options || {};
|
|
11319
|
+
|
|
11320
|
+
// Duplex streams are both readable and writable, but share
|
|
10963
11321
|
// the same options object.
|
|
10964
11322
|
// However, some cases require setting options to different
|
|
10965
11323
|
// values for the readable and the writable sides of the duplex stream,
|
|
10966
11324
|
// e.g. options.readableObjectMode vs. options.writableObjectMode, etc.
|
|
11325
|
+
if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;
|
|
10967
11326
|
|
|
10968
|
-
|
|
11327
|
+
// object stream flag to indicate whether or not this stream
|
|
10969
11328
|
// contains buffers or objects.
|
|
10970
|
-
|
|
10971
11329
|
this.objectMode = !!options.objectMode;
|
|
10972
|
-
if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
|
|
11330
|
+
if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
|
|
11331
|
+
|
|
11332
|
+
// the point at which write() starts returning false
|
|
10973
11333
|
// Note: 0 is a valid value, means that we always return false if
|
|
10974
11334
|
// the entire buffer is not flushed immediately on write()
|
|
11335
|
+
this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex);
|
|
10975
11336
|
|
|
10976
|
-
|
|
11337
|
+
// if _final has been called
|
|
11338
|
+
this.finalCalled = false;
|
|
10977
11339
|
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
11340
|
+
// drain event flag.
|
|
11341
|
+
this.needDrain = false;
|
|
11342
|
+
// at the start of calling end()
|
|
11343
|
+
this.ending = false;
|
|
11344
|
+
// when end() has been called, and returned
|
|
11345
|
+
this.ended = false;
|
|
11346
|
+
// when 'finish' is emitted
|
|
11347
|
+
this.finished = false;
|
|
10985
11348
|
|
|
10986
|
-
|
|
11349
|
+
// has it been destroyed
|
|
11350
|
+
this.destroyed = false;
|
|
10987
11351
|
|
|
10988
|
-
|
|
11352
|
+
// should we decode strings into buffers before passing to _write?
|
|
10989
11353
|
// this is here so that some node-core streams can optimize string
|
|
10990
11354
|
// handling at a lower level.
|
|
10991
|
-
|
|
10992
11355
|
var noDecode = options.decodeStrings === false;
|
|
10993
|
-
this.decodeStrings = !noDecode;
|
|
11356
|
+
this.decodeStrings = !noDecode;
|
|
11357
|
+
|
|
11358
|
+
// Crypto is kind of old and crusty. Historically, its default string
|
|
10994
11359
|
// encoding is 'binary' so we have to make this configurable.
|
|
10995
11360
|
// Everything else in the universe uses 'utf8', though.
|
|
11361
|
+
this.defaultEncoding = options.defaultEncoding || 'utf8';
|
|
10996
11362
|
|
|
10997
|
-
|
|
11363
|
+
// not an actual buffer we keep track of, but a measurement
|
|
10998
11364
|
// of how much we're waiting to get pushed to some underlying
|
|
10999
11365
|
// socket or file.
|
|
11366
|
+
this.length = 0;
|
|
11000
11367
|
|
|
11001
|
-
|
|
11368
|
+
// a flag to see when we're in the middle of a write.
|
|
11369
|
+
this.writing = false;
|
|
11002
11370
|
|
|
11003
|
-
|
|
11371
|
+
// when true all writes will be buffered until .uncork() call
|
|
11372
|
+
this.corked = 0;
|
|
11004
11373
|
|
|
11005
|
-
|
|
11374
|
+
// a flag to be able to tell if the onwrite cb is called immediately,
|
|
11006
11375
|
// or on a later tick. We set this to true at first, because any
|
|
11007
11376
|
// actions that shouldn't happen until "later" should generally also
|
|
11008
11377
|
// not happen before the first write call.
|
|
11378
|
+
this.sync = true;
|
|
11009
11379
|
|
|
11010
|
-
|
|
11380
|
+
// a flag to know if we're processing previously buffered items, which
|
|
11011
11381
|
// may call the _write() callback in the same tick, so that we don't
|
|
11012
11382
|
// end up in an overlapped onwrite situation.
|
|
11383
|
+
this.bufferProcessing = false;
|
|
11013
11384
|
|
|
11014
|
-
|
|
11015
|
-
|
|
11385
|
+
// the callback that's passed to _write(chunk,cb)
|
|
11016
11386
|
this.onwrite = function (er) {
|
|
11017
11387
|
onwrite(stream, er);
|
|
11018
|
-
};
|
|
11019
|
-
|
|
11388
|
+
};
|
|
11020
11389
|
|
|
11021
|
-
|
|
11390
|
+
// the callback that the user supplies to write(chunk,encoding,cb)
|
|
11391
|
+
this.writecb = null;
|
|
11022
11392
|
|
|
11393
|
+
// the amount that is being written when _write is called.
|
|
11023
11394
|
this.writelen = 0;
|
|
11024
11395
|
this.bufferedRequest = null;
|
|
11025
|
-
this.lastBufferedRequest = null;
|
|
11396
|
+
this.lastBufferedRequest = null;
|
|
11397
|
+
|
|
11398
|
+
// number of pending user-supplied write callbacks
|
|
11026
11399
|
// this must be 0 before 'finish' can be emitted
|
|
11400
|
+
this.pendingcb = 0;
|
|
11027
11401
|
|
|
11028
|
-
|
|
11402
|
+
// emit prefinish if the only thing we're waiting for is _write cbs
|
|
11029
11403
|
// This is relevant for synchronous Transform streams
|
|
11404
|
+
this.prefinished = false;
|
|
11030
11405
|
|
|
11031
|
-
|
|
11406
|
+
// True if the error was already emitted and should not be thrown again
|
|
11407
|
+
this.errorEmitted = false;
|
|
11032
11408
|
|
|
11033
|
-
|
|
11409
|
+
// Should close be emitted on destroy. Defaults to true.
|
|
11410
|
+
this.emitClose = options.emitClose !== false;
|
|
11034
11411
|
|
|
11035
|
-
|
|
11412
|
+
// Should .destroy() be called after 'finish' (and potentially 'end')
|
|
11413
|
+
this.autoDestroy = !!options.autoDestroy;
|
|
11036
11414
|
|
|
11037
|
-
|
|
11415
|
+
// count buffered requests
|
|
11416
|
+
this.bufferedRequestCount = 0;
|
|
11038
11417
|
|
|
11039
|
-
|
|
11418
|
+
// allocate the first CorkedRequest, there is always
|
|
11040
11419
|
// one allocated and free to use, and we maintain at most two
|
|
11041
|
-
|
|
11042
11420
|
this.corkedRequestsFree = new CorkedRequest(this);
|
|
11043
11421
|
}
|
|
11044
|
-
|
|
11045
11422
|
WritableState.prototype.getBuffer = function getBuffer() {
|
|
11046
11423
|
var current = this.bufferedRequest;
|
|
11047
11424
|
var out = [];
|
|
11048
|
-
|
|
11049
11425
|
while (current) {
|
|
11050
11426
|
out.push(current);
|
|
11051
11427
|
current = current.next;
|
|
11052
11428
|
}
|
|
11053
|
-
|
|
11054
11429
|
return out;
|
|
11055
11430
|
};
|
|
11056
|
-
|
|
11057
11431
|
(function () {
|
|
11058
11432
|
try {
|
|
11059
11433
|
Object.defineProperty(WritableState.prototype, 'buffer', {
|
|
@@ -11062,12 +11436,11 @@ WritableState.prototype.getBuffer = function getBuffer() {
|
|
|
11062
11436
|
}, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
|
|
11063
11437
|
});
|
|
11064
11438
|
} catch (_) {}
|
|
11065
|
-
})();
|
|
11066
|
-
// whose prototype chain only points to Readable.
|
|
11067
|
-
|
|
11439
|
+
})();
|
|
11068
11440
|
|
|
11441
|
+
// Test _writableState for inheritance to account for Duplex streams,
|
|
11442
|
+
// whose prototype chain only points to Readable.
|
|
11069
11443
|
var realHasInstance;
|
|
11070
|
-
|
|
11071
11444
|
if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
|
|
11072
11445
|
realHasInstance = Function.prototype[Symbol.hasInstance];
|
|
11073
11446
|
Object.defineProperty(Writable, Symbol.hasInstance, {
|
|
@@ -11082,81 +11455,73 @@ if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.protot
|
|
|
11082
11455
|
return object instanceof this;
|
|
11083
11456
|
};
|
|
11084
11457
|
}
|
|
11085
|
-
|
|
11086
11458
|
function Writable(options) {
|
|
11087
|
-
Duplex = Duplex || require('./_stream_duplex');
|
|
11459
|
+
Duplex = Duplex || require('./_stream_duplex');
|
|
11460
|
+
|
|
11461
|
+
// Writable ctor is applied to Duplexes, too.
|
|
11088
11462
|
// `realHasInstance` is necessary because using plain `instanceof`
|
|
11089
11463
|
// would return false, as no `_writableState` property is attached.
|
|
11464
|
+
|
|
11090
11465
|
// Trying to use the custom `instanceof` for Writable here will also break the
|
|
11091
11466
|
// Node.js LazyTransform implementation, which has a non-trivial getter for
|
|
11092
11467
|
// `_writableState` that would lead to infinite recursion.
|
|
11468
|
+
|
|
11093
11469
|
// Checking for a Stream.Duplex instance is faster here instead of inside
|
|
11094
11470
|
// the WritableState constructor, at least with V8 6.5
|
|
11095
|
-
|
|
11096
11471
|
var isDuplex = this instanceof Duplex;
|
|
11097
11472
|
if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
|
|
11098
|
-
this._writableState = new WritableState(options, this, isDuplex);
|
|
11473
|
+
this._writableState = new WritableState(options, this, isDuplex);
|
|
11099
11474
|
|
|
11475
|
+
// legacy.
|
|
11100
11476
|
this.writable = true;
|
|
11101
|
-
|
|
11102
11477
|
if (options) {
|
|
11103
11478
|
if (typeof options.write === 'function') this._write = options.write;
|
|
11104
11479
|
if (typeof options.writev === 'function') this._writev = options.writev;
|
|
11105
11480
|
if (typeof options.destroy === 'function') this._destroy = options.destroy;
|
|
11106
11481
|
if (typeof options.final === 'function') this._final = options.final;
|
|
11107
11482
|
}
|
|
11108
|
-
|
|
11109
11483
|
Stream.call(this);
|
|
11110
|
-
}
|
|
11111
|
-
|
|
11484
|
+
}
|
|
11112
11485
|
|
|
11486
|
+
// Otherwise people can pipe Writable streams, which is just wrong.
|
|
11113
11487
|
Writable.prototype.pipe = function () {
|
|
11114
11488
|
errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
|
|
11115
11489
|
};
|
|
11116
|
-
|
|
11117
11490
|
function writeAfterEnd(stream, cb) {
|
|
11118
|
-
var er = new ERR_STREAM_WRITE_AFTER_END();
|
|
11119
|
-
|
|
11491
|
+
var er = new ERR_STREAM_WRITE_AFTER_END();
|
|
11492
|
+
// TODO: defer error events consistently everywhere, not just the cb
|
|
11120
11493
|
errorOrDestroy(stream, er);
|
|
11121
11494
|
process.nextTick(cb, er);
|
|
11122
|
-
}
|
|
11495
|
+
}
|
|
11496
|
+
|
|
11497
|
+
// Checks that a user-supplied chunk is valid, especially for the particular
|
|
11123
11498
|
// mode the stream is in. Currently this means that `null` is never accepted
|
|
11124
11499
|
// and undefined/non-string values are only allowed in object mode.
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
11500
|
function validChunk(stream, state, chunk, cb) {
|
|
11128
11501
|
var er;
|
|
11129
|
-
|
|
11130
11502
|
if (chunk === null) {
|
|
11131
11503
|
er = new ERR_STREAM_NULL_VALUES();
|
|
11132
11504
|
} else if (typeof chunk !== 'string' && !state.objectMode) {
|
|
11133
11505
|
er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);
|
|
11134
11506
|
}
|
|
11135
|
-
|
|
11136
11507
|
if (er) {
|
|
11137
11508
|
errorOrDestroy(stream, er);
|
|
11138
11509
|
process.nextTick(cb, er);
|
|
11139
11510
|
return false;
|
|
11140
11511
|
}
|
|
11141
|
-
|
|
11142
11512
|
return true;
|
|
11143
11513
|
}
|
|
11144
|
-
|
|
11145
11514
|
Writable.prototype.write = function (chunk, encoding, cb) {
|
|
11146
11515
|
var state = this._writableState;
|
|
11147
11516
|
var ret = false;
|
|
11148
|
-
|
|
11149
11517
|
var isBuf = !state.objectMode && _isUint8Array(chunk);
|
|
11150
|
-
|
|
11151
11518
|
if (isBuf && !Buffer.isBuffer(chunk)) {
|
|
11152
11519
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
11153
11520
|
}
|
|
11154
|
-
|
|
11155
11521
|
if (typeof encoding === 'function') {
|
|
11156
11522
|
cb = encoding;
|
|
11157
11523
|
encoding = null;
|
|
11158
11524
|
}
|
|
11159
|
-
|
|
11160
11525
|
if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
|
|
11161
11526
|
if (typeof cb !== 'function') cb = nop;
|
|
11162
11527
|
if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
|
|
@@ -11165,20 +11530,16 @@ Writable.prototype.write = function (chunk, encoding, cb) {
|
|
|
11165
11530
|
}
|
|
11166
11531
|
return ret;
|
|
11167
11532
|
};
|
|
11168
|
-
|
|
11169
11533
|
Writable.prototype.cork = function () {
|
|
11170
11534
|
this._writableState.corked++;
|
|
11171
11535
|
};
|
|
11172
|
-
|
|
11173
11536
|
Writable.prototype.uncork = function () {
|
|
11174
11537
|
var state = this._writableState;
|
|
11175
|
-
|
|
11176
11538
|
if (state.corked) {
|
|
11177
11539
|
state.corked--;
|
|
11178
11540
|
if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
|
|
11179
11541
|
}
|
|
11180
11542
|
};
|
|
11181
|
-
|
|
11182
11543
|
Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
|
|
11183
11544
|
// node::ParseEncoding() requires lower case.
|
|
11184
11545
|
if (typeof encoding === 'string') encoding = encoding.toLowerCase();
|
|
@@ -11186,7 +11547,6 @@ Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
|
|
|
11186
11547
|
this._writableState.defaultEncoding = encoding;
|
|
11187
11548
|
return this;
|
|
11188
11549
|
};
|
|
11189
|
-
|
|
11190
11550
|
Object.defineProperty(Writable.prototype, 'writableBuffer', {
|
|
11191
11551
|
// making it explicit this property is not enumerable
|
|
11192
11552
|
// because otherwise some prototype manipulation in
|
|
@@ -11196,15 +11556,12 @@ Object.defineProperty(Writable.prototype, 'writableBuffer', {
|
|
|
11196
11556
|
return this._writableState && this._writableState.getBuffer();
|
|
11197
11557
|
}
|
|
11198
11558
|
});
|
|
11199
|
-
|
|
11200
11559
|
function decodeChunk(state, chunk, encoding) {
|
|
11201
11560
|
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
|
|
11202
11561
|
chunk = Buffer.from(chunk, encoding);
|
|
11203
11562
|
}
|
|
11204
|
-
|
|
11205
11563
|
return chunk;
|
|
11206
11564
|
}
|
|
11207
|
-
|
|
11208
11565
|
Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
|
|
11209
11566
|
// making it explicit this property is not enumerable
|
|
11210
11567
|
// because otherwise some prototype manipulation in
|
|
@@ -11213,27 +11570,25 @@ Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
|
|
|
11213
11570
|
get: function get() {
|
|
11214
11571
|
return this._writableState.highWaterMark;
|
|
11215
11572
|
}
|
|
11216
|
-
});
|
|
11573
|
+
});
|
|
11574
|
+
|
|
11575
|
+
// if we're already writing something, then just put this
|
|
11217
11576
|
// in the queue, and wait our turn. Otherwise, call _write
|
|
11218
11577
|
// If we return false, then we need a drain event, so set that flag.
|
|
11219
|
-
|
|
11220
11578
|
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
|
|
11221
11579
|
if (!isBuf) {
|
|
11222
11580
|
var newChunk = decodeChunk(state, chunk, encoding);
|
|
11223
|
-
|
|
11224
11581
|
if (chunk !== newChunk) {
|
|
11225
11582
|
isBuf = true;
|
|
11226
11583
|
encoding = 'buffer';
|
|
11227
11584
|
chunk = newChunk;
|
|
11228
11585
|
}
|
|
11229
11586
|
}
|
|
11230
|
-
|
|
11231
11587
|
var len = state.objectMode ? 1 : chunk.length;
|
|
11232
11588
|
state.length += len;
|
|
11233
|
-
var ret = state.length < state.highWaterMark;
|
|
11234
|
-
|
|
11589
|
+
var ret = state.length < state.highWaterMark;
|
|
11590
|
+
// we must ensure that previous needDrain will not be reset to false.
|
|
11235
11591
|
if (!ret) state.needDrain = true;
|
|
11236
|
-
|
|
11237
11592
|
if (state.writing || state.corked) {
|
|
11238
11593
|
var last = state.lastBufferedRequest;
|
|
11239
11594
|
state.lastBufferedRequest = {
|
|
@@ -11243,21 +11598,17 @@ function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
|
|
|
11243
11598
|
callback: cb,
|
|
11244
11599
|
next: null
|
|
11245
11600
|
};
|
|
11246
|
-
|
|
11247
11601
|
if (last) {
|
|
11248
11602
|
last.next = state.lastBufferedRequest;
|
|
11249
11603
|
} else {
|
|
11250
11604
|
state.bufferedRequest = state.lastBufferedRequest;
|
|
11251
11605
|
}
|
|
11252
|
-
|
|
11253
11606
|
state.bufferedRequestCount += 1;
|
|
11254
11607
|
} else {
|
|
11255
11608
|
doWrite(stream, state, false, len, chunk, encoding, cb);
|
|
11256
11609
|
}
|
|
11257
|
-
|
|
11258
11610
|
return ret;
|
|
11259
11611
|
}
|
|
11260
|
-
|
|
11261
11612
|
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
|
|
11262
11613
|
state.writelen = len;
|
|
11263
11614
|
state.writecb = cb;
|
|
@@ -11266,16 +11617,14 @@ function doWrite(stream, state, writev, len, chunk, encoding, cb) {
|
|
|
11266
11617
|
if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
|
|
11267
11618
|
state.sync = false;
|
|
11268
11619
|
}
|
|
11269
|
-
|
|
11270
11620
|
function onwriteError(stream, state, sync, er, cb) {
|
|
11271
11621
|
--state.pendingcb;
|
|
11272
|
-
|
|
11273
11622
|
if (sync) {
|
|
11274
11623
|
// defer the callback if we are being called synchronously
|
|
11275
11624
|
// to avoid piling up things on the stack
|
|
11276
|
-
process.nextTick(cb, er);
|
|
11625
|
+
process.nextTick(cb, er);
|
|
11626
|
+
// this can emit finish, and it will always happen
|
|
11277
11627
|
// after error
|
|
11278
|
-
|
|
11279
11628
|
process.nextTick(finishMaybe, stream, state);
|
|
11280
11629
|
stream._writableState.errorEmitted = true;
|
|
11281
11630
|
errorOrDestroy(stream, er);
|
|
@@ -11284,20 +11633,18 @@ function onwriteError(stream, state, sync, er, cb) {
|
|
|
11284
11633
|
// it is async
|
|
11285
11634
|
cb(er);
|
|
11286
11635
|
stream._writableState.errorEmitted = true;
|
|
11287
|
-
errorOrDestroy(stream, er);
|
|
11636
|
+
errorOrDestroy(stream, er);
|
|
11637
|
+
// this can emit finish, but finish must
|
|
11288
11638
|
// always follow error
|
|
11289
|
-
|
|
11290
11639
|
finishMaybe(stream, state);
|
|
11291
11640
|
}
|
|
11292
11641
|
}
|
|
11293
|
-
|
|
11294
11642
|
function onwriteStateUpdate(state) {
|
|
11295
11643
|
state.writing = false;
|
|
11296
11644
|
state.writecb = null;
|
|
11297
11645
|
state.length -= state.writelen;
|
|
11298
11646
|
state.writelen = 0;
|
|
11299
11647
|
}
|
|
11300
|
-
|
|
11301
11648
|
function onwrite(stream, er) {
|
|
11302
11649
|
var state = stream._writableState;
|
|
11303
11650
|
var sync = state.sync;
|
|
@@ -11307,11 +11654,9 @@ function onwrite(stream, er) {
|
|
|
11307
11654
|
if (er) onwriteError(stream, state, sync, er, cb);else {
|
|
11308
11655
|
// Check if we're actually ready to finish, but don't emit yet
|
|
11309
11656
|
var finished = needFinish(state) || stream.destroyed;
|
|
11310
|
-
|
|
11311
11657
|
if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
|
|
11312
11658
|
clearBuffer(stream, state);
|
|
11313
11659
|
}
|
|
11314
|
-
|
|
11315
11660
|
if (sync) {
|
|
11316
11661
|
process.nextTick(afterWrite, stream, state, finished, cb);
|
|
11317
11662
|
} else {
|
|
@@ -11319,29 +11664,27 @@ function onwrite(stream, er) {
|
|
|
11319
11664
|
}
|
|
11320
11665
|
}
|
|
11321
11666
|
}
|
|
11322
|
-
|
|
11323
11667
|
function afterWrite(stream, state, finished, cb) {
|
|
11324
11668
|
if (!finished) onwriteDrain(stream, state);
|
|
11325
11669
|
state.pendingcb--;
|
|
11326
11670
|
cb();
|
|
11327
11671
|
finishMaybe(stream, state);
|
|
11328
|
-
}
|
|
11672
|
+
}
|
|
11673
|
+
|
|
11674
|
+
// Must force callback to be called on nextTick, so that we don't
|
|
11329
11675
|
// emit 'drain' before the write() consumer gets the 'false' return
|
|
11330
11676
|
// value, and has a chance to attach a 'drain' listener.
|
|
11331
|
-
|
|
11332
|
-
|
|
11333
11677
|
function onwriteDrain(stream, state) {
|
|
11334
11678
|
if (state.length === 0 && state.needDrain) {
|
|
11335
11679
|
state.needDrain = false;
|
|
11336
11680
|
stream.emit('drain');
|
|
11337
11681
|
}
|
|
11338
|
-
}
|
|
11339
|
-
|
|
11682
|
+
}
|
|
11340
11683
|
|
|
11684
|
+
// if there's something in the buffer waiting, then process it
|
|
11341
11685
|
function clearBuffer(stream, state) {
|
|
11342
11686
|
state.bufferProcessing = true;
|
|
11343
11687
|
var entry = state.bufferedRequest;
|
|
11344
|
-
|
|
11345
11688
|
if (stream._writev && entry && entry.next) {
|
|
11346
11689
|
// Fast case, write everything using _writev()
|
|
11347
11690
|
var l = state.bufferedRequestCount;
|
|
@@ -11350,28 +11693,25 @@ function clearBuffer(stream, state) {
|
|
|
11350
11693
|
holder.entry = entry;
|
|
11351
11694
|
var count = 0;
|
|
11352
11695
|
var allBuffers = true;
|
|
11353
|
-
|
|
11354
11696
|
while (entry) {
|
|
11355
11697
|
buffer[count] = entry;
|
|
11356
11698
|
if (!entry.isBuf) allBuffers = false;
|
|
11357
11699
|
entry = entry.next;
|
|
11358
11700
|
count += 1;
|
|
11359
11701
|
}
|
|
11360
|
-
|
|
11361
11702
|
buffer.allBuffers = allBuffers;
|
|
11362
|
-
doWrite(stream, state, true, state.length, buffer, '', holder.finish);
|
|
11363
|
-
// as the hot path ends with doWrite
|
|
11703
|
+
doWrite(stream, state, true, state.length, buffer, '', holder.finish);
|
|
11364
11704
|
|
|
11705
|
+
// doWrite is almost always async, defer these to save a bit of time
|
|
11706
|
+
// as the hot path ends with doWrite
|
|
11365
11707
|
state.pendingcb++;
|
|
11366
11708
|
state.lastBufferedRequest = null;
|
|
11367
|
-
|
|
11368
11709
|
if (holder.next) {
|
|
11369
11710
|
state.corkedRequestsFree = holder.next;
|
|
11370
11711
|
holder.next = null;
|
|
11371
11712
|
} else {
|
|
11372
11713
|
state.corkedRequestsFree = new CorkedRequest(state);
|
|
11373
11714
|
}
|
|
11374
|
-
|
|
11375
11715
|
state.bufferedRequestCount = 0;
|
|
11376
11716
|
} else {
|
|
11377
11717
|
// Slow case, write chunks one-by-one
|
|
@@ -11382,32 +11722,26 @@ function clearBuffer(stream, state) {
|
|
|
11382
11722
|
var len = state.objectMode ? 1 : chunk.length;
|
|
11383
11723
|
doWrite(stream, state, false, len, chunk, encoding, cb);
|
|
11384
11724
|
entry = entry.next;
|
|
11385
|
-
state.bufferedRequestCount--;
|
|
11725
|
+
state.bufferedRequestCount--;
|
|
11726
|
+
// if we didn't call the onwrite immediately, then
|
|
11386
11727
|
// it means that we need to wait until it does.
|
|
11387
11728
|
// also, that means that the chunk and cb are currently
|
|
11388
11729
|
// being processed, so move the buffer counter past them.
|
|
11389
|
-
|
|
11390
11730
|
if (state.writing) {
|
|
11391
11731
|
break;
|
|
11392
11732
|
}
|
|
11393
11733
|
}
|
|
11394
|
-
|
|
11395
11734
|
if (entry === null) state.lastBufferedRequest = null;
|
|
11396
11735
|
}
|
|
11397
|
-
|
|
11398
11736
|
state.bufferedRequest = entry;
|
|
11399
11737
|
state.bufferProcessing = false;
|
|
11400
11738
|
}
|
|
11401
|
-
|
|
11402
11739
|
Writable.prototype._write = function (chunk, encoding, cb) {
|
|
11403
11740
|
cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));
|
|
11404
11741
|
};
|
|
11405
|
-
|
|
11406
11742
|
Writable.prototype._writev = null;
|
|
11407
|
-
|
|
11408
11743
|
Writable.prototype.end = function (chunk, encoding, cb) {
|
|
11409
11744
|
var state = this._writableState;
|
|
11410
|
-
|
|
11411
11745
|
if (typeof chunk === 'function') {
|
|
11412
11746
|
cb = chunk;
|
|
11413
11747
|
chunk = null;
|
|
@@ -11416,19 +11750,18 @@ Writable.prototype.end = function (chunk, encoding, cb) {
|
|
|
11416
11750
|
cb = encoding;
|
|
11417
11751
|
encoding = null;
|
|
11418
11752
|
}
|
|
11753
|
+
if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
|
|
11419
11754
|
|
|
11420
|
-
|
|
11421
|
-
|
|
11755
|
+
// .end() fully uncorks
|
|
11422
11756
|
if (state.corked) {
|
|
11423
11757
|
state.corked = 1;
|
|
11424
11758
|
this.uncork();
|
|
11425
|
-
}
|
|
11426
|
-
|
|
11759
|
+
}
|
|
11427
11760
|
|
|
11761
|
+
// ignore unnecessary end() calls.
|
|
11428
11762
|
if (!state.ending) endWritable(this, state, cb);
|
|
11429
11763
|
return this;
|
|
11430
11764
|
};
|
|
11431
|
-
|
|
11432
11765
|
Object.defineProperty(Writable.prototype, 'writableLength', {
|
|
11433
11766
|
// making it explicit this property is not enumerable
|
|
11434
11767
|
// because otherwise some prototype manipulation in
|
|
@@ -11438,25 +11771,20 @@ Object.defineProperty(Writable.prototype, 'writableLength', {
|
|
|
11438
11771
|
return this._writableState.length;
|
|
11439
11772
|
}
|
|
11440
11773
|
});
|
|
11441
|
-
|
|
11442
11774
|
function needFinish(state) {
|
|
11443
11775
|
return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
|
|
11444
11776
|
}
|
|
11445
|
-
|
|
11446
11777
|
function callFinal(stream, state) {
|
|
11447
11778
|
stream._final(function (err) {
|
|
11448
11779
|
state.pendingcb--;
|
|
11449
|
-
|
|
11450
11780
|
if (err) {
|
|
11451
11781
|
errorOrDestroy(stream, err);
|
|
11452
11782
|
}
|
|
11453
|
-
|
|
11454
11783
|
state.prefinished = true;
|
|
11455
11784
|
stream.emit('prefinish');
|
|
11456
11785
|
finishMaybe(stream, state);
|
|
11457
11786
|
});
|
|
11458
11787
|
}
|
|
11459
|
-
|
|
11460
11788
|
function prefinish(stream, state) {
|
|
11461
11789
|
if (!state.prefinished && !state.finalCalled) {
|
|
11462
11790
|
if (typeof stream._final === 'function' && !state.destroyed) {
|
|
@@ -11469,59 +11797,47 @@ function prefinish(stream, state) {
|
|
|
11469
11797
|
}
|
|
11470
11798
|
}
|
|
11471
11799
|
}
|
|
11472
|
-
|
|
11473
11800
|
function finishMaybe(stream, state) {
|
|
11474
11801
|
var need = needFinish(state);
|
|
11475
|
-
|
|
11476
11802
|
if (need) {
|
|
11477
11803
|
prefinish(stream, state);
|
|
11478
|
-
|
|
11479
11804
|
if (state.pendingcb === 0) {
|
|
11480
11805
|
state.finished = true;
|
|
11481
11806
|
stream.emit('finish');
|
|
11482
|
-
|
|
11483
11807
|
if (state.autoDestroy) {
|
|
11484
11808
|
// In case of duplex streams we need a way to detect
|
|
11485
11809
|
// if the readable side is ready for autoDestroy as well
|
|
11486
11810
|
var rState = stream._readableState;
|
|
11487
|
-
|
|
11488
11811
|
if (!rState || rState.autoDestroy && rState.endEmitted) {
|
|
11489
11812
|
stream.destroy();
|
|
11490
11813
|
}
|
|
11491
11814
|
}
|
|
11492
11815
|
}
|
|
11493
11816
|
}
|
|
11494
|
-
|
|
11495
11817
|
return need;
|
|
11496
11818
|
}
|
|
11497
|
-
|
|
11498
11819
|
function endWritable(stream, state, cb) {
|
|
11499
11820
|
state.ending = true;
|
|
11500
11821
|
finishMaybe(stream, state);
|
|
11501
|
-
|
|
11502
11822
|
if (cb) {
|
|
11503
11823
|
if (state.finished) process.nextTick(cb);else stream.once('finish', cb);
|
|
11504
11824
|
}
|
|
11505
|
-
|
|
11506
11825
|
state.ended = true;
|
|
11507
11826
|
stream.writable = false;
|
|
11508
11827
|
}
|
|
11509
|
-
|
|
11510
11828
|
function onCorkedFinish(corkReq, state, err) {
|
|
11511
11829
|
var entry = corkReq.entry;
|
|
11512
11830
|
corkReq.entry = null;
|
|
11513
|
-
|
|
11514
11831
|
while (entry) {
|
|
11515
11832
|
var cb = entry.callback;
|
|
11516
11833
|
state.pendingcb--;
|
|
11517
11834
|
cb(err);
|
|
11518
11835
|
entry = entry.next;
|
|
11519
|
-
}
|
|
11520
|
-
|
|
11836
|
+
}
|
|
11521
11837
|
|
|
11838
|
+
// reuse the free corkReq.
|
|
11522
11839
|
state.corkedRequestsFree.next = corkReq;
|
|
11523
11840
|
}
|
|
11524
|
-
|
|
11525
11841
|
Object.defineProperty(Writable.prototype, 'destroyed', {
|
|
11526
11842
|
// making it explicit this property is not enumerable
|
|
11527
11843
|
// because otherwise some prototype manipulation in
|
|
@@ -11531,7 +11847,6 @@ Object.defineProperty(Writable.prototype, 'destroyed', {
|
|
|
11531
11847
|
if (this._writableState === undefined) {
|
|
11532
11848
|
return false;
|
|
11533
11849
|
}
|
|
11534
|
-
|
|
11535
11850
|
return this._writableState.destroyed;
|
|
11536
11851
|
},
|
|
11537
11852
|
set: function set(value) {
|
|
@@ -11539,30 +11854,28 @@ Object.defineProperty(Writable.prototype, 'destroyed', {
|
|
|
11539
11854
|
// has not been initialized yet
|
|
11540
11855
|
if (!this._writableState) {
|
|
11541
11856
|
return;
|
|
11542
|
-
}
|
|
11543
|
-
// managing destroyed
|
|
11544
|
-
|
|
11857
|
+
}
|
|
11545
11858
|
|
|
11859
|
+
// backward compatibility, the user is explicitly
|
|
11860
|
+
// managing destroyed
|
|
11546
11861
|
this._writableState.destroyed = value;
|
|
11547
11862
|
}
|
|
11548
11863
|
});
|
|
11549
11864
|
Writable.prototype.destroy = destroyImpl.destroy;
|
|
11550
11865
|
Writable.prototype._undestroy = destroyImpl.undestroy;
|
|
11551
|
-
|
|
11552
11866
|
Writable.prototype._destroy = function (err, cb) {
|
|
11553
11867
|
cb(err);
|
|
11554
11868
|
};
|
|
11555
11869
|
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
11556
|
-
},{"../errors":
|
|
11870
|
+
},{"../errors":62,"./_stream_duplex":63,"./internal/streams/destroy":70,"./internal/streams/state":74,"./internal/streams/stream":75,"_process":58,"buffer":9,"inherits":36,"util-deprecate":79}],68:[function(require,module,exports){
|
|
11557
11871
|
(function (process){(function (){
|
|
11558
11872
|
'use strict';
|
|
11559
11873
|
|
|
11560
11874
|
var _Object$setPrototypeO;
|
|
11561
|
-
|
|
11562
|
-
function
|
|
11563
|
-
|
|
11875
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11876
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
11877
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11564
11878
|
var finished = require('./end-of-stream');
|
|
11565
|
-
|
|
11566
11879
|
var kLastResolve = Symbol('lastResolve');
|
|
11567
11880
|
var kLastReject = Symbol('lastReject');
|
|
11568
11881
|
var kError = Symbol('error');
|
|
@@ -11570,22 +11883,19 @@ var kEnded = Symbol('ended');
|
|
|
11570
11883
|
var kLastPromise = Symbol('lastPromise');
|
|
11571
11884
|
var kHandlePromise = Symbol('handlePromise');
|
|
11572
11885
|
var kStream = Symbol('stream');
|
|
11573
|
-
|
|
11574
11886
|
function createIterResult(value, done) {
|
|
11575
11887
|
return {
|
|
11576
11888
|
value: value,
|
|
11577
11889
|
done: done
|
|
11578
11890
|
};
|
|
11579
11891
|
}
|
|
11580
|
-
|
|
11581
11892
|
function readAndResolve(iter) {
|
|
11582
11893
|
var resolve = iter[kLastResolve];
|
|
11583
|
-
|
|
11584
11894
|
if (resolve !== null) {
|
|
11585
|
-
var data = iter[kStream].read();
|
|
11895
|
+
var data = iter[kStream].read();
|
|
11896
|
+
// we defer if data is null
|
|
11586
11897
|
// we can be expecting either 'end' or
|
|
11587
11898
|
// 'error'
|
|
11588
|
-
|
|
11589
11899
|
if (data !== null) {
|
|
11590
11900
|
iter[kLastPromise] = null;
|
|
11591
11901
|
iter[kLastResolve] = null;
|
|
@@ -11594,13 +11904,11 @@ function readAndResolve(iter) {
|
|
|
11594
11904
|
}
|
|
11595
11905
|
}
|
|
11596
11906
|
}
|
|
11597
|
-
|
|
11598
11907
|
function onReadable(iter) {
|
|
11599
11908
|
// we wait for the next tick, because it might
|
|
11600
11909
|
// emit an error with process.nextTick
|
|
11601
11910
|
process.nextTick(readAndResolve, iter);
|
|
11602
11911
|
}
|
|
11603
|
-
|
|
11604
11912
|
function wrapForNext(lastPromise, iter) {
|
|
11605
11913
|
return function (resolve, reject) {
|
|
11606
11914
|
lastPromise.then(function () {
|
|
@@ -11608,33 +11916,26 @@ function wrapForNext(lastPromise, iter) {
|
|
|
11608
11916
|
resolve(createIterResult(undefined, true));
|
|
11609
11917
|
return;
|
|
11610
11918
|
}
|
|
11611
|
-
|
|
11612
11919
|
iter[kHandlePromise](resolve, reject);
|
|
11613
11920
|
}, reject);
|
|
11614
11921
|
};
|
|
11615
11922
|
}
|
|
11616
|
-
|
|
11617
11923
|
var AsyncIteratorPrototype = Object.getPrototypeOf(function () {});
|
|
11618
11924
|
var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
|
|
11619
11925
|
get stream() {
|
|
11620
11926
|
return this[kStream];
|
|
11621
11927
|
},
|
|
11622
|
-
|
|
11623
11928
|
next: function next() {
|
|
11624
11929
|
var _this = this;
|
|
11625
|
-
|
|
11626
11930
|
// if we have detected an error in the meanwhile
|
|
11627
11931
|
// reject straight away
|
|
11628
11932
|
var error = this[kError];
|
|
11629
|
-
|
|
11630
11933
|
if (error !== null) {
|
|
11631
11934
|
return Promise.reject(error);
|
|
11632
11935
|
}
|
|
11633
|
-
|
|
11634
11936
|
if (this[kEnded]) {
|
|
11635
11937
|
return Promise.resolve(createIterResult(undefined, true));
|
|
11636
11938
|
}
|
|
11637
|
-
|
|
11638
11939
|
if (this[kStream].destroyed) {
|
|
11639
11940
|
// We need to defer via nextTick because if .destroy(err) is
|
|
11640
11941
|
// called, the error will be emitted via nextTick, and
|
|
@@ -11649,29 +11950,25 @@ var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPro
|
|
|
11649
11950
|
}
|
|
11650
11951
|
});
|
|
11651
11952
|
});
|
|
11652
|
-
}
|
|
11953
|
+
}
|
|
11954
|
+
|
|
11955
|
+
// if we have multiple next() calls
|
|
11653
11956
|
// we will wait for the previous Promise to finish
|
|
11654
11957
|
// this logic is optimized to support for await loops,
|
|
11655
11958
|
// where next() is only called once at a time
|
|
11656
|
-
|
|
11657
|
-
|
|
11658
11959
|
var lastPromise = this[kLastPromise];
|
|
11659
11960
|
var promise;
|
|
11660
|
-
|
|
11661
11961
|
if (lastPromise) {
|
|
11662
11962
|
promise = new Promise(wrapForNext(lastPromise, this));
|
|
11663
11963
|
} else {
|
|
11664
11964
|
// fast path needed to support multiple this.push()
|
|
11665
11965
|
// without triggering the next() queue
|
|
11666
11966
|
var data = this[kStream].read();
|
|
11667
|
-
|
|
11668
11967
|
if (data !== null) {
|
|
11669
11968
|
return Promise.resolve(createIterResult(data, false));
|
|
11670
11969
|
}
|
|
11671
|
-
|
|
11672
11970
|
promise = new Promise(this[kHandlePromise]);
|
|
11673
11971
|
}
|
|
11674
|
-
|
|
11675
11972
|
this[kLastPromise] = promise;
|
|
11676
11973
|
return promise;
|
|
11677
11974
|
}
|
|
@@ -11679,7 +11976,6 @@ var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPro
|
|
|
11679
11976
|
return this;
|
|
11680
11977
|
}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
|
|
11681
11978
|
var _this2 = this;
|
|
11682
|
-
|
|
11683
11979
|
// destroy(err, cb) is a private API
|
|
11684
11980
|
// we can guarantee we have that here, because we control the
|
|
11685
11981
|
// Readable class this is attached to
|
|
@@ -11689,15 +11985,12 @@ var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPro
|
|
|
11689
11985
|
reject(err);
|
|
11690
11986
|
return;
|
|
11691
11987
|
}
|
|
11692
|
-
|
|
11693
11988
|
resolve(createIterResult(undefined, true));
|
|
11694
11989
|
});
|
|
11695
11990
|
});
|
|
11696
11991
|
}), _Object$setPrototypeO), AsyncIteratorPrototype);
|
|
11697
|
-
|
|
11698
11992
|
var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {
|
|
11699
11993
|
var _Object$create;
|
|
11700
|
-
|
|
11701
11994
|
var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
|
|
11702
11995
|
value: stream,
|
|
11703
11996
|
writable: true
|
|
@@ -11716,7 +12009,6 @@ var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterat
|
|
|
11716
12009
|
}), _defineProperty(_Object$create, kHandlePromise, {
|
|
11717
12010
|
value: function value(resolve, reject) {
|
|
11718
12011
|
var data = iterator[kStream].read();
|
|
11719
|
-
|
|
11720
12012
|
if (data) {
|
|
11721
12013
|
iterator[kLastPromise] = null;
|
|
11722
12014
|
iterator[kLastResolve] = null;
|
|
@@ -11732,75 +12024,58 @@ var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterat
|
|
|
11732
12024
|
iterator[kLastPromise] = null;
|
|
11733
12025
|
finished(stream, function (err) {
|
|
11734
12026
|
if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
|
|
11735
|
-
var reject = iterator[kLastReject];
|
|
12027
|
+
var reject = iterator[kLastReject];
|
|
12028
|
+
// reject if we are waiting for data in the Promise
|
|
11736
12029
|
// returned by next() and store the error
|
|
11737
|
-
|
|
11738
12030
|
if (reject !== null) {
|
|
11739
12031
|
iterator[kLastPromise] = null;
|
|
11740
12032
|
iterator[kLastResolve] = null;
|
|
11741
12033
|
iterator[kLastReject] = null;
|
|
11742
12034
|
reject(err);
|
|
11743
12035
|
}
|
|
11744
|
-
|
|
11745
12036
|
iterator[kError] = err;
|
|
11746
12037
|
return;
|
|
11747
12038
|
}
|
|
11748
|
-
|
|
11749
12039
|
var resolve = iterator[kLastResolve];
|
|
11750
|
-
|
|
11751
12040
|
if (resolve !== null) {
|
|
11752
12041
|
iterator[kLastPromise] = null;
|
|
11753
12042
|
iterator[kLastResolve] = null;
|
|
11754
12043
|
iterator[kLastReject] = null;
|
|
11755
12044
|
resolve(createIterResult(undefined, true));
|
|
11756
12045
|
}
|
|
11757
|
-
|
|
11758
12046
|
iterator[kEnded] = true;
|
|
11759
12047
|
});
|
|
11760
12048
|
stream.on('readable', onReadable.bind(null, iterator));
|
|
11761
12049
|
return iterator;
|
|
11762
12050
|
};
|
|
11763
|
-
|
|
11764
12051
|
module.exports = createReadableStreamAsyncIterator;
|
|
11765
12052
|
}).call(this)}).call(this,require('_process'))
|
|
11766
|
-
},{"./end-of-stream":
|
|
12053
|
+
},{"./end-of-stream":71,"_process":58}],69:[function(require,module,exports){
|
|
11767
12054
|
'use strict';
|
|
11768
12055
|
|
|
11769
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
11770
|
-
|
|
11771
|
-
function
|
|
11772
|
-
|
|
11773
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11774
|
-
|
|
12056
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12057
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12058
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11775
12059
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11776
|
-
|
|
11777
|
-
function
|
|
11778
|
-
|
|
11779
|
-
function
|
|
11780
|
-
|
|
12060
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12061
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12062
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12063
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11781
12064
|
var _require = require('buffer'),
|
|
11782
|
-
|
|
11783
|
-
|
|
12065
|
+
Buffer = _require.Buffer;
|
|
11784
12066
|
var _require2 = require('util'),
|
|
11785
|
-
|
|
11786
|
-
|
|
12067
|
+
inspect = _require2.inspect;
|
|
11787
12068
|
var custom = inspect && inspect.custom || 'inspect';
|
|
11788
|
-
|
|
11789
12069
|
function copyBuffer(src, target, offset) {
|
|
11790
12070
|
Buffer.prototype.copy.call(src, target, offset);
|
|
11791
12071
|
}
|
|
11792
|
-
|
|
11793
|
-
module.exports =
|
|
11794
|
-
/*#__PURE__*/
|
|
11795
|
-
function () {
|
|
12072
|
+
module.exports = /*#__PURE__*/function () {
|
|
11796
12073
|
function BufferList() {
|
|
11797
12074
|
_classCallCheck(this, BufferList);
|
|
11798
|
-
|
|
11799
12075
|
this.head = null;
|
|
11800
12076
|
this.tail = null;
|
|
11801
12077
|
this.length = 0;
|
|
11802
12078
|
}
|
|
11803
|
-
|
|
11804
12079
|
_createClass(BufferList, [{
|
|
11805
12080
|
key: "push",
|
|
11806
12081
|
value: function push(v) {
|
|
@@ -11844,11 +12119,7 @@ function () {
|
|
|
11844
12119
|
if (this.length === 0) return '';
|
|
11845
12120
|
var p = this.head;
|
|
11846
12121
|
var ret = '' + p.data;
|
|
11847
|
-
|
|
11848
|
-
while (p = p.next) {
|
|
11849
|
-
ret += s + p.data;
|
|
11850
|
-
}
|
|
11851
|
-
|
|
12122
|
+
while (p = p.next) ret += s + p.data;
|
|
11852
12123
|
return ret;
|
|
11853
12124
|
}
|
|
11854
12125
|
}, {
|
|
@@ -11858,21 +12129,19 @@ function () {
|
|
|
11858
12129
|
var ret = Buffer.allocUnsafe(n >>> 0);
|
|
11859
12130
|
var p = this.head;
|
|
11860
12131
|
var i = 0;
|
|
11861
|
-
|
|
11862
12132
|
while (p) {
|
|
11863
12133
|
copyBuffer(p.data, ret, i);
|
|
11864
12134
|
i += p.data.length;
|
|
11865
12135
|
p = p.next;
|
|
11866
12136
|
}
|
|
11867
|
-
|
|
11868
12137
|
return ret;
|
|
11869
|
-
}
|
|
12138
|
+
}
|
|
11870
12139
|
|
|
12140
|
+
// Consumes a specified amount of bytes or characters from the buffered data.
|
|
11871
12141
|
}, {
|
|
11872
12142
|
key: "consume",
|
|
11873
12143
|
value: function consume(n, hasStrings) {
|
|
11874
12144
|
var ret;
|
|
11875
|
-
|
|
11876
12145
|
if (n < this.head.data.length) {
|
|
11877
12146
|
// `slice` is the same for buffers and strings.
|
|
11878
12147
|
ret = this.head.data.slice(0, n);
|
|
@@ -11884,15 +12153,15 @@ function () {
|
|
|
11884
12153
|
// Result spans more than one buffer.
|
|
11885
12154
|
ret = hasStrings ? this._getString(n) : this._getBuffer(n);
|
|
11886
12155
|
}
|
|
11887
|
-
|
|
11888
12156
|
return ret;
|
|
11889
12157
|
}
|
|
11890
12158
|
}, {
|
|
11891
12159
|
key: "first",
|
|
11892
12160
|
value: function first() {
|
|
11893
12161
|
return this.head.data;
|
|
11894
|
-
}
|
|
12162
|
+
}
|
|
11895
12163
|
|
|
12164
|
+
// Consumes a specified amount of characters from the buffered data.
|
|
11896
12165
|
}, {
|
|
11897
12166
|
key: "_getString",
|
|
11898
12167
|
value: function _getString(n) {
|
|
@@ -11900,13 +12169,11 @@ function () {
|
|
|
11900
12169
|
var c = 1;
|
|
11901
12170
|
var ret = p.data;
|
|
11902
12171
|
n -= ret.length;
|
|
11903
|
-
|
|
11904
12172
|
while (p = p.next) {
|
|
11905
12173
|
var str = p.data;
|
|
11906
12174
|
var nb = n > str.length ? str.length : n;
|
|
11907
12175
|
if (nb === str.length) ret += str;else ret += str.slice(0, n);
|
|
11908
12176
|
n -= nb;
|
|
11909
|
-
|
|
11910
12177
|
if (n === 0) {
|
|
11911
12178
|
if (nb === str.length) {
|
|
11912
12179
|
++c;
|
|
@@ -11915,17 +12182,15 @@ function () {
|
|
|
11915
12182
|
this.head = p;
|
|
11916
12183
|
p.data = str.slice(nb);
|
|
11917
12184
|
}
|
|
11918
|
-
|
|
11919
12185
|
break;
|
|
11920
12186
|
}
|
|
11921
|
-
|
|
11922
12187
|
++c;
|
|
11923
12188
|
}
|
|
11924
|
-
|
|
11925
12189
|
this.length -= c;
|
|
11926
12190
|
return ret;
|
|
11927
|
-
}
|
|
12191
|
+
}
|
|
11928
12192
|
|
|
12193
|
+
// Consumes a specified amount of bytes from the buffered data.
|
|
11929
12194
|
}, {
|
|
11930
12195
|
key: "_getBuffer",
|
|
11931
12196
|
value: function _getBuffer(n) {
|
|
@@ -11934,13 +12199,11 @@ function () {
|
|
|
11934
12199
|
var c = 1;
|
|
11935
12200
|
p.data.copy(ret);
|
|
11936
12201
|
n -= p.data.length;
|
|
11937
|
-
|
|
11938
12202
|
while (p = p.next) {
|
|
11939
12203
|
var buf = p.data;
|
|
11940
12204
|
var nb = n > buf.length ? buf.length : n;
|
|
11941
12205
|
buf.copy(ret, ret.length - n, 0, nb);
|
|
11942
12206
|
n -= nb;
|
|
11943
|
-
|
|
11944
12207
|
if (n === 0) {
|
|
11945
12208
|
if (nb === buf.length) {
|
|
11946
12209
|
++c;
|
|
@@ -11949,21 +12212,19 @@ function () {
|
|
|
11949
12212
|
this.head = p;
|
|
11950
12213
|
p.data = buf.slice(nb);
|
|
11951
12214
|
}
|
|
11952
|
-
|
|
11953
12215
|
break;
|
|
11954
12216
|
}
|
|
11955
|
-
|
|
11956
12217
|
++c;
|
|
11957
12218
|
}
|
|
11958
|
-
|
|
11959
12219
|
this.length -= c;
|
|
11960
12220
|
return ret;
|
|
11961
|
-
}
|
|
12221
|
+
}
|
|
11962
12222
|
|
|
12223
|
+
// Make sure the linked list only shows the minimal necessary information.
|
|
11963
12224
|
}, {
|
|
11964
12225
|
key: custom,
|
|
11965
12226
|
value: function value(_, options) {
|
|
11966
|
-
return inspect(this, _objectSpread({}, options, {
|
|
12227
|
+
return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
|
|
11967
12228
|
// Only inspect one level.
|
|
11968
12229
|
depth: 0,
|
|
11969
12230
|
// It should not recurse.
|
|
@@ -11971,19 +12232,17 @@ function () {
|
|
|
11971
12232
|
}));
|
|
11972
12233
|
}
|
|
11973
12234
|
}]);
|
|
11974
|
-
|
|
11975
12235
|
return BufferList;
|
|
11976
12236
|
}();
|
|
11977
|
-
},{"buffer":9,"util":7}],
|
|
12237
|
+
},{"buffer":9,"util":7}],70:[function(require,module,exports){
|
|
11978
12238
|
(function (process){(function (){
|
|
11979
|
-
'use strict';
|
|
12239
|
+
'use strict';
|
|
11980
12240
|
|
|
12241
|
+
// undocumented cb() API, needed for core, not for public API
|
|
11981
12242
|
function destroy(err, cb) {
|
|
11982
12243
|
var _this = this;
|
|
11983
|
-
|
|
11984
12244
|
var readableDestroyed = this._readableState && this._readableState.destroyed;
|
|
11985
12245
|
var writableDestroyed = this._writableState && this._writableState.destroyed;
|
|
11986
|
-
|
|
11987
12246
|
if (readableDestroyed || writableDestroyed) {
|
|
11988
12247
|
if (cb) {
|
|
11989
12248
|
cb(err);
|
|
@@ -11995,21 +12254,20 @@ function destroy(err, cb) {
|
|
|
11995
12254
|
process.nextTick(emitErrorNT, this, err);
|
|
11996
12255
|
}
|
|
11997
12256
|
}
|
|
11998
|
-
|
|
11999
12257
|
return this;
|
|
12000
|
-
}
|
|
12001
|
-
// to make it re-entrance safe in case destroy() is called within callbacks
|
|
12258
|
+
}
|
|
12002
12259
|
|
|
12260
|
+
// we set destroyed to true before firing error callbacks in order
|
|
12261
|
+
// to make it re-entrance safe in case destroy() is called within callbacks
|
|
12003
12262
|
|
|
12004
12263
|
if (this._readableState) {
|
|
12005
12264
|
this._readableState.destroyed = true;
|
|
12006
|
-
}
|
|
12007
|
-
|
|
12265
|
+
}
|
|
12008
12266
|
|
|
12267
|
+
// if this is a duplex stream mark the writable part as destroyed as well
|
|
12009
12268
|
if (this._writableState) {
|
|
12010
12269
|
this._writableState.destroyed = true;
|
|
12011
12270
|
}
|
|
12012
|
-
|
|
12013
12271
|
this._destroy(err || null, function (err) {
|
|
12014
12272
|
if (!cb && err) {
|
|
12015
12273
|
if (!_this._writableState) {
|
|
@@ -12027,21 +12285,17 @@ function destroy(err, cb) {
|
|
|
12027
12285
|
process.nextTick(emitCloseNT, _this);
|
|
12028
12286
|
}
|
|
12029
12287
|
});
|
|
12030
|
-
|
|
12031
12288
|
return this;
|
|
12032
12289
|
}
|
|
12033
|
-
|
|
12034
12290
|
function emitErrorAndCloseNT(self, err) {
|
|
12035
12291
|
emitErrorNT(self, err);
|
|
12036
12292
|
emitCloseNT(self);
|
|
12037
12293
|
}
|
|
12038
|
-
|
|
12039
12294
|
function emitCloseNT(self) {
|
|
12040
12295
|
if (self._writableState && !self._writableState.emitClose) return;
|
|
12041
12296
|
if (self._readableState && !self._readableState.emitClose) return;
|
|
12042
12297
|
self.emit('close');
|
|
12043
12298
|
}
|
|
12044
|
-
|
|
12045
12299
|
function undestroy() {
|
|
12046
12300
|
if (this._readableState) {
|
|
12047
12301
|
this._readableState.destroyed = false;
|
|
@@ -12049,7 +12303,6 @@ function undestroy() {
|
|
|
12049
12303
|
this._readableState.ended = false;
|
|
12050
12304
|
this._readableState.endEmitted = false;
|
|
12051
12305
|
}
|
|
12052
|
-
|
|
12053
12306
|
if (this._writableState) {
|
|
12054
12307
|
this._writableState.destroyed = false;
|
|
12055
12308
|
this._writableState.ended = false;
|
|
@@ -12060,104 +12313,86 @@ function undestroy() {
|
|
|
12060
12313
|
this._writableState.errorEmitted = false;
|
|
12061
12314
|
}
|
|
12062
12315
|
}
|
|
12063
|
-
|
|
12064
12316
|
function emitErrorNT(self, err) {
|
|
12065
12317
|
self.emit('error', err);
|
|
12066
12318
|
}
|
|
12067
|
-
|
|
12068
12319
|
function errorOrDestroy(stream, err) {
|
|
12069
12320
|
// We have tests that rely on errors being emitted
|
|
12070
12321
|
// in the same tick, so changing this is semver major.
|
|
12071
12322
|
// For now when you opt-in to autoDestroy we allow
|
|
12072
12323
|
// the error to be emitted nextTick. In a future
|
|
12073
12324
|
// semver major update we should change the default to this.
|
|
12325
|
+
|
|
12074
12326
|
var rState = stream._readableState;
|
|
12075
12327
|
var wState = stream._writableState;
|
|
12076
12328
|
if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);
|
|
12077
12329
|
}
|
|
12078
|
-
|
|
12079
12330
|
module.exports = {
|
|
12080
12331
|
destroy: destroy,
|
|
12081
12332
|
undestroy: undestroy,
|
|
12082
12333
|
errorOrDestroy: errorOrDestroy
|
|
12083
12334
|
};
|
|
12084
12335
|
}).call(this)}).call(this,require('_process'))
|
|
12085
|
-
},{"_process":
|
|
12336
|
+
},{"_process":58}],71:[function(require,module,exports){
|
|
12086
12337
|
// Ported from https://github.com/mafintosh/end-of-stream with
|
|
12087
12338
|
// permission from the author, Mathias Buus (@mafintosh).
|
|
12339
|
+
|
|
12088
12340
|
'use strict';
|
|
12089
12341
|
|
|
12090
12342
|
var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE;
|
|
12091
|
-
|
|
12092
12343
|
function once(callback) {
|
|
12093
12344
|
var called = false;
|
|
12094
12345
|
return function () {
|
|
12095
12346
|
if (called) return;
|
|
12096
12347
|
called = true;
|
|
12097
|
-
|
|
12098
12348
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12099
12349
|
args[_key] = arguments[_key];
|
|
12100
12350
|
}
|
|
12101
|
-
|
|
12102
12351
|
callback.apply(this, args);
|
|
12103
12352
|
};
|
|
12104
12353
|
}
|
|
12105
|
-
|
|
12106
12354
|
function noop() {}
|
|
12107
|
-
|
|
12108
12355
|
function isRequest(stream) {
|
|
12109
12356
|
return stream.setHeader && typeof stream.abort === 'function';
|
|
12110
12357
|
}
|
|
12111
|
-
|
|
12112
12358
|
function eos(stream, opts, callback) {
|
|
12113
12359
|
if (typeof opts === 'function') return eos(stream, null, opts);
|
|
12114
12360
|
if (!opts) opts = {};
|
|
12115
12361
|
callback = once(callback || noop);
|
|
12116
12362
|
var readable = opts.readable || opts.readable !== false && stream.readable;
|
|
12117
12363
|
var writable = opts.writable || opts.writable !== false && stream.writable;
|
|
12118
|
-
|
|
12119
12364
|
var onlegacyfinish = function onlegacyfinish() {
|
|
12120
12365
|
if (!stream.writable) onfinish();
|
|
12121
12366
|
};
|
|
12122
|
-
|
|
12123
12367
|
var writableEnded = stream._writableState && stream._writableState.finished;
|
|
12124
|
-
|
|
12125
12368
|
var onfinish = function onfinish() {
|
|
12126
12369
|
writable = false;
|
|
12127
12370
|
writableEnded = true;
|
|
12128
12371
|
if (!readable) callback.call(stream);
|
|
12129
12372
|
};
|
|
12130
|
-
|
|
12131
12373
|
var readableEnded = stream._readableState && stream._readableState.endEmitted;
|
|
12132
|
-
|
|
12133
12374
|
var onend = function onend() {
|
|
12134
12375
|
readable = false;
|
|
12135
12376
|
readableEnded = true;
|
|
12136
12377
|
if (!writable) callback.call(stream);
|
|
12137
12378
|
};
|
|
12138
|
-
|
|
12139
12379
|
var onerror = function onerror(err) {
|
|
12140
12380
|
callback.call(stream, err);
|
|
12141
12381
|
};
|
|
12142
|
-
|
|
12143
12382
|
var onclose = function onclose() {
|
|
12144
12383
|
var err;
|
|
12145
|
-
|
|
12146
12384
|
if (readable && !readableEnded) {
|
|
12147
12385
|
if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
|
|
12148
12386
|
return callback.call(stream, err);
|
|
12149
12387
|
}
|
|
12150
|
-
|
|
12151
12388
|
if (writable && !writableEnded) {
|
|
12152
12389
|
if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
|
|
12153
12390
|
return callback.call(stream, err);
|
|
12154
12391
|
}
|
|
12155
12392
|
};
|
|
12156
|
-
|
|
12157
12393
|
var onrequest = function onrequest() {
|
|
12158
12394
|
stream.req.on('finish', onfinish);
|
|
12159
12395
|
};
|
|
12160
|
-
|
|
12161
12396
|
if (isRequest(stream)) {
|
|
12162
12397
|
stream.on('complete', onfinish);
|
|
12163
12398
|
stream.on('abort', onclose);
|
|
@@ -12167,7 +12402,6 @@ function eos(stream, opts, callback) {
|
|
|
12167
12402
|
stream.on('end', onlegacyfinish);
|
|
12168
12403
|
stream.on('close', onlegacyfinish);
|
|
12169
12404
|
}
|
|
12170
|
-
|
|
12171
12405
|
stream.on('end', onend);
|
|
12172
12406
|
stream.on('finish', onfinish);
|
|
12173
12407
|
if (opts.error !== false) stream.on('error', onerror);
|
|
@@ -12185,20 +12419,19 @@ function eos(stream, opts, callback) {
|
|
|
12185
12419
|
stream.removeListener('close', onclose);
|
|
12186
12420
|
};
|
|
12187
12421
|
}
|
|
12188
|
-
|
|
12189
12422
|
module.exports = eos;
|
|
12190
|
-
},{"../../../errors":
|
|
12423
|
+
},{"../../../errors":62}],72:[function(require,module,exports){
|
|
12191
12424
|
module.exports = function () {
|
|
12192
12425
|
throw new Error('Readable.from is not available in the browser')
|
|
12193
12426
|
};
|
|
12194
12427
|
|
|
12195
|
-
},{}],
|
|
12428
|
+
},{}],73:[function(require,module,exports){
|
|
12196
12429
|
// Ported from https://github.com/mafintosh/pump with
|
|
12197
12430
|
// permission from the author, Mathias Buus (@mafintosh).
|
|
12431
|
+
|
|
12198
12432
|
'use strict';
|
|
12199
12433
|
|
|
12200
12434
|
var eos;
|
|
12201
|
-
|
|
12202
12435
|
function once(callback) {
|
|
12203
12436
|
var called = false;
|
|
12204
12437
|
return function () {
|
|
@@ -12207,20 +12440,16 @@ function once(callback) {
|
|
|
12207
12440
|
callback.apply(void 0, arguments);
|
|
12208
12441
|
};
|
|
12209
12442
|
}
|
|
12210
|
-
|
|
12211
12443
|
var _require$codes = require('../../../errors').codes,
|
|
12212
|
-
|
|
12213
|
-
|
|
12214
|
-
|
|
12444
|
+
ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
|
|
12445
|
+
ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
|
|
12215
12446
|
function noop(err) {
|
|
12216
12447
|
// Rethrow the error if it exists to avoid swallowing it
|
|
12217
12448
|
if (err) throw err;
|
|
12218
12449
|
}
|
|
12219
|
-
|
|
12220
12450
|
function isRequest(stream) {
|
|
12221
12451
|
return stream.setHeader && typeof stream.abort === 'function';
|
|
12222
12452
|
}
|
|
12223
|
-
|
|
12224
12453
|
function destroyer(stream, reading, writing, callback) {
|
|
12225
12454
|
callback = once(callback);
|
|
12226
12455
|
var closed = false;
|
|
@@ -12240,40 +12469,34 @@ function destroyer(stream, reading, writing, callback) {
|
|
|
12240
12469
|
return function (err) {
|
|
12241
12470
|
if (closed) return;
|
|
12242
12471
|
if (destroyed) return;
|
|
12243
|
-
destroyed = true;
|
|
12472
|
+
destroyed = true;
|
|
12244
12473
|
|
|
12474
|
+
// request.destroy just do .end - .abort is what we want
|
|
12245
12475
|
if (isRequest(stream)) return stream.abort();
|
|
12246
12476
|
if (typeof stream.destroy === 'function') return stream.destroy();
|
|
12247
12477
|
callback(err || new ERR_STREAM_DESTROYED('pipe'));
|
|
12248
12478
|
};
|
|
12249
12479
|
}
|
|
12250
|
-
|
|
12251
12480
|
function call(fn) {
|
|
12252
12481
|
fn();
|
|
12253
12482
|
}
|
|
12254
|
-
|
|
12255
12483
|
function pipe(from, to) {
|
|
12256
12484
|
return from.pipe(to);
|
|
12257
12485
|
}
|
|
12258
|
-
|
|
12259
12486
|
function popCallback(streams) {
|
|
12260
12487
|
if (!streams.length) return noop;
|
|
12261
12488
|
if (typeof streams[streams.length - 1] !== 'function') return noop;
|
|
12262
12489
|
return streams.pop();
|
|
12263
12490
|
}
|
|
12264
|
-
|
|
12265
12491
|
function pipeline() {
|
|
12266
12492
|
for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12267
12493
|
streams[_key] = arguments[_key];
|
|
12268
12494
|
}
|
|
12269
|
-
|
|
12270
12495
|
var callback = popCallback(streams);
|
|
12271
12496
|
if (Array.isArray(streams[0])) streams = streams[0];
|
|
12272
|
-
|
|
12273
12497
|
if (streams.length < 2) {
|
|
12274
12498
|
throw new ERR_MISSING_ARGS('streams');
|
|
12275
12499
|
}
|
|
12276
|
-
|
|
12277
12500
|
var error;
|
|
12278
12501
|
var destroys = streams.map(function (stream, i) {
|
|
12279
12502
|
var reading = i < streams.length - 1;
|
|
@@ -12288,40 +12511,34 @@ function pipeline() {
|
|
|
12288
12511
|
});
|
|
12289
12512
|
return streams.reduce(pipe);
|
|
12290
12513
|
}
|
|
12291
|
-
|
|
12292
12514
|
module.exports = pipeline;
|
|
12293
|
-
},{"../../../errors":
|
|
12515
|
+
},{"../../../errors":62,"./end-of-stream":71}],74:[function(require,module,exports){
|
|
12294
12516
|
'use strict';
|
|
12295
12517
|
|
|
12296
12518
|
var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE;
|
|
12297
|
-
|
|
12298
12519
|
function highWaterMarkFrom(options, isDuplex, duplexKey) {
|
|
12299
12520
|
return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
|
|
12300
12521
|
}
|
|
12301
|
-
|
|
12302
12522
|
function getHighWaterMark(state, options, duplexKey, isDuplex) {
|
|
12303
12523
|
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
12304
|
-
|
|
12305
12524
|
if (hwm != null) {
|
|
12306
12525
|
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
12307
12526
|
var name = isDuplex ? duplexKey : 'highWaterMark';
|
|
12308
12527
|
throw new ERR_INVALID_OPT_VALUE(name, hwm);
|
|
12309
12528
|
}
|
|
12310
|
-
|
|
12311
12529
|
return Math.floor(hwm);
|
|
12312
|
-
}
|
|
12313
|
-
|
|
12530
|
+
}
|
|
12314
12531
|
|
|
12532
|
+
// Default value
|
|
12315
12533
|
return state.objectMode ? 16 : 16 * 1024;
|
|
12316
12534
|
}
|
|
12317
|
-
|
|
12318
12535
|
module.exports = {
|
|
12319
12536
|
getHighWaterMark: getHighWaterMark
|
|
12320
12537
|
};
|
|
12321
|
-
},{"../../../errors":
|
|
12538
|
+
},{"../../../errors":62}],75:[function(require,module,exports){
|
|
12322
12539
|
module.exports = require('events').EventEmitter;
|
|
12323
12540
|
|
|
12324
|
-
},{"events":18}],
|
|
12541
|
+
},{"events":18}],76:[function(require,module,exports){
|
|
12325
12542
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
12326
12543
|
//
|
|
12327
12544
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -12618,7 +12835,7 @@ function simpleWrite(buf) {
|
|
|
12618
12835
|
function simpleEnd(buf) {
|
|
12619
12836
|
return buf && buf.length ? this.write(buf) : '';
|
|
12620
12837
|
}
|
|
12621
|
-
},{"safe-buffer":
|
|
12838
|
+
},{"safe-buffer":59}],77:[function(require,module,exports){
|
|
12622
12839
|
'use strict';
|
|
12623
12840
|
|
|
12624
12841
|
module.exports = string => {
|
|
@@ -12635,7 +12852,7 @@ module.exports = string => {
|
|
|
12635
12852
|
return string;
|
|
12636
12853
|
};
|
|
12637
12854
|
|
|
12638
|
-
},{}],
|
|
12855
|
+
},{}],78:[function(require,module,exports){
|
|
12639
12856
|
'use strict';
|
|
12640
12857
|
const singleComment = Symbol('singleComment');
|
|
12641
12858
|
const multiComment = Symbol('multiComment');
|
|
@@ -12714,7 +12931,7 @@ module.exports = (jsonString, options = {}) => {
|
|
|
12714
12931
|
return result + (insideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset));
|
|
12715
12932
|
};
|
|
12716
12933
|
|
|
12717
|
-
},{}],
|
|
12934
|
+
},{}],79:[function(require,module,exports){
|
|
12718
12935
|
(function (global){(function (){
|
|
12719
12936
|
|
|
12720
12937
|
/**
|
|
@@ -12785,9 +13002,9 @@ function config (name) {
|
|
|
12785
13002
|
}
|
|
12786
13003
|
|
|
12787
13004
|
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
12788
|
-
},{}],
|
|
13005
|
+
},{}],80:[function(require,module,exports){
|
|
12789
13006
|
arguments[4][3][0].apply(exports,arguments)
|
|
12790
|
-
},{"dup":3}],
|
|
13007
|
+
},{"dup":3}],81:[function(require,module,exports){
|
|
12791
13008
|
// Currently in sync with Node.js lib/internal/util/types.js
|
|
12792
13009
|
// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9
|
|
12793
13010
|
|
|
@@ -13123,7 +13340,7 @@ exports.isAnyArrayBuffer = isAnyArrayBuffer;
|
|
|
13123
13340
|
});
|
|
13124
13341
|
});
|
|
13125
13342
|
|
|
13126
|
-
},{"is-arguments":
|
|
13343
|
+
},{"is-arguments":37,"is-generator-function":40,"is-typed-array":42,"which-typed-array":83}],82:[function(require,module,exports){
|
|
13127
13344
|
(function (process){(function (){
|
|
13128
13345
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
13129
13346
|
//
|
|
@@ -13537,7 +13754,7 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
|
|
|
13537
13754
|
if (array) {
|
|
13538
13755
|
str = str.split('\n').map(function(line) {
|
|
13539
13756
|
return ' ' + line;
|
|
13540
|
-
}).join('\n').
|
|
13757
|
+
}).join('\n').slice(2);
|
|
13541
13758
|
} else {
|
|
13542
13759
|
str = '\n' + str.split('\n').map(function(line) {
|
|
13543
13760
|
return ' ' + line;
|
|
@@ -13554,7 +13771,7 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
|
|
|
13554
13771
|
}
|
|
13555
13772
|
name = JSON.stringify('' + key);
|
|
13556
13773
|
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
|
|
13557
|
-
name = name.
|
|
13774
|
+
name = name.slice(1, -1);
|
|
13558
13775
|
name = ctx.stylize(name, 'name');
|
|
13559
13776
|
} else {
|
|
13560
13777
|
name = name.replace(/'/g, "\\'")
|
|
@@ -13842,13 +14059,15 @@ function callbackify(original) {
|
|
|
13842
14059
|
exports.callbackify = callbackify;
|
|
13843
14060
|
|
|
13844
14061
|
}).call(this)}).call(this,require('_process'))
|
|
13845
|
-
},{"./support/isBuffer":
|
|
14062
|
+
},{"./support/isBuffer":80,"./support/types":81,"_process":58,"inherits":36}],83:[function(require,module,exports){
|
|
13846
14063
|
(function (global){(function (){
|
|
13847
14064
|
'use strict';
|
|
13848
14065
|
|
|
13849
|
-
var forEach = require('
|
|
14066
|
+
var forEach = require('for-each');
|
|
13850
14067
|
var availableTypedArrays = require('available-typed-arrays');
|
|
14068
|
+
var callBind = require('call-bind');
|
|
13851
14069
|
var callBound = require('call-bind/callBound');
|
|
14070
|
+
var gOPD = require('gopd');
|
|
13852
14071
|
|
|
13853
14072
|
var $toString = callBound('Object.prototype.toString');
|
|
13854
14073
|
var hasToStringTag = require('has-tostringtag/shams')();
|
|
@@ -13857,51 +14076,86 @@ var g = typeof globalThis === 'undefined' ? global : globalThis;
|
|
|
13857
14076
|
var typedArrays = availableTypedArrays();
|
|
13858
14077
|
|
|
13859
14078
|
var $slice = callBound('String.prototype.slice');
|
|
13860
|
-
var toStrTags = {};
|
|
13861
|
-
var gOPD = require('es-abstract/helpers/getOwnPropertyDescriptor');
|
|
13862
14079
|
var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');
|
|
14080
|
+
|
|
14081
|
+
var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {
|
|
14082
|
+
for (var i = 0; i < array.length; i += 1) {
|
|
14083
|
+
if (array[i] === value) {
|
|
14084
|
+
return i;
|
|
14085
|
+
}
|
|
14086
|
+
}
|
|
14087
|
+
return -1;
|
|
14088
|
+
};
|
|
14089
|
+
var cache = { __proto__: null };
|
|
13863
14090
|
if (hasToStringTag && gOPD && getPrototypeOf) {
|
|
13864
14091
|
forEach(typedArrays, function (typedArray) {
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
|
|
13871
|
-
|
|
13872
|
-
descriptor = gOPD(superProto, Symbol.toStringTag);
|
|
13873
|
-
}
|
|
13874
|
-
toStrTags[typedArray] = descriptor.get;
|
|
14092
|
+
var arr = new g[typedArray]();
|
|
14093
|
+
if (Symbol.toStringTag in arr) {
|
|
14094
|
+
var proto = getPrototypeOf(arr);
|
|
14095
|
+
var descriptor = gOPD(proto, Symbol.toStringTag);
|
|
14096
|
+
if (!descriptor) {
|
|
14097
|
+
var superProto = getPrototypeOf(proto);
|
|
14098
|
+
descriptor = gOPD(superProto, Symbol.toStringTag);
|
|
13875
14099
|
}
|
|
14100
|
+
cache['$' + typedArray] = callBind(descriptor.get);
|
|
14101
|
+
}
|
|
14102
|
+
});
|
|
14103
|
+
} else {
|
|
14104
|
+
forEach(typedArrays, function (typedArray) {
|
|
14105
|
+
var arr = new g[typedArray]();
|
|
14106
|
+
var fn = arr.slice || arr.set;
|
|
14107
|
+
if (fn) {
|
|
14108
|
+
cache['$' + typedArray] = callBind(fn);
|
|
13876
14109
|
}
|
|
13877
14110
|
});
|
|
13878
14111
|
}
|
|
13879
14112
|
|
|
13880
14113
|
var tryTypedArrays = function tryAllTypedArrays(value) {
|
|
13881
|
-
var
|
|
13882
|
-
forEach(
|
|
13883
|
-
if (!
|
|
14114
|
+
var found = false;
|
|
14115
|
+
forEach(cache, function (getter, typedArray) {
|
|
14116
|
+
if (!found) {
|
|
13884
14117
|
try {
|
|
13885
|
-
|
|
13886
|
-
|
|
13887
|
-
foundName = name;
|
|
14118
|
+
if ('$' + getter(value) === typedArray) {
|
|
14119
|
+
found = $slice(typedArray, 1);
|
|
13888
14120
|
}
|
|
13889
|
-
} catch (e) {}
|
|
14121
|
+
} catch (e) { /**/ }
|
|
13890
14122
|
}
|
|
13891
14123
|
});
|
|
13892
|
-
return
|
|
14124
|
+
return found;
|
|
13893
14125
|
};
|
|
13894
14126
|
|
|
13895
|
-
var
|
|
14127
|
+
var trySlices = function tryAllSlices(value) {
|
|
14128
|
+
var found = false;
|
|
14129
|
+
forEach(cache, function (getter, name) {
|
|
14130
|
+
if (!found) {
|
|
14131
|
+
try {
|
|
14132
|
+
getter(value);
|
|
14133
|
+
found = $slice(name, 1);
|
|
14134
|
+
} catch (e) { /**/ }
|
|
14135
|
+
}
|
|
14136
|
+
});
|
|
14137
|
+
return found;
|
|
14138
|
+
};
|
|
13896
14139
|
|
|
13897
14140
|
module.exports = function whichTypedArray(value) {
|
|
13898
|
-
if (!
|
|
13899
|
-
if (!hasToStringTag
|
|
14141
|
+
if (!value || typeof value !== 'object') { return false; }
|
|
14142
|
+
if (!hasToStringTag) {
|
|
14143
|
+
var tag = $slice($toString(value), 8, -1);
|
|
14144
|
+
if ($indexOf(typedArrays, tag) > -1) {
|
|
14145
|
+
return tag;
|
|
14146
|
+
}
|
|
14147
|
+
if (tag !== 'Object') {
|
|
14148
|
+
return false;
|
|
14149
|
+
}
|
|
14150
|
+
// node < 0.6 hits here on real Typed Arrays
|
|
14151
|
+
return trySlices(value);
|
|
14152
|
+
}
|
|
14153
|
+
if (!gOPD) { return null; } // unknown engine
|
|
13900
14154
|
return tryTypedArrays(value);
|
|
13901
14155
|
};
|
|
13902
14156
|
|
|
13903
14157
|
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
13904
|
-
},{"available-typed-arrays":5,"call-bind/callBound":10,"
|
|
14158
|
+
},{"available-typed-arrays":5,"call-bind":11,"call-bind/callBound":10,"for-each":20,"gopd":24,"has-tostringtag/shams":33}],84:[function(require,module,exports){
|
|
13905
14159
|
(function (process,global,Buffer){(function (){
|
|
13906
14160
|
"use strict";
|
|
13907
14161
|
|
|
@@ -14603,9 +14857,8 @@ function merge( /* variable args */
|
|
|
14603
14857
|
return target;
|
|
14604
14858
|
}
|
|
14605
14859
|
yves.typeOf = typeOf;
|
|
14606
|
-
var _default = yves;
|
|
14607
|
-
exports.default = _default;
|
|
14860
|
+
var _default = exports.default = yves;
|
|
14608
14861
|
|
|
14609
14862
|
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
|
|
14610
|
-
},{"_process":
|
|
14863
|
+
},{"_process":58,"buffer":9,"debug":13,"deep-sort-object":15,"jsonc":45}]},{},[84])(84)
|
|
14611
14864
|
});
|