contentful 9.1.25 → 9.1.26
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/contentful.browser.js +7 -1574
- package/dist/contentful.browser.js.map +1 -1
- package/dist/contentful.browser.min.js +3 -3
- package/dist/contentful.node.js +11 -31
- package/dist/contentful.node.js.map +1 -1
- package/dist/contentful.node.min.js +2 -2
- package/dist/es-modules/contentful.js +1 -1
- package/package.json +1 -1
|
@@ -124,7 +124,6 @@ var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "../node_modules
|
|
|
124
124
|
var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "../node_modules/axios/lib/core/buildFullPath.js");
|
|
125
125
|
var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "../node_modules/axios/lib/helpers/parseHeaders.js");
|
|
126
126
|
var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "../node_modules/axios/lib/helpers/isURLSameOrigin.js");
|
|
127
|
-
var url = __webpack_require__(/*! url */ "../node_modules/url/url.js");
|
|
128
127
|
var transitionalDefaults = __webpack_require__(/*! ../defaults/transitional */ "../node_modules/axios/lib/defaults/transitional.js");
|
|
129
128
|
var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "../node_modules/axios/lib/core/AxiosError.js");
|
|
130
129
|
var CanceledError = __webpack_require__(/*! ../cancel/CanceledError */ "../node_modules/axios/lib/cancel/CanceledError.js");
|
|
@@ -155,8 +154,6 @@ module.exports = function xhrAdapter(config) {
|
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
158
|
-
var parsed = url.parse(fullPath);
|
|
159
|
-
var protocol = utils.getProtocol(parsed.protocol);
|
|
160
157
|
|
|
161
158
|
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
162
159
|
|
|
@@ -323,16 +320,15 @@ module.exports = function xhrAdapter(config) {
|
|
|
323
320
|
requestData = null;
|
|
324
321
|
}
|
|
325
322
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
323
|
+
var tokens = fullPath.split(':', 2);
|
|
324
|
+
var protocol = tokens.length > 1 && tokens[0];
|
|
330
325
|
|
|
331
|
-
if (
|
|
332
|
-
reject(new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_BAD_REQUEST, config));
|
|
326
|
+
if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
|
|
327
|
+
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
|
|
333
328
|
return;
|
|
334
329
|
}
|
|
335
330
|
|
|
331
|
+
|
|
336
332
|
// Send the request
|
|
337
333
|
request.send(requestData);
|
|
338
334
|
});
|
|
@@ -1435,7 +1431,7 @@ module.exports = {
|
|
|
1435
1431
|
/***/ (function(module, exports) {
|
|
1436
1432
|
|
|
1437
1433
|
module.exports = {
|
|
1438
|
-
"version": "0.27.
|
|
1434
|
+
"version": "0.27.1"
|
|
1439
1435
|
};
|
|
1440
1436
|
|
|
1441
1437
|
/***/ }),
|
|
@@ -2123,22 +2119,6 @@ function kindOfTest(type) {
|
|
|
2123
2119
|
};
|
|
2124
2120
|
}
|
|
2125
2121
|
|
|
2126
|
-
/**
|
|
2127
|
-
* Array with axios supported protocols.
|
|
2128
|
-
*/
|
|
2129
|
-
var supportedProtocols = [ 'http:', 'https:', 'file:' ];
|
|
2130
|
-
|
|
2131
|
-
/**
|
|
2132
|
-
* Returns URL protocol passed as param if is not undefined or null,
|
|
2133
|
-
* otherwise just returns 'http:'
|
|
2134
|
-
*
|
|
2135
|
-
* @param {String} protocol The String value of URL protocol
|
|
2136
|
-
* @returns {String} Protocol if the value is not undefined or null
|
|
2137
|
-
*/
|
|
2138
|
-
function getProtocol(protocol) {
|
|
2139
|
-
return protocol || 'http:';
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
2122
|
/**
|
|
2143
2123
|
* Determine if a value is an Array
|
|
2144
2124
|
*
|
|
@@ -2554,8 +2534,6 @@ var isTypedArray = (function(TypedArray) {
|
|
|
2554
2534
|
})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
|
|
2555
2535
|
|
|
2556
2536
|
module.exports = {
|
|
2557
|
-
supportedProtocols: supportedProtocols,
|
|
2558
|
-
getProtocol: getProtocol,
|
|
2559
2537
|
isArray: isArray,
|
|
2560
2538
|
isArrayBuffer: isArrayBuffer,
|
|
2561
2539
|
isBuffer: isBuffer,
|
|
@@ -6970,537 +6948,6 @@ function isnan (val) {
|
|
|
6970
6948
|
|
|
6971
6949
|
/***/ }),
|
|
6972
6950
|
|
|
6973
|
-
/***/ "../node_modules/node-libs-browser/node_modules/punycode/punycode.js":
|
|
6974
|
-
/*!***************************************************************************!*\
|
|
6975
|
-
!*** ../node_modules/node-libs-browser/node_modules/punycode/punycode.js ***!
|
|
6976
|
-
\***************************************************************************/
|
|
6977
|
-
/*! no static exports found */
|
|
6978
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
6979
|
-
|
|
6980
|
-
/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
6981
|
-
;(function(root) {
|
|
6982
|
-
|
|
6983
|
-
/** Detect free variables */
|
|
6984
|
-
var freeExports = true && exports &&
|
|
6985
|
-
!exports.nodeType && exports;
|
|
6986
|
-
var freeModule = true && module &&
|
|
6987
|
-
!module.nodeType && module;
|
|
6988
|
-
var freeGlobal = typeof global == 'object' && global;
|
|
6989
|
-
if (
|
|
6990
|
-
freeGlobal.global === freeGlobal ||
|
|
6991
|
-
freeGlobal.window === freeGlobal ||
|
|
6992
|
-
freeGlobal.self === freeGlobal
|
|
6993
|
-
) {
|
|
6994
|
-
root = freeGlobal;
|
|
6995
|
-
}
|
|
6996
|
-
|
|
6997
|
-
/**
|
|
6998
|
-
* The `punycode` object.
|
|
6999
|
-
* @name punycode
|
|
7000
|
-
* @type Object
|
|
7001
|
-
*/
|
|
7002
|
-
var punycode,
|
|
7003
|
-
|
|
7004
|
-
/** Highest positive signed 32-bit float value */
|
|
7005
|
-
maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
|
|
7006
|
-
|
|
7007
|
-
/** Bootstring parameters */
|
|
7008
|
-
base = 36,
|
|
7009
|
-
tMin = 1,
|
|
7010
|
-
tMax = 26,
|
|
7011
|
-
skew = 38,
|
|
7012
|
-
damp = 700,
|
|
7013
|
-
initialBias = 72,
|
|
7014
|
-
initialN = 128, // 0x80
|
|
7015
|
-
delimiter = '-', // '\x2D'
|
|
7016
|
-
|
|
7017
|
-
/** Regular expressions */
|
|
7018
|
-
regexPunycode = /^xn--/,
|
|
7019
|
-
regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
|
|
7020
|
-
regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
|
|
7021
|
-
|
|
7022
|
-
/** Error messages */
|
|
7023
|
-
errors = {
|
|
7024
|
-
'overflow': 'Overflow: input needs wider integers to process',
|
|
7025
|
-
'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
|
|
7026
|
-
'invalid-input': 'Invalid input'
|
|
7027
|
-
},
|
|
7028
|
-
|
|
7029
|
-
/** Convenience shortcuts */
|
|
7030
|
-
baseMinusTMin = base - tMin,
|
|
7031
|
-
floor = Math.floor,
|
|
7032
|
-
stringFromCharCode = String.fromCharCode,
|
|
7033
|
-
|
|
7034
|
-
/** Temporary variable */
|
|
7035
|
-
key;
|
|
7036
|
-
|
|
7037
|
-
/*--------------------------------------------------------------------------*/
|
|
7038
|
-
|
|
7039
|
-
/**
|
|
7040
|
-
* A generic error utility function.
|
|
7041
|
-
* @private
|
|
7042
|
-
* @param {String} type The error type.
|
|
7043
|
-
* @returns {Error} Throws a `RangeError` with the applicable error message.
|
|
7044
|
-
*/
|
|
7045
|
-
function error(type) {
|
|
7046
|
-
throw new RangeError(errors[type]);
|
|
7047
|
-
}
|
|
7048
|
-
|
|
7049
|
-
/**
|
|
7050
|
-
* A generic `Array#map` utility function.
|
|
7051
|
-
* @private
|
|
7052
|
-
* @param {Array} array The array to iterate over.
|
|
7053
|
-
* @param {Function} callback The function that gets called for every array
|
|
7054
|
-
* item.
|
|
7055
|
-
* @returns {Array} A new array of values returned by the callback function.
|
|
7056
|
-
*/
|
|
7057
|
-
function map(array, fn) {
|
|
7058
|
-
var length = array.length;
|
|
7059
|
-
var result = [];
|
|
7060
|
-
while (length--) {
|
|
7061
|
-
result[length] = fn(array[length]);
|
|
7062
|
-
}
|
|
7063
|
-
return result;
|
|
7064
|
-
}
|
|
7065
|
-
|
|
7066
|
-
/**
|
|
7067
|
-
* A simple `Array#map`-like wrapper to work with domain name strings or email
|
|
7068
|
-
* addresses.
|
|
7069
|
-
* @private
|
|
7070
|
-
* @param {String} domain The domain name or email address.
|
|
7071
|
-
* @param {Function} callback The function that gets called for every
|
|
7072
|
-
* character.
|
|
7073
|
-
* @returns {Array} A new string of characters returned by the callback
|
|
7074
|
-
* function.
|
|
7075
|
-
*/
|
|
7076
|
-
function mapDomain(string, fn) {
|
|
7077
|
-
var parts = string.split('@');
|
|
7078
|
-
var result = '';
|
|
7079
|
-
if (parts.length > 1) {
|
|
7080
|
-
// In email addresses, only the domain name should be punycoded. Leave
|
|
7081
|
-
// the local part (i.e. everything up to `@`) intact.
|
|
7082
|
-
result = parts[0] + '@';
|
|
7083
|
-
string = parts[1];
|
|
7084
|
-
}
|
|
7085
|
-
// Avoid `split(regex)` for IE8 compatibility. See #17.
|
|
7086
|
-
string = string.replace(regexSeparators, '\x2E');
|
|
7087
|
-
var labels = string.split('.');
|
|
7088
|
-
var encoded = map(labels, fn).join('.');
|
|
7089
|
-
return result + encoded;
|
|
7090
|
-
}
|
|
7091
|
-
|
|
7092
|
-
/**
|
|
7093
|
-
* Creates an array containing the numeric code points of each Unicode
|
|
7094
|
-
* character in the string. While JavaScript uses UCS-2 internally,
|
|
7095
|
-
* this function will convert a pair of surrogate halves (each of which
|
|
7096
|
-
* UCS-2 exposes as separate characters) into a single code point,
|
|
7097
|
-
* matching UTF-16.
|
|
7098
|
-
* @see `punycode.ucs2.encode`
|
|
7099
|
-
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|
7100
|
-
* @memberOf punycode.ucs2
|
|
7101
|
-
* @name decode
|
|
7102
|
-
* @param {String} string The Unicode input string (UCS-2).
|
|
7103
|
-
* @returns {Array} The new array of code points.
|
|
7104
|
-
*/
|
|
7105
|
-
function ucs2decode(string) {
|
|
7106
|
-
var output = [],
|
|
7107
|
-
counter = 0,
|
|
7108
|
-
length = string.length,
|
|
7109
|
-
value,
|
|
7110
|
-
extra;
|
|
7111
|
-
while (counter < length) {
|
|
7112
|
-
value = string.charCodeAt(counter++);
|
|
7113
|
-
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
|
7114
|
-
// high surrogate, and there is a next character
|
|
7115
|
-
extra = string.charCodeAt(counter++);
|
|
7116
|
-
if ((extra & 0xFC00) == 0xDC00) { // low surrogate
|
|
7117
|
-
output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
|
7118
|
-
} else {
|
|
7119
|
-
// unmatched surrogate; only append this code unit, in case the next
|
|
7120
|
-
// code unit is the high surrogate of a surrogate pair
|
|
7121
|
-
output.push(value);
|
|
7122
|
-
counter--;
|
|
7123
|
-
}
|
|
7124
|
-
} else {
|
|
7125
|
-
output.push(value);
|
|
7126
|
-
}
|
|
7127
|
-
}
|
|
7128
|
-
return output;
|
|
7129
|
-
}
|
|
7130
|
-
|
|
7131
|
-
/**
|
|
7132
|
-
* Creates a string based on an array of numeric code points.
|
|
7133
|
-
* @see `punycode.ucs2.decode`
|
|
7134
|
-
* @memberOf punycode.ucs2
|
|
7135
|
-
* @name encode
|
|
7136
|
-
* @param {Array} codePoints The array of numeric code points.
|
|
7137
|
-
* @returns {String} The new Unicode string (UCS-2).
|
|
7138
|
-
*/
|
|
7139
|
-
function ucs2encode(array) {
|
|
7140
|
-
return map(array, function(value) {
|
|
7141
|
-
var output = '';
|
|
7142
|
-
if (value > 0xFFFF) {
|
|
7143
|
-
value -= 0x10000;
|
|
7144
|
-
output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
|
|
7145
|
-
value = 0xDC00 | value & 0x3FF;
|
|
7146
|
-
}
|
|
7147
|
-
output += stringFromCharCode(value);
|
|
7148
|
-
return output;
|
|
7149
|
-
}).join('');
|
|
7150
|
-
}
|
|
7151
|
-
|
|
7152
|
-
/**
|
|
7153
|
-
* Converts a basic code point into a digit/integer.
|
|
7154
|
-
* @see `digitToBasic()`
|
|
7155
|
-
* @private
|
|
7156
|
-
* @param {Number} codePoint The basic numeric code point value.
|
|
7157
|
-
* @returns {Number} The numeric value of a basic code point (for use in
|
|
7158
|
-
* representing integers) in the range `0` to `base - 1`, or `base` if
|
|
7159
|
-
* the code point does not represent a value.
|
|
7160
|
-
*/
|
|
7161
|
-
function basicToDigit(codePoint) {
|
|
7162
|
-
if (codePoint - 48 < 10) {
|
|
7163
|
-
return codePoint - 22;
|
|
7164
|
-
}
|
|
7165
|
-
if (codePoint - 65 < 26) {
|
|
7166
|
-
return codePoint - 65;
|
|
7167
|
-
}
|
|
7168
|
-
if (codePoint - 97 < 26) {
|
|
7169
|
-
return codePoint - 97;
|
|
7170
|
-
}
|
|
7171
|
-
return base;
|
|
7172
|
-
}
|
|
7173
|
-
|
|
7174
|
-
/**
|
|
7175
|
-
* Converts a digit/integer into a basic code point.
|
|
7176
|
-
* @see `basicToDigit()`
|
|
7177
|
-
* @private
|
|
7178
|
-
* @param {Number} digit The numeric value of a basic code point.
|
|
7179
|
-
* @returns {Number} The basic code point whose value (when used for
|
|
7180
|
-
* representing integers) is `digit`, which needs to be in the range
|
|
7181
|
-
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
|
|
7182
|
-
* used; else, the lowercase form is used. The behavior is undefined
|
|
7183
|
-
* if `flag` is non-zero and `digit` has no uppercase form.
|
|
7184
|
-
*/
|
|
7185
|
-
function digitToBasic(digit, flag) {
|
|
7186
|
-
// 0..25 map to ASCII a..z or A..Z
|
|
7187
|
-
// 26..35 map to ASCII 0..9
|
|
7188
|
-
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
|
|
7189
|
-
}
|
|
7190
|
-
|
|
7191
|
-
/**
|
|
7192
|
-
* Bias adaptation function as per section 3.4 of RFC 3492.
|
|
7193
|
-
* https://tools.ietf.org/html/rfc3492#section-3.4
|
|
7194
|
-
* @private
|
|
7195
|
-
*/
|
|
7196
|
-
function adapt(delta, numPoints, firstTime) {
|
|
7197
|
-
var k = 0;
|
|
7198
|
-
delta = firstTime ? floor(delta / damp) : delta >> 1;
|
|
7199
|
-
delta += floor(delta / numPoints);
|
|
7200
|
-
for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
|
|
7201
|
-
delta = floor(delta / baseMinusTMin);
|
|
7202
|
-
}
|
|
7203
|
-
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
|
7204
|
-
}
|
|
7205
|
-
|
|
7206
|
-
/**
|
|
7207
|
-
* Converts a Punycode string of ASCII-only symbols to a string of Unicode
|
|
7208
|
-
* symbols.
|
|
7209
|
-
* @memberOf punycode
|
|
7210
|
-
* @param {String} input The Punycode string of ASCII-only symbols.
|
|
7211
|
-
* @returns {String} The resulting string of Unicode symbols.
|
|
7212
|
-
*/
|
|
7213
|
-
function decode(input) {
|
|
7214
|
-
// Don't use UCS-2
|
|
7215
|
-
var output = [],
|
|
7216
|
-
inputLength = input.length,
|
|
7217
|
-
out,
|
|
7218
|
-
i = 0,
|
|
7219
|
-
n = initialN,
|
|
7220
|
-
bias = initialBias,
|
|
7221
|
-
basic,
|
|
7222
|
-
j,
|
|
7223
|
-
index,
|
|
7224
|
-
oldi,
|
|
7225
|
-
w,
|
|
7226
|
-
k,
|
|
7227
|
-
digit,
|
|
7228
|
-
t,
|
|
7229
|
-
/** Cached calculation results */
|
|
7230
|
-
baseMinusT;
|
|
7231
|
-
|
|
7232
|
-
// Handle the basic code points: let `basic` be the number of input code
|
|
7233
|
-
// points before the last delimiter, or `0` if there is none, then copy
|
|
7234
|
-
// the first basic code points to the output.
|
|
7235
|
-
|
|
7236
|
-
basic = input.lastIndexOf(delimiter);
|
|
7237
|
-
if (basic < 0) {
|
|
7238
|
-
basic = 0;
|
|
7239
|
-
}
|
|
7240
|
-
|
|
7241
|
-
for (j = 0; j < basic; ++j) {
|
|
7242
|
-
// if it's not a basic code point
|
|
7243
|
-
if (input.charCodeAt(j) >= 0x80) {
|
|
7244
|
-
error('not-basic');
|
|
7245
|
-
}
|
|
7246
|
-
output.push(input.charCodeAt(j));
|
|
7247
|
-
}
|
|
7248
|
-
|
|
7249
|
-
// Main decoding loop: start just after the last delimiter if any basic code
|
|
7250
|
-
// points were copied; start at the beginning otherwise.
|
|
7251
|
-
|
|
7252
|
-
for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
|
|
7253
|
-
|
|
7254
|
-
// `index` is the index of the next character to be consumed.
|
|
7255
|
-
// Decode a generalized variable-length integer into `delta`,
|
|
7256
|
-
// which gets added to `i`. The overflow checking is easier
|
|
7257
|
-
// if we increase `i` as we go, then subtract off its starting
|
|
7258
|
-
// value at the end to obtain `delta`.
|
|
7259
|
-
for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
|
|
7260
|
-
|
|
7261
|
-
if (index >= inputLength) {
|
|
7262
|
-
error('invalid-input');
|
|
7263
|
-
}
|
|
7264
|
-
|
|
7265
|
-
digit = basicToDigit(input.charCodeAt(index++));
|
|
7266
|
-
|
|
7267
|
-
if (digit >= base || digit > floor((maxInt - i) / w)) {
|
|
7268
|
-
error('overflow');
|
|
7269
|
-
}
|
|
7270
|
-
|
|
7271
|
-
i += digit * w;
|
|
7272
|
-
t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
|
7273
|
-
|
|
7274
|
-
if (digit < t) {
|
|
7275
|
-
break;
|
|
7276
|
-
}
|
|
7277
|
-
|
|
7278
|
-
baseMinusT = base - t;
|
|
7279
|
-
if (w > floor(maxInt / baseMinusT)) {
|
|
7280
|
-
error('overflow');
|
|
7281
|
-
}
|
|
7282
|
-
|
|
7283
|
-
w *= baseMinusT;
|
|
7284
|
-
|
|
7285
|
-
}
|
|
7286
|
-
|
|
7287
|
-
out = output.length + 1;
|
|
7288
|
-
bias = adapt(i - oldi, out, oldi == 0);
|
|
7289
|
-
|
|
7290
|
-
// `i` was supposed to wrap around from `out` to `0`,
|
|
7291
|
-
// incrementing `n` each time, so we'll fix that now:
|
|
7292
|
-
if (floor(i / out) > maxInt - n) {
|
|
7293
|
-
error('overflow');
|
|
7294
|
-
}
|
|
7295
|
-
|
|
7296
|
-
n += floor(i / out);
|
|
7297
|
-
i %= out;
|
|
7298
|
-
|
|
7299
|
-
// Insert `n` at position `i` of the output
|
|
7300
|
-
output.splice(i++, 0, n);
|
|
7301
|
-
|
|
7302
|
-
}
|
|
7303
|
-
|
|
7304
|
-
return ucs2encode(output);
|
|
7305
|
-
}
|
|
7306
|
-
|
|
7307
|
-
/**
|
|
7308
|
-
* Converts a string of Unicode symbols (e.g. a domain name label) to a
|
|
7309
|
-
* Punycode string of ASCII-only symbols.
|
|
7310
|
-
* @memberOf punycode
|
|
7311
|
-
* @param {String} input The string of Unicode symbols.
|
|
7312
|
-
* @returns {String} The resulting Punycode string of ASCII-only symbols.
|
|
7313
|
-
*/
|
|
7314
|
-
function encode(input) {
|
|
7315
|
-
var n,
|
|
7316
|
-
delta,
|
|
7317
|
-
handledCPCount,
|
|
7318
|
-
basicLength,
|
|
7319
|
-
bias,
|
|
7320
|
-
j,
|
|
7321
|
-
m,
|
|
7322
|
-
q,
|
|
7323
|
-
k,
|
|
7324
|
-
t,
|
|
7325
|
-
currentValue,
|
|
7326
|
-
output = [],
|
|
7327
|
-
/** `inputLength` will hold the number of code points in `input`. */
|
|
7328
|
-
inputLength,
|
|
7329
|
-
/** Cached calculation results */
|
|
7330
|
-
handledCPCountPlusOne,
|
|
7331
|
-
baseMinusT,
|
|
7332
|
-
qMinusT;
|
|
7333
|
-
|
|
7334
|
-
// Convert the input in UCS-2 to Unicode
|
|
7335
|
-
input = ucs2decode(input);
|
|
7336
|
-
|
|
7337
|
-
// Cache the length
|
|
7338
|
-
inputLength = input.length;
|
|
7339
|
-
|
|
7340
|
-
// Initialize the state
|
|
7341
|
-
n = initialN;
|
|
7342
|
-
delta = 0;
|
|
7343
|
-
bias = initialBias;
|
|
7344
|
-
|
|
7345
|
-
// Handle the basic code points
|
|
7346
|
-
for (j = 0; j < inputLength; ++j) {
|
|
7347
|
-
currentValue = input[j];
|
|
7348
|
-
if (currentValue < 0x80) {
|
|
7349
|
-
output.push(stringFromCharCode(currentValue));
|
|
7350
|
-
}
|
|
7351
|
-
}
|
|
7352
|
-
|
|
7353
|
-
handledCPCount = basicLength = output.length;
|
|
7354
|
-
|
|
7355
|
-
// `handledCPCount` is the number of code points that have been handled;
|
|
7356
|
-
// `basicLength` is the number of basic code points.
|
|
7357
|
-
|
|
7358
|
-
// Finish the basic string - if it is not empty - with a delimiter
|
|
7359
|
-
if (basicLength) {
|
|
7360
|
-
output.push(delimiter);
|
|
7361
|
-
}
|
|
7362
|
-
|
|
7363
|
-
// Main encoding loop:
|
|
7364
|
-
while (handledCPCount < inputLength) {
|
|
7365
|
-
|
|
7366
|
-
// All non-basic code points < n have been handled already. Find the next
|
|
7367
|
-
// larger one:
|
|
7368
|
-
for (m = maxInt, j = 0; j < inputLength; ++j) {
|
|
7369
|
-
currentValue = input[j];
|
|
7370
|
-
if (currentValue >= n && currentValue < m) {
|
|
7371
|
-
m = currentValue;
|
|
7372
|
-
}
|
|
7373
|
-
}
|
|
7374
|
-
|
|
7375
|
-
// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
|
|
7376
|
-
// but guard against overflow
|
|
7377
|
-
handledCPCountPlusOne = handledCPCount + 1;
|
|
7378
|
-
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
|
7379
|
-
error('overflow');
|
|
7380
|
-
}
|
|
7381
|
-
|
|
7382
|
-
delta += (m - n) * handledCPCountPlusOne;
|
|
7383
|
-
n = m;
|
|
7384
|
-
|
|
7385
|
-
for (j = 0; j < inputLength; ++j) {
|
|
7386
|
-
currentValue = input[j];
|
|
7387
|
-
|
|
7388
|
-
if (currentValue < n && ++delta > maxInt) {
|
|
7389
|
-
error('overflow');
|
|
7390
|
-
}
|
|
7391
|
-
|
|
7392
|
-
if (currentValue == n) {
|
|
7393
|
-
// Represent delta as a generalized variable-length integer
|
|
7394
|
-
for (q = delta, k = base; /* no condition */; k += base) {
|
|
7395
|
-
t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
|
7396
|
-
if (q < t) {
|
|
7397
|
-
break;
|
|
7398
|
-
}
|
|
7399
|
-
qMinusT = q - t;
|
|
7400
|
-
baseMinusT = base - t;
|
|
7401
|
-
output.push(
|
|
7402
|
-
stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
|
|
7403
|
-
);
|
|
7404
|
-
q = floor(qMinusT / baseMinusT);
|
|
7405
|
-
}
|
|
7406
|
-
|
|
7407
|
-
output.push(stringFromCharCode(digitToBasic(q, 0)));
|
|
7408
|
-
bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
|
|
7409
|
-
delta = 0;
|
|
7410
|
-
++handledCPCount;
|
|
7411
|
-
}
|
|
7412
|
-
}
|
|
7413
|
-
|
|
7414
|
-
++delta;
|
|
7415
|
-
++n;
|
|
7416
|
-
|
|
7417
|
-
}
|
|
7418
|
-
return output.join('');
|
|
7419
|
-
}
|
|
7420
|
-
|
|
7421
|
-
/**
|
|
7422
|
-
* Converts a Punycode string representing a domain name or an email address
|
|
7423
|
-
* to Unicode. Only the Punycoded parts of the input will be converted, i.e.
|
|
7424
|
-
* it doesn't matter if you call it on a string that has already been
|
|
7425
|
-
* converted to Unicode.
|
|
7426
|
-
* @memberOf punycode
|
|
7427
|
-
* @param {String} input The Punycoded domain name or email address to
|
|
7428
|
-
* convert to Unicode.
|
|
7429
|
-
* @returns {String} The Unicode representation of the given Punycode
|
|
7430
|
-
* string.
|
|
7431
|
-
*/
|
|
7432
|
-
function toUnicode(input) {
|
|
7433
|
-
return mapDomain(input, function(string) {
|
|
7434
|
-
return regexPunycode.test(string)
|
|
7435
|
-
? decode(string.slice(4).toLowerCase())
|
|
7436
|
-
: string;
|
|
7437
|
-
});
|
|
7438
|
-
}
|
|
7439
|
-
|
|
7440
|
-
/**
|
|
7441
|
-
* Converts a Unicode string representing a domain name or an email address to
|
|
7442
|
-
* Punycode. Only the non-ASCII parts of the domain name will be converted,
|
|
7443
|
-
* i.e. it doesn't matter if you call it with a domain that's already in
|
|
7444
|
-
* ASCII.
|
|
7445
|
-
* @memberOf punycode
|
|
7446
|
-
* @param {String} input The domain name or email address to convert, as a
|
|
7447
|
-
* Unicode string.
|
|
7448
|
-
* @returns {String} The Punycode representation of the given domain name or
|
|
7449
|
-
* email address.
|
|
7450
|
-
*/
|
|
7451
|
-
function toASCII(input) {
|
|
7452
|
-
return mapDomain(input, function(string) {
|
|
7453
|
-
return regexNonASCII.test(string)
|
|
7454
|
-
? 'xn--' + encode(string)
|
|
7455
|
-
: string;
|
|
7456
|
-
});
|
|
7457
|
-
}
|
|
7458
|
-
|
|
7459
|
-
/*--------------------------------------------------------------------------*/
|
|
7460
|
-
|
|
7461
|
-
/** Define the public API */
|
|
7462
|
-
punycode = {
|
|
7463
|
-
/**
|
|
7464
|
-
* A string representing the current Punycode.js version number.
|
|
7465
|
-
* @memberOf punycode
|
|
7466
|
-
* @type String
|
|
7467
|
-
*/
|
|
7468
|
-
'version': '1.4.1',
|
|
7469
|
-
/**
|
|
7470
|
-
* An object of methods to convert from JavaScript's internal character
|
|
7471
|
-
* representation (UCS-2) to Unicode code points, and back.
|
|
7472
|
-
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|
7473
|
-
* @memberOf punycode
|
|
7474
|
-
* @type Object
|
|
7475
|
-
*/
|
|
7476
|
-
'ucs2': {
|
|
7477
|
-
'decode': ucs2decode,
|
|
7478
|
-
'encode': ucs2encode
|
|
7479
|
-
},
|
|
7480
|
-
'decode': decode,
|
|
7481
|
-
'encode': encode,
|
|
7482
|
-
'toASCII': toASCII,
|
|
7483
|
-
'toUnicode': toUnicode
|
|
7484
|
-
};
|
|
7485
|
-
|
|
7486
|
-
/** Expose `punycode` */
|
|
7487
|
-
// Some AMD build optimizers, like r.js, check for specific condition patterns
|
|
7488
|
-
// like the following:
|
|
7489
|
-
if (
|
|
7490
|
-
true
|
|
7491
|
-
) {
|
|
7492
|
-
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
|
|
7493
|
-
return punycode;
|
|
7494
|
-
}).call(exports, __webpack_require__, exports, module),
|
|
7495
|
-
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
7496
|
-
} else {}
|
|
7497
|
-
|
|
7498
|
-
}(this));
|
|
7499
|
-
|
|
7500
|
-
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/module.js */ "../node_modules/webpack/buildin/module.js")(module), __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js")))
|
|
7501
|
-
|
|
7502
|
-
/***/ }),
|
|
7503
|
-
|
|
7504
6951
|
/***/ "../node_modules/object-inspect/index.js":
|
|
7505
6952
|
/*!***********************************************!*\
|
|
7506
6953
|
!*** ../node_modules/object-inspect/index.js ***!
|
|
@@ -9213,215 +8660,6 @@ module.exports = {
|
|
|
9213
8660
|
};
|
|
9214
8661
|
|
|
9215
8662
|
|
|
9216
|
-
/***/ }),
|
|
9217
|
-
|
|
9218
|
-
/***/ "../node_modules/querystring-es3/decode.js":
|
|
9219
|
-
/*!*************************************************!*\
|
|
9220
|
-
!*** ../node_modules/querystring-es3/decode.js ***!
|
|
9221
|
-
\*************************************************/
|
|
9222
|
-
/*! no static exports found */
|
|
9223
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
9224
|
-
|
|
9225
|
-
"use strict";
|
|
9226
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
9227
|
-
//
|
|
9228
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
9229
|
-
// copy of this software and associated documentation files (the
|
|
9230
|
-
// "Software"), to deal in the Software without restriction, including
|
|
9231
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
9232
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
9233
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
9234
|
-
// following conditions:
|
|
9235
|
-
//
|
|
9236
|
-
// The above copyright notice and this permission notice shall be included
|
|
9237
|
-
// in all copies or substantial portions of the Software.
|
|
9238
|
-
//
|
|
9239
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
9240
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
9241
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
9242
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
9243
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
9244
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
9245
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
// If obj.hasOwnProperty has been overridden, then calling
|
|
9250
|
-
// obj.hasOwnProperty(prop) will break.
|
|
9251
|
-
// See: https://github.com/joyent/node/issues/1707
|
|
9252
|
-
function hasOwnProperty(obj, prop) {
|
|
9253
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
9254
|
-
}
|
|
9255
|
-
|
|
9256
|
-
module.exports = function(qs, sep, eq, options) {
|
|
9257
|
-
sep = sep || '&';
|
|
9258
|
-
eq = eq || '=';
|
|
9259
|
-
var obj = {};
|
|
9260
|
-
|
|
9261
|
-
if (typeof qs !== 'string' || qs.length === 0) {
|
|
9262
|
-
return obj;
|
|
9263
|
-
}
|
|
9264
|
-
|
|
9265
|
-
var regexp = /\+/g;
|
|
9266
|
-
qs = qs.split(sep);
|
|
9267
|
-
|
|
9268
|
-
var maxKeys = 1000;
|
|
9269
|
-
if (options && typeof options.maxKeys === 'number') {
|
|
9270
|
-
maxKeys = options.maxKeys;
|
|
9271
|
-
}
|
|
9272
|
-
|
|
9273
|
-
var len = qs.length;
|
|
9274
|
-
// maxKeys <= 0 means that we should not limit keys count
|
|
9275
|
-
if (maxKeys > 0 && len > maxKeys) {
|
|
9276
|
-
len = maxKeys;
|
|
9277
|
-
}
|
|
9278
|
-
|
|
9279
|
-
for (var i = 0; i < len; ++i) {
|
|
9280
|
-
var x = qs[i].replace(regexp, '%20'),
|
|
9281
|
-
idx = x.indexOf(eq),
|
|
9282
|
-
kstr, vstr, k, v;
|
|
9283
|
-
|
|
9284
|
-
if (idx >= 0) {
|
|
9285
|
-
kstr = x.substr(0, idx);
|
|
9286
|
-
vstr = x.substr(idx + 1);
|
|
9287
|
-
} else {
|
|
9288
|
-
kstr = x;
|
|
9289
|
-
vstr = '';
|
|
9290
|
-
}
|
|
9291
|
-
|
|
9292
|
-
k = decodeURIComponent(kstr);
|
|
9293
|
-
v = decodeURIComponent(vstr);
|
|
9294
|
-
|
|
9295
|
-
if (!hasOwnProperty(obj, k)) {
|
|
9296
|
-
obj[k] = v;
|
|
9297
|
-
} else if (isArray(obj[k])) {
|
|
9298
|
-
obj[k].push(v);
|
|
9299
|
-
} else {
|
|
9300
|
-
obj[k] = [obj[k], v];
|
|
9301
|
-
}
|
|
9302
|
-
}
|
|
9303
|
-
|
|
9304
|
-
return obj;
|
|
9305
|
-
};
|
|
9306
|
-
|
|
9307
|
-
var isArray = Array.isArray || function (xs) {
|
|
9308
|
-
return Object.prototype.toString.call(xs) === '[object Array]';
|
|
9309
|
-
};
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
/***/ }),
|
|
9313
|
-
|
|
9314
|
-
/***/ "../node_modules/querystring-es3/encode.js":
|
|
9315
|
-
/*!*************************************************!*\
|
|
9316
|
-
!*** ../node_modules/querystring-es3/encode.js ***!
|
|
9317
|
-
\*************************************************/
|
|
9318
|
-
/*! no static exports found */
|
|
9319
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
9320
|
-
|
|
9321
|
-
"use strict";
|
|
9322
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
9323
|
-
//
|
|
9324
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
9325
|
-
// copy of this software and associated documentation files (the
|
|
9326
|
-
// "Software"), to deal in the Software without restriction, including
|
|
9327
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
9328
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
9329
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
9330
|
-
// following conditions:
|
|
9331
|
-
//
|
|
9332
|
-
// The above copyright notice and this permission notice shall be included
|
|
9333
|
-
// in all copies or substantial portions of the Software.
|
|
9334
|
-
//
|
|
9335
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
9336
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
9337
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
9338
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
9339
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
9340
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
9341
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
var stringifyPrimitive = function(v) {
|
|
9346
|
-
switch (typeof v) {
|
|
9347
|
-
case 'string':
|
|
9348
|
-
return v;
|
|
9349
|
-
|
|
9350
|
-
case 'boolean':
|
|
9351
|
-
return v ? 'true' : 'false';
|
|
9352
|
-
|
|
9353
|
-
case 'number':
|
|
9354
|
-
return isFinite(v) ? v : '';
|
|
9355
|
-
|
|
9356
|
-
default:
|
|
9357
|
-
return '';
|
|
9358
|
-
}
|
|
9359
|
-
};
|
|
9360
|
-
|
|
9361
|
-
module.exports = function(obj, sep, eq, name) {
|
|
9362
|
-
sep = sep || '&';
|
|
9363
|
-
eq = eq || '=';
|
|
9364
|
-
if (obj === null) {
|
|
9365
|
-
obj = undefined;
|
|
9366
|
-
}
|
|
9367
|
-
|
|
9368
|
-
if (typeof obj === 'object') {
|
|
9369
|
-
return map(objectKeys(obj), function(k) {
|
|
9370
|
-
var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
|
|
9371
|
-
if (isArray(obj[k])) {
|
|
9372
|
-
return map(obj[k], function(v) {
|
|
9373
|
-
return ks + encodeURIComponent(stringifyPrimitive(v));
|
|
9374
|
-
}).join(sep);
|
|
9375
|
-
} else {
|
|
9376
|
-
return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
|
|
9377
|
-
}
|
|
9378
|
-
}).join(sep);
|
|
9379
|
-
|
|
9380
|
-
}
|
|
9381
|
-
|
|
9382
|
-
if (!name) return '';
|
|
9383
|
-
return encodeURIComponent(stringifyPrimitive(name)) + eq +
|
|
9384
|
-
encodeURIComponent(stringifyPrimitive(obj));
|
|
9385
|
-
};
|
|
9386
|
-
|
|
9387
|
-
var isArray = Array.isArray || function (xs) {
|
|
9388
|
-
return Object.prototype.toString.call(xs) === '[object Array]';
|
|
9389
|
-
};
|
|
9390
|
-
|
|
9391
|
-
function map (xs, f) {
|
|
9392
|
-
if (xs.map) return xs.map(f);
|
|
9393
|
-
var res = [];
|
|
9394
|
-
for (var i = 0; i < xs.length; i++) {
|
|
9395
|
-
res.push(f(xs[i], i));
|
|
9396
|
-
}
|
|
9397
|
-
return res;
|
|
9398
|
-
}
|
|
9399
|
-
|
|
9400
|
-
var objectKeys = Object.keys || function (obj) {
|
|
9401
|
-
var res = [];
|
|
9402
|
-
for (var key in obj) {
|
|
9403
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);
|
|
9404
|
-
}
|
|
9405
|
-
return res;
|
|
9406
|
-
};
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
/***/ }),
|
|
9410
|
-
|
|
9411
|
-
/***/ "../node_modules/querystring-es3/index.js":
|
|
9412
|
-
/*!************************************************!*\
|
|
9413
|
-
!*** ../node_modules/querystring-es3/index.js ***!
|
|
9414
|
-
\************************************************/
|
|
9415
|
-
/*! no static exports found */
|
|
9416
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
9417
|
-
|
|
9418
|
-
"use strict";
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
exports.decode = exports.parse = __webpack_require__(/*! ./decode */ "../node_modules/querystring-es3/decode.js");
|
|
9422
|
-
exports.encode = exports.stringify = __webpack_require__(/*! ./encode */ "../node_modules/querystring-es3/encode.js");
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
8663
|
/***/ }),
|
|
9426
8664
|
|
|
9427
8665
|
/***/ "../node_modules/side-channel/index.js":
|
|
@@ -9558,778 +8796,6 @@ module.exports = function getSideChannel() {
|
|
|
9558
8796
|
};
|
|
9559
8797
|
|
|
9560
8798
|
|
|
9561
|
-
/***/ }),
|
|
9562
|
-
|
|
9563
|
-
/***/ "../node_modules/url/url.js":
|
|
9564
|
-
/*!**********************************!*\
|
|
9565
|
-
!*** ../node_modules/url/url.js ***!
|
|
9566
|
-
\**********************************/
|
|
9567
|
-
/*! no static exports found */
|
|
9568
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
9569
|
-
|
|
9570
|
-
"use strict";
|
|
9571
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
9572
|
-
//
|
|
9573
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
9574
|
-
// copy of this software and associated documentation files (the
|
|
9575
|
-
// "Software"), to deal in the Software without restriction, including
|
|
9576
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
9577
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
9578
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
9579
|
-
// following conditions:
|
|
9580
|
-
//
|
|
9581
|
-
// The above copyright notice and this permission notice shall be included
|
|
9582
|
-
// in all copies or substantial portions of the Software.
|
|
9583
|
-
//
|
|
9584
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
9585
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
9586
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
9587
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
9588
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
9589
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
9590
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
|
|
9594
|
-
var punycode = __webpack_require__(/*! punycode */ "../node_modules/node-libs-browser/node_modules/punycode/punycode.js");
|
|
9595
|
-
var util = __webpack_require__(/*! ./util */ "../node_modules/url/util.js");
|
|
9596
|
-
|
|
9597
|
-
exports.parse = urlParse;
|
|
9598
|
-
exports.resolve = urlResolve;
|
|
9599
|
-
exports.resolveObject = urlResolveObject;
|
|
9600
|
-
exports.format = urlFormat;
|
|
9601
|
-
|
|
9602
|
-
exports.Url = Url;
|
|
9603
|
-
|
|
9604
|
-
function Url() {
|
|
9605
|
-
this.protocol = null;
|
|
9606
|
-
this.slashes = null;
|
|
9607
|
-
this.auth = null;
|
|
9608
|
-
this.host = null;
|
|
9609
|
-
this.port = null;
|
|
9610
|
-
this.hostname = null;
|
|
9611
|
-
this.hash = null;
|
|
9612
|
-
this.search = null;
|
|
9613
|
-
this.query = null;
|
|
9614
|
-
this.pathname = null;
|
|
9615
|
-
this.path = null;
|
|
9616
|
-
this.href = null;
|
|
9617
|
-
}
|
|
9618
|
-
|
|
9619
|
-
// Reference: RFC 3986, RFC 1808, RFC 2396
|
|
9620
|
-
|
|
9621
|
-
// define these here so at least they only have to be
|
|
9622
|
-
// compiled once on the first module load.
|
|
9623
|
-
var protocolPattern = /^([a-z0-9.+-]+:)/i,
|
|
9624
|
-
portPattern = /:[0-9]*$/,
|
|
9625
|
-
|
|
9626
|
-
// Special case for a simple path URL
|
|
9627
|
-
simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
|
|
9628
|
-
|
|
9629
|
-
// RFC 2396: characters reserved for delimiting URLs.
|
|
9630
|
-
// We actually just auto-escape these.
|
|
9631
|
-
delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
|
|
9632
|
-
|
|
9633
|
-
// RFC 2396: characters not allowed for various reasons.
|
|
9634
|
-
unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims),
|
|
9635
|
-
|
|
9636
|
-
// Allowed by RFCs, but cause of XSS attacks. Always escape these.
|
|
9637
|
-
autoEscape = ['\''].concat(unwise),
|
|
9638
|
-
// Characters that are never ever allowed in a hostname.
|
|
9639
|
-
// Note that any invalid chars are also handled, but these
|
|
9640
|
-
// are the ones that are *expected* to be seen, so we fast-path
|
|
9641
|
-
// them.
|
|
9642
|
-
nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),
|
|
9643
|
-
hostEndingChars = ['/', '?', '#'],
|
|
9644
|
-
hostnameMaxLen = 255,
|
|
9645
|
-
hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
|
|
9646
|
-
hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
|
|
9647
|
-
// protocols that can allow "unsafe" and "unwise" chars.
|
|
9648
|
-
unsafeProtocol = {
|
|
9649
|
-
'javascript': true,
|
|
9650
|
-
'javascript:': true
|
|
9651
|
-
},
|
|
9652
|
-
// protocols that never have a hostname.
|
|
9653
|
-
hostlessProtocol = {
|
|
9654
|
-
'javascript': true,
|
|
9655
|
-
'javascript:': true
|
|
9656
|
-
},
|
|
9657
|
-
// protocols that always contain a // bit.
|
|
9658
|
-
slashedProtocol = {
|
|
9659
|
-
'http': true,
|
|
9660
|
-
'https': true,
|
|
9661
|
-
'ftp': true,
|
|
9662
|
-
'gopher': true,
|
|
9663
|
-
'file': true,
|
|
9664
|
-
'http:': true,
|
|
9665
|
-
'https:': true,
|
|
9666
|
-
'ftp:': true,
|
|
9667
|
-
'gopher:': true,
|
|
9668
|
-
'file:': true
|
|
9669
|
-
},
|
|
9670
|
-
querystring = __webpack_require__(/*! querystring */ "../node_modules/querystring-es3/index.js");
|
|
9671
|
-
|
|
9672
|
-
function urlParse(url, parseQueryString, slashesDenoteHost) {
|
|
9673
|
-
if (url && util.isObject(url) && url instanceof Url) return url;
|
|
9674
|
-
|
|
9675
|
-
var u = new Url;
|
|
9676
|
-
u.parse(url, parseQueryString, slashesDenoteHost);
|
|
9677
|
-
return u;
|
|
9678
|
-
}
|
|
9679
|
-
|
|
9680
|
-
Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
|
|
9681
|
-
if (!util.isString(url)) {
|
|
9682
|
-
throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
|
|
9683
|
-
}
|
|
9684
|
-
|
|
9685
|
-
// Copy chrome, IE, opera backslash-handling behavior.
|
|
9686
|
-
// Back slashes before the query string get converted to forward slashes
|
|
9687
|
-
// See: https://code.google.com/p/chromium/issues/detail?id=25916
|
|
9688
|
-
var queryIndex = url.indexOf('?'),
|
|
9689
|
-
splitter =
|
|
9690
|
-
(queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',
|
|
9691
|
-
uSplit = url.split(splitter),
|
|
9692
|
-
slashRegex = /\\/g;
|
|
9693
|
-
uSplit[0] = uSplit[0].replace(slashRegex, '/');
|
|
9694
|
-
url = uSplit.join(splitter);
|
|
9695
|
-
|
|
9696
|
-
var rest = url;
|
|
9697
|
-
|
|
9698
|
-
// trim before proceeding.
|
|
9699
|
-
// This is to support parse stuff like " http://foo.com \n"
|
|
9700
|
-
rest = rest.trim();
|
|
9701
|
-
|
|
9702
|
-
if (!slashesDenoteHost && url.split('#').length === 1) {
|
|
9703
|
-
// Try fast path regexp
|
|
9704
|
-
var simplePath = simplePathPattern.exec(rest);
|
|
9705
|
-
if (simplePath) {
|
|
9706
|
-
this.path = rest;
|
|
9707
|
-
this.href = rest;
|
|
9708
|
-
this.pathname = simplePath[1];
|
|
9709
|
-
if (simplePath[2]) {
|
|
9710
|
-
this.search = simplePath[2];
|
|
9711
|
-
if (parseQueryString) {
|
|
9712
|
-
this.query = querystring.parse(this.search.substr(1));
|
|
9713
|
-
} else {
|
|
9714
|
-
this.query = this.search.substr(1);
|
|
9715
|
-
}
|
|
9716
|
-
} else if (parseQueryString) {
|
|
9717
|
-
this.search = '';
|
|
9718
|
-
this.query = {};
|
|
9719
|
-
}
|
|
9720
|
-
return this;
|
|
9721
|
-
}
|
|
9722
|
-
}
|
|
9723
|
-
|
|
9724
|
-
var proto = protocolPattern.exec(rest);
|
|
9725
|
-
if (proto) {
|
|
9726
|
-
proto = proto[0];
|
|
9727
|
-
var lowerProto = proto.toLowerCase();
|
|
9728
|
-
this.protocol = lowerProto;
|
|
9729
|
-
rest = rest.substr(proto.length);
|
|
9730
|
-
}
|
|
9731
|
-
|
|
9732
|
-
// figure out if it's got a host
|
|
9733
|
-
// user@server is *always* interpreted as a hostname, and url
|
|
9734
|
-
// resolution will treat //foo/bar as host=foo,path=bar because that's
|
|
9735
|
-
// how the browser resolves relative URLs.
|
|
9736
|
-
if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
|
|
9737
|
-
var slashes = rest.substr(0, 2) === '//';
|
|
9738
|
-
if (slashes && !(proto && hostlessProtocol[proto])) {
|
|
9739
|
-
rest = rest.substr(2);
|
|
9740
|
-
this.slashes = true;
|
|
9741
|
-
}
|
|
9742
|
-
}
|
|
9743
|
-
|
|
9744
|
-
if (!hostlessProtocol[proto] &&
|
|
9745
|
-
(slashes || (proto && !slashedProtocol[proto]))) {
|
|
9746
|
-
|
|
9747
|
-
// there's a hostname.
|
|
9748
|
-
// the first instance of /, ?, ;, or # ends the host.
|
|
9749
|
-
//
|
|
9750
|
-
// If there is an @ in the hostname, then non-host chars *are* allowed
|
|
9751
|
-
// to the left of the last @ sign, unless some host-ending character
|
|
9752
|
-
// comes *before* the @-sign.
|
|
9753
|
-
// URLs are obnoxious.
|
|
9754
|
-
//
|
|
9755
|
-
// ex:
|
|
9756
|
-
// http://a@b@c/ => user:a@b host:c
|
|
9757
|
-
// http://a@b?@c => user:a host:c path:/?@c
|
|
9758
|
-
|
|
9759
|
-
// v0.12 TODO(isaacs): This is not quite how Chrome does things.
|
|
9760
|
-
// Review our test case against browsers more comprehensively.
|
|
9761
|
-
|
|
9762
|
-
// find the first instance of any hostEndingChars
|
|
9763
|
-
var hostEnd = -1;
|
|
9764
|
-
for (var i = 0; i < hostEndingChars.length; i++) {
|
|
9765
|
-
var hec = rest.indexOf(hostEndingChars[i]);
|
|
9766
|
-
if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
|
|
9767
|
-
hostEnd = hec;
|
|
9768
|
-
}
|
|
9769
|
-
|
|
9770
|
-
// at this point, either we have an explicit point where the
|
|
9771
|
-
// auth portion cannot go past, or the last @ char is the decider.
|
|
9772
|
-
var auth, atSign;
|
|
9773
|
-
if (hostEnd === -1) {
|
|
9774
|
-
// atSign can be anywhere.
|
|
9775
|
-
atSign = rest.lastIndexOf('@');
|
|
9776
|
-
} else {
|
|
9777
|
-
// atSign must be in auth portion.
|
|
9778
|
-
// http://a@b/c@d => host:b auth:a path:/c@d
|
|
9779
|
-
atSign = rest.lastIndexOf('@', hostEnd);
|
|
9780
|
-
}
|
|
9781
|
-
|
|
9782
|
-
// Now we have a portion which is definitely the auth.
|
|
9783
|
-
// Pull that off.
|
|
9784
|
-
if (atSign !== -1) {
|
|
9785
|
-
auth = rest.slice(0, atSign);
|
|
9786
|
-
rest = rest.slice(atSign + 1);
|
|
9787
|
-
this.auth = decodeURIComponent(auth);
|
|
9788
|
-
}
|
|
9789
|
-
|
|
9790
|
-
// the host is the remaining to the left of the first non-host char
|
|
9791
|
-
hostEnd = -1;
|
|
9792
|
-
for (var i = 0; i < nonHostChars.length; i++) {
|
|
9793
|
-
var hec = rest.indexOf(nonHostChars[i]);
|
|
9794
|
-
if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
|
|
9795
|
-
hostEnd = hec;
|
|
9796
|
-
}
|
|
9797
|
-
// if we still have not hit it, then the entire thing is a host.
|
|
9798
|
-
if (hostEnd === -1)
|
|
9799
|
-
hostEnd = rest.length;
|
|
9800
|
-
|
|
9801
|
-
this.host = rest.slice(0, hostEnd);
|
|
9802
|
-
rest = rest.slice(hostEnd);
|
|
9803
|
-
|
|
9804
|
-
// pull out port.
|
|
9805
|
-
this.parseHost();
|
|
9806
|
-
|
|
9807
|
-
// we've indicated that there is a hostname,
|
|
9808
|
-
// so even if it's empty, it has to be present.
|
|
9809
|
-
this.hostname = this.hostname || '';
|
|
9810
|
-
|
|
9811
|
-
// if hostname begins with [ and ends with ]
|
|
9812
|
-
// assume that it's an IPv6 address.
|
|
9813
|
-
var ipv6Hostname = this.hostname[0] === '[' &&
|
|
9814
|
-
this.hostname[this.hostname.length - 1] === ']';
|
|
9815
|
-
|
|
9816
|
-
// validate a little.
|
|
9817
|
-
if (!ipv6Hostname) {
|
|
9818
|
-
var hostparts = this.hostname.split(/\./);
|
|
9819
|
-
for (var i = 0, l = hostparts.length; i < l; i++) {
|
|
9820
|
-
var part = hostparts[i];
|
|
9821
|
-
if (!part) continue;
|
|
9822
|
-
if (!part.match(hostnamePartPattern)) {
|
|
9823
|
-
var newpart = '';
|
|
9824
|
-
for (var j = 0, k = part.length; j < k; j++) {
|
|
9825
|
-
if (part.charCodeAt(j) > 127) {
|
|
9826
|
-
// we replace non-ASCII char with a temporary placeholder
|
|
9827
|
-
// we need this to make sure size of hostname is not
|
|
9828
|
-
// broken by replacing non-ASCII by nothing
|
|
9829
|
-
newpart += 'x';
|
|
9830
|
-
} else {
|
|
9831
|
-
newpart += part[j];
|
|
9832
|
-
}
|
|
9833
|
-
}
|
|
9834
|
-
// we test again with ASCII char only
|
|
9835
|
-
if (!newpart.match(hostnamePartPattern)) {
|
|
9836
|
-
var validParts = hostparts.slice(0, i);
|
|
9837
|
-
var notHost = hostparts.slice(i + 1);
|
|
9838
|
-
var bit = part.match(hostnamePartStart);
|
|
9839
|
-
if (bit) {
|
|
9840
|
-
validParts.push(bit[1]);
|
|
9841
|
-
notHost.unshift(bit[2]);
|
|
9842
|
-
}
|
|
9843
|
-
if (notHost.length) {
|
|
9844
|
-
rest = '/' + notHost.join('.') + rest;
|
|
9845
|
-
}
|
|
9846
|
-
this.hostname = validParts.join('.');
|
|
9847
|
-
break;
|
|
9848
|
-
}
|
|
9849
|
-
}
|
|
9850
|
-
}
|
|
9851
|
-
}
|
|
9852
|
-
|
|
9853
|
-
if (this.hostname.length > hostnameMaxLen) {
|
|
9854
|
-
this.hostname = '';
|
|
9855
|
-
} else {
|
|
9856
|
-
// hostnames are always lower case.
|
|
9857
|
-
this.hostname = this.hostname.toLowerCase();
|
|
9858
|
-
}
|
|
9859
|
-
|
|
9860
|
-
if (!ipv6Hostname) {
|
|
9861
|
-
// IDNA Support: Returns a punycoded representation of "domain".
|
|
9862
|
-
// It only converts parts of the domain name that
|
|
9863
|
-
// have non-ASCII characters, i.e. it doesn't matter if
|
|
9864
|
-
// you call it with a domain that already is ASCII-only.
|
|
9865
|
-
this.hostname = punycode.toASCII(this.hostname);
|
|
9866
|
-
}
|
|
9867
|
-
|
|
9868
|
-
var p = this.port ? ':' + this.port : '';
|
|
9869
|
-
var h = this.hostname || '';
|
|
9870
|
-
this.host = h + p;
|
|
9871
|
-
this.href += this.host;
|
|
9872
|
-
|
|
9873
|
-
// strip [ and ] from the hostname
|
|
9874
|
-
// the host field still retains them, though
|
|
9875
|
-
if (ipv6Hostname) {
|
|
9876
|
-
this.hostname = this.hostname.substr(1, this.hostname.length - 2);
|
|
9877
|
-
if (rest[0] !== '/') {
|
|
9878
|
-
rest = '/' + rest;
|
|
9879
|
-
}
|
|
9880
|
-
}
|
|
9881
|
-
}
|
|
9882
|
-
|
|
9883
|
-
// now rest is set to the post-host stuff.
|
|
9884
|
-
// chop off any delim chars.
|
|
9885
|
-
if (!unsafeProtocol[lowerProto]) {
|
|
9886
|
-
|
|
9887
|
-
// First, make 100% sure that any "autoEscape" chars get
|
|
9888
|
-
// escaped, even if encodeURIComponent doesn't think they
|
|
9889
|
-
// need to be.
|
|
9890
|
-
for (var i = 0, l = autoEscape.length; i < l; i++) {
|
|
9891
|
-
var ae = autoEscape[i];
|
|
9892
|
-
if (rest.indexOf(ae) === -1)
|
|
9893
|
-
continue;
|
|
9894
|
-
var esc = encodeURIComponent(ae);
|
|
9895
|
-
if (esc === ae) {
|
|
9896
|
-
esc = escape(ae);
|
|
9897
|
-
}
|
|
9898
|
-
rest = rest.split(ae).join(esc);
|
|
9899
|
-
}
|
|
9900
|
-
}
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
// chop off from the tail first.
|
|
9904
|
-
var hash = rest.indexOf('#');
|
|
9905
|
-
if (hash !== -1) {
|
|
9906
|
-
// got a fragment string.
|
|
9907
|
-
this.hash = rest.substr(hash);
|
|
9908
|
-
rest = rest.slice(0, hash);
|
|
9909
|
-
}
|
|
9910
|
-
var qm = rest.indexOf('?');
|
|
9911
|
-
if (qm !== -1) {
|
|
9912
|
-
this.search = rest.substr(qm);
|
|
9913
|
-
this.query = rest.substr(qm + 1);
|
|
9914
|
-
if (parseQueryString) {
|
|
9915
|
-
this.query = querystring.parse(this.query);
|
|
9916
|
-
}
|
|
9917
|
-
rest = rest.slice(0, qm);
|
|
9918
|
-
} else if (parseQueryString) {
|
|
9919
|
-
// no query string, but parseQueryString still requested
|
|
9920
|
-
this.search = '';
|
|
9921
|
-
this.query = {};
|
|
9922
|
-
}
|
|
9923
|
-
if (rest) this.pathname = rest;
|
|
9924
|
-
if (slashedProtocol[lowerProto] &&
|
|
9925
|
-
this.hostname && !this.pathname) {
|
|
9926
|
-
this.pathname = '/';
|
|
9927
|
-
}
|
|
9928
|
-
|
|
9929
|
-
//to support http.request
|
|
9930
|
-
if (this.pathname || this.search) {
|
|
9931
|
-
var p = this.pathname || '';
|
|
9932
|
-
var s = this.search || '';
|
|
9933
|
-
this.path = p + s;
|
|
9934
|
-
}
|
|
9935
|
-
|
|
9936
|
-
// finally, reconstruct the href based on what has been validated.
|
|
9937
|
-
this.href = this.format();
|
|
9938
|
-
return this;
|
|
9939
|
-
};
|
|
9940
|
-
|
|
9941
|
-
// format a parsed object into a url string
|
|
9942
|
-
function urlFormat(obj) {
|
|
9943
|
-
// ensure it's an object, and not a string url.
|
|
9944
|
-
// If it's an obj, this is a no-op.
|
|
9945
|
-
// this way, you can call url_format() on strings
|
|
9946
|
-
// to clean up potentially wonky urls.
|
|
9947
|
-
if (util.isString(obj)) obj = urlParse(obj);
|
|
9948
|
-
if (!(obj instanceof Url)) return Url.prototype.format.call(obj);
|
|
9949
|
-
return obj.format();
|
|
9950
|
-
}
|
|
9951
|
-
|
|
9952
|
-
Url.prototype.format = function() {
|
|
9953
|
-
var auth = this.auth || '';
|
|
9954
|
-
if (auth) {
|
|
9955
|
-
auth = encodeURIComponent(auth);
|
|
9956
|
-
auth = auth.replace(/%3A/i, ':');
|
|
9957
|
-
auth += '@';
|
|
9958
|
-
}
|
|
9959
|
-
|
|
9960
|
-
var protocol = this.protocol || '',
|
|
9961
|
-
pathname = this.pathname || '',
|
|
9962
|
-
hash = this.hash || '',
|
|
9963
|
-
host = false,
|
|
9964
|
-
query = '';
|
|
9965
|
-
|
|
9966
|
-
if (this.host) {
|
|
9967
|
-
host = auth + this.host;
|
|
9968
|
-
} else if (this.hostname) {
|
|
9969
|
-
host = auth + (this.hostname.indexOf(':') === -1 ?
|
|
9970
|
-
this.hostname :
|
|
9971
|
-
'[' + this.hostname + ']');
|
|
9972
|
-
if (this.port) {
|
|
9973
|
-
host += ':' + this.port;
|
|
9974
|
-
}
|
|
9975
|
-
}
|
|
9976
|
-
|
|
9977
|
-
if (this.query &&
|
|
9978
|
-
util.isObject(this.query) &&
|
|
9979
|
-
Object.keys(this.query).length) {
|
|
9980
|
-
query = querystring.stringify(this.query);
|
|
9981
|
-
}
|
|
9982
|
-
|
|
9983
|
-
var search = this.search || (query && ('?' + query)) || '';
|
|
9984
|
-
|
|
9985
|
-
if (protocol && protocol.substr(-1) !== ':') protocol += ':';
|
|
9986
|
-
|
|
9987
|
-
// only the slashedProtocols get the //. Not mailto:, xmpp:, etc.
|
|
9988
|
-
// unless they had them to begin with.
|
|
9989
|
-
if (this.slashes ||
|
|
9990
|
-
(!protocol || slashedProtocol[protocol]) && host !== false) {
|
|
9991
|
-
host = '//' + (host || '');
|
|
9992
|
-
if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;
|
|
9993
|
-
} else if (!host) {
|
|
9994
|
-
host = '';
|
|
9995
|
-
}
|
|
9996
|
-
|
|
9997
|
-
if (hash && hash.charAt(0) !== '#') hash = '#' + hash;
|
|
9998
|
-
if (search && search.charAt(0) !== '?') search = '?' + search;
|
|
9999
|
-
|
|
10000
|
-
pathname = pathname.replace(/[?#]/g, function(match) {
|
|
10001
|
-
return encodeURIComponent(match);
|
|
10002
|
-
});
|
|
10003
|
-
search = search.replace('#', '%23');
|
|
10004
|
-
|
|
10005
|
-
return protocol + host + pathname + search + hash;
|
|
10006
|
-
};
|
|
10007
|
-
|
|
10008
|
-
function urlResolve(source, relative) {
|
|
10009
|
-
return urlParse(source, false, true).resolve(relative);
|
|
10010
|
-
}
|
|
10011
|
-
|
|
10012
|
-
Url.prototype.resolve = function(relative) {
|
|
10013
|
-
return this.resolveObject(urlParse(relative, false, true)).format();
|
|
10014
|
-
};
|
|
10015
|
-
|
|
10016
|
-
function urlResolveObject(source, relative) {
|
|
10017
|
-
if (!source) return relative;
|
|
10018
|
-
return urlParse(source, false, true).resolveObject(relative);
|
|
10019
|
-
}
|
|
10020
|
-
|
|
10021
|
-
Url.prototype.resolveObject = function(relative) {
|
|
10022
|
-
if (util.isString(relative)) {
|
|
10023
|
-
var rel = new Url();
|
|
10024
|
-
rel.parse(relative, false, true);
|
|
10025
|
-
relative = rel;
|
|
10026
|
-
}
|
|
10027
|
-
|
|
10028
|
-
var result = new Url();
|
|
10029
|
-
var tkeys = Object.keys(this);
|
|
10030
|
-
for (var tk = 0; tk < tkeys.length; tk++) {
|
|
10031
|
-
var tkey = tkeys[tk];
|
|
10032
|
-
result[tkey] = this[tkey];
|
|
10033
|
-
}
|
|
10034
|
-
|
|
10035
|
-
// hash is always overridden, no matter what.
|
|
10036
|
-
// even href="" will remove it.
|
|
10037
|
-
result.hash = relative.hash;
|
|
10038
|
-
|
|
10039
|
-
// if the relative url is empty, then there's nothing left to do here.
|
|
10040
|
-
if (relative.href === '') {
|
|
10041
|
-
result.href = result.format();
|
|
10042
|
-
return result;
|
|
10043
|
-
}
|
|
10044
|
-
|
|
10045
|
-
// hrefs like //foo/bar always cut to the protocol.
|
|
10046
|
-
if (relative.slashes && !relative.protocol) {
|
|
10047
|
-
// take everything except the protocol from relative
|
|
10048
|
-
var rkeys = Object.keys(relative);
|
|
10049
|
-
for (var rk = 0; rk < rkeys.length; rk++) {
|
|
10050
|
-
var rkey = rkeys[rk];
|
|
10051
|
-
if (rkey !== 'protocol')
|
|
10052
|
-
result[rkey] = relative[rkey];
|
|
10053
|
-
}
|
|
10054
|
-
|
|
10055
|
-
//urlParse appends trailing / to urls like http://www.example.com
|
|
10056
|
-
if (slashedProtocol[result.protocol] &&
|
|
10057
|
-
result.hostname && !result.pathname) {
|
|
10058
|
-
result.path = result.pathname = '/';
|
|
10059
|
-
}
|
|
10060
|
-
|
|
10061
|
-
result.href = result.format();
|
|
10062
|
-
return result;
|
|
10063
|
-
}
|
|
10064
|
-
|
|
10065
|
-
if (relative.protocol && relative.protocol !== result.protocol) {
|
|
10066
|
-
// if it's a known url protocol, then changing
|
|
10067
|
-
// the protocol does weird things
|
|
10068
|
-
// first, if it's not file:, then we MUST have a host,
|
|
10069
|
-
// and if there was a path
|
|
10070
|
-
// to begin with, then we MUST have a path.
|
|
10071
|
-
// if it is file:, then the host is dropped,
|
|
10072
|
-
// because that's known to be hostless.
|
|
10073
|
-
// anything else is assumed to be absolute.
|
|
10074
|
-
if (!slashedProtocol[relative.protocol]) {
|
|
10075
|
-
var keys = Object.keys(relative);
|
|
10076
|
-
for (var v = 0; v < keys.length; v++) {
|
|
10077
|
-
var k = keys[v];
|
|
10078
|
-
result[k] = relative[k];
|
|
10079
|
-
}
|
|
10080
|
-
result.href = result.format();
|
|
10081
|
-
return result;
|
|
10082
|
-
}
|
|
10083
|
-
|
|
10084
|
-
result.protocol = relative.protocol;
|
|
10085
|
-
if (!relative.host && !hostlessProtocol[relative.protocol]) {
|
|
10086
|
-
var relPath = (relative.pathname || '').split('/');
|
|
10087
|
-
while (relPath.length && !(relative.host = relPath.shift()));
|
|
10088
|
-
if (!relative.host) relative.host = '';
|
|
10089
|
-
if (!relative.hostname) relative.hostname = '';
|
|
10090
|
-
if (relPath[0] !== '') relPath.unshift('');
|
|
10091
|
-
if (relPath.length < 2) relPath.unshift('');
|
|
10092
|
-
result.pathname = relPath.join('/');
|
|
10093
|
-
} else {
|
|
10094
|
-
result.pathname = relative.pathname;
|
|
10095
|
-
}
|
|
10096
|
-
result.search = relative.search;
|
|
10097
|
-
result.query = relative.query;
|
|
10098
|
-
result.host = relative.host || '';
|
|
10099
|
-
result.auth = relative.auth;
|
|
10100
|
-
result.hostname = relative.hostname || relative.host;
|
|
10101
|
-
result.port = relative.port;
|
|
10102
|
-
// to support http.request
|
|
10103
|
-
if (result.pathname || result.search) {
|
|
10104
|
-
var p = result.pathname || '';
|
|
10105
|
-
var s = result.search || '';
|
|
10106
|
-
result.path = p + s;
|
|
10107
|
-
}
|
|
10108
|
-
result.slashes = result.slashes || relative.slashes;
|
|
10109
|
-
result.href = result.format();
|
|
10110
|
-
return result;
|
|
10111
|
-
}
|
|
10112
|
-
|
|
10113
|
-
var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),
|
|
10114
|
-
isRelAbs = (
|
|
10115
|
-
relative.host ||
|
|
10116
|
-
relative.pathname && relative.pathname.charAt(0) === '/'
|
|
10117
|
-
),
|
|
10118
|
-
mustEndAbs = (isRelAbs || isSourceAbs ||
|
|
10119
|
-
(result.host && relative.pathname)),
|
|
10120
|
-
removeAllDots = mustEndAbs,
|
|
10121
|
-
srcPath = result.pathname && result.pathname.split('/') || [],
|
|
10122
|
-
relPath = relative.pathname && relative.pathname.split('/') || [],
|
|
10123
|
-
psychotic = result.protocol && !slashedProtocol[result.protocol];
|
|
10124
|
-
|
|
10125
|
-
// if the url is a non-slashed url, then relative
|
|
10126
|
-
// links like ../.. should be able
|
|
10127
|
-
// to crawl up to the hostname, as well. This is strange.
|
|
10128
|
-
// result.protocol has already been set by now.
|
|
10129
|
-
// Later on, put the first path part into the host field.
|
|
10130
|
-
if (psychotic) {
|
|
10131
|
-
result.hostname = '';
|
|
10132
|
-
result.port = null;
|
|
10133
|
-
if (result.host) {
|
|
10134
|
-
if (srcPath[0] === '') srcPath[0] = result.host;
|
|
10135
|
-
else srcPath.unshift(result.host);
|
|
10136
|
-
}
|
|
10137
|
-
result.host = '';
|
|
10138
|
-
if (relative.protocol) {
|
|
10139
|
-
relative.hostname = null;
|
|
10140
|
-
relative.port = null;
|
|
10141
|
-
if (relative.host) {
|
|
10142
|
-
if (relPath[0] === '') relPath[0] = relative.host;
|
|
10143
|
-
else relPath.unshift(relative.host);
|
|
10144
|
-
}
|
|
10145
|
-
relative.host = null;
|
|
10146
|
-
}
|
|
10147
|
-
mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
|
|
10148
|
-
}
|
|
10149
|
-
|
|
10150
|
-
if (isRelAbs) {
|
|
10151
|
-
// it's absolute.
|
|
10152
|
-
result.host = (relative.host || relative.host === '') ?
|
|
10153
|
-
relative.host : result.host;
|
|
10154
|
-
result.hostname = (relative.hostname || relative.hostname === '') ?
|
|
10155
|
-
relative.hostname : result.hostname;
|
|
10156
|
-
result.search = relative.search;
|
|
10157
|
-
result.query = relative.query;
|
|
10158
|
-
srcPath = relPath;
|
|
10159
|
-
// fall through to the dot-handling below.
|
|
10160
|
-
} else if (relPath.length) {
|
|
10161
|
-
// it's relative
|
|
10162
|
-
// throw away the existing file, and take the new path instead.
|
|
10163
|
-
if (!srcPath) srcPath = [];
|
|
10164
|
-
srcPath.pop();
|
|
10165
|
-
srcPath = srcPath.concat(relPath);
|
|
10166
|
-
result.search = relative.search;
|
|
10167
|
-
result.query = relative.query;
|
|
10168
|
-
} else if (!util.isNullOrUndefined(relative.search)) {
|
|
10169
|
-
// just pull out the search.
|
|
10170
|
-
// like href='?foo'.
|
|
10171
|
-
// Put this after the other two cases because it simplifies the booleans
|
|
10172
|
-
if (psychotic) {
|
|
10173
|
-
result.hostname = result.host = srcPath.shift();
|
|
10174
|
-
//occationaly the auth can get stuck only in host
|
|
10175
|
-
//this especially happens in cases like
|
|
10176
|
-
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
|
|
10177
|
-
var authInHost = result.host && result.host.indexOf('@') > 0 ?
|
|
10178
|
-
result.host.split('@') : false;
|
|
10179
|
-
if (authInHost) {
|
|
10180
|
-
result.auth = authInHost.shift();
|
|
10181
|
-
result.host = result.hostname = authInHost.shift();
|
|
10182
|
-
}
|
|
10183
|
-
}
|
|
10184
|
-
result.search = relative.search;
|
|
10185
|
-
result.query = relative.query;
|
|
10186
|
-
//to support http.request
|
|
10187
|
-
if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
|
|
10188
|
-
result.path = (result.pathname ? result.pathname : '') +
|
|
10189
|
-
(result.search ? result.search : '');
|
|
10190
|
-
}
|
|
10191
|
-
result.href = result.format();
|
|
10192
|
-
return result;
|
|
10193
|
-
}
|
|
10194
|
-
|
|
10195
|
-
if (!srcPath.length) {
|
|
10196
|
-
// no path at all. easy.
|
|
10197
|
-
// we've already handled the other stuff above.
|
|
10198
|
-
result.pathname = null;
|
|
10199
|
-
//to support http.request
|
|
10200
|
-
if (result.search) {
|
|
10201
|
-
result.path = '/' + result.search;
|
|
10202
|
-
} else {
|
|
10203
|
-
result.path = null;
|
|
10204
|
-
}
|
|
10205
|
-
result.href = result.format();
|
|
10206
|
-
return result;
|
|
10207
|
-
}
|
|
10208
|
-
|
|
10209
|
-
// if a url ENDs in . or .., then it must get a trailing slash.
|
|
10210
|
-
// however, if it ends in anything else non-slashy,
|
|
10211
|
-
// then it must NOT get a trailing slash.
|
|
10212
|
-
var last = srcPath.slice(-1)[0];
|
|
10213
|
-
var hasTrailingSlash = (
|
|
10214
|
-
(result.host || relative.host || srcPath.length > 1) &&
|
|
10215
|
-
(last === '.' || last === '..') || last === '');
|
|
10216
|
-
|
|
10217
|
-
// strip single dots, resolve double dots to parent dir
|
|
10218
|
-
// if the path tries to go above the root, `up` ends up > 0
|
|
10219
|
-
var up = 0;
|
|
10220
|
-
for (var i = srcPath.length; i >= 0; i--) {
|
|
10221
|
-
last = srcPath[i];
|
|
10222
|
-
if (last === '.') {
|
|
10223
|
-
srcPath.splice(i, 1);
|
|
10224
|
-
} else if (last === '..') {
|
|
10225
|
-
srcPath.splice(i, 1);
|
|
10226
|
-
up++;
|
|
10227
|
-
} else if (up) {
|
|
10228
|
-
srcPath.splice(i, 1);
|
|
10229
|
-
up--;
|
|
10230
|
-
}
|
|
10231
|
-
}
|
|
10232
|
-
|
|
10233
|
-
// if the path is allowed to go above the root, restore leading ..s
|
|
10234
|
-
if (!mustEndAbs && !removeAllDots) {
|
|
10235
|
-
for (; up--; up) {
|
|
10236
|
-
srcPath.unshift('..');
|
|
10237
|
-
}
|
|
10238
|
-
}
|
|
10239
|
-
|
|
10240
|
-
if (mustEndAbs && srcPath[0] !== '' &&
|
|
10241
|
-
(!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
|
|
10242
|
-
srcPath.unshift('');
|
|
10243
|
-
}
|
|
10244
|
-
|
|
10245
|
-
if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
|
|
10246
|
-
srcPath.push('');
|
|
10247
|
-
}
|
|
10248
|
-
|
|
10249
|
-
var isAbsolute = srcPath[0] === '' ||
|
|
10250
|
-
(srcPath[0] && srcPath[0].charAt(0) === '/');
|
|
10251
|
-
|
|
10252
|
-
// put the host back
|
|
10253
|
-
if (psychotic) {
|
|
10254
|
-
result.hostname = result.host = isAbsolute ? '' :
|
|
10255
|
-
srcPath.length ? srcPath.shift() : '';
|
|
10256
|
-
//occationaly the auth can get stuck only in host
|
|
10257
|
-
//this especially happens in cases like
|
|
10258
|
-
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
|
|
10259
|
-
var authInHost = result.host && result.host.indexOf('@') > 0 ?
|
|
10260
|
-
result.host.split('@') : false;
|
|
10261
|
-
if (authInHost) {
|
|
10262
|
-
result.auth = authInHost.shift();
|
|
10263
|
-
result.host = result.hostname = authInHost.shift();
|
|
10264
|
-
}
|
|
10265
|
-
}
|
|
10266
|
-
|
|
10267
|
-
mustEndAbs = mustEndAbs || (result.host && srcPath.length);
|
|
10268
|
-
|
|
10269
|
-
if (mustEndAbs && !isAbsolute) {
|
|
10270
|
-
srcPath.unshift('');
|
|
10271
|
-
}
|
|
10272
|
-
|
|
10273
|
-
if (!srcPath.length) {
|
|
10274
|
-
result.pathname = null;
|
|
10275
|
-
result.path = null;
|
|
10276
|
-
} else {
|
|
10277
|
-
result.pathname = srcPath.join('/');
|
|
10278
|
-
}
|
|
10279
|
-
|
|
10280
|
-
//to support request.http
|
|
10281
|
-
if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
|
|
10282
|
-
result.path = (result.pathname ? result.pathname : '') +
|
|
10283
|
-
(result.search ? result.search : '');
|
|
10284
|
-
}
|
|
10285
|
-
result.auth = relative.auth || result.auth;
|
|
10286
|
-
result.slashes = result.slashes || relative.slashes;
|
|
10287
|
-
result.href = result.format();
|
|
10288
|
-
return result;
|
|
10289
|
-
};
|
|
10290
|
-
|
|
10291
|
-
Url.prototype.parseHost = function() {
|
|
10292
|
-
var host = this.host;
|
|
10293
|
-
var port = portPattern.exec(host);
|
|
10294
|
-
if (port) {
|
|
10295
|
-
port = port[0];
|
|
10296
|
-
if (port !== ':') {
|
|
10297
|
-
this.port = port.substr(1);
|
|
10298
|
-
}
|
|
10299
|
-
host = host.substr(0, host.length - port.length);
|
|
10300
|
-
}
|
|
10301
|
-
if (host) this.hostname = host;
|
|
10302
|
-
};
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
/***/ }),
|
|
10306
|
-
|
|
10307
|
-
/***/ "../node_modules/url/util.js":
|
|
10308
|
-
/*!***********************************!*\
|
|
10309
|
-
!*** ../node_modules/url/util.js ***!
|
|
10310
|
-
\***********************************/
|
|
10311
|
-
/*! no static exports found */
|
|
10312
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
10313
|
-
|
|
10314
|
-
"use strict";
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
module.exports = {
|
|
10318
|
-
isString: function(arg) {
|
|
10319
|
-
return typeof(arg) === 'string';
|
|
10320
|
-
},
|
|
10321
|
-
isObject: function(arg) {
|
|
10322
|
-
return typeof(arg) === 'object' && arg !== null;
|
|
10323
|
-
},
|
|
10324
|
-
isNull: function(arg) {
|
|
10325
|
-
return arg === null;
|
|
10326
|
-
},
|
|
10327
|
-
isNullOrUndefined: function(arg) {
|
|
10328
|
-
return arg == null;
|
|
10329
|
-
}
|
|
10330
|
-
};
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
8799
|
/***/ }),
|
|
10334
8800
|
|
|
10335
8801
|
/***/ "../node_modules/webpack/buildin/global.js":
|
|
@@ -10361,39 +8827,6 @@ try {
|
|
|
10361
8827
|
module.exports = g;
|
|
10362
8828
|
|
|
10363
8829
|
|
|
10364
|
-
/***/ }),
|
|
10365
|
-
|
|
10366
|
-
/***/ "../node_modules/webpack/buildin/module.js":
|
|
10367
|
-
/*!*************************************************!*\
|
|
10368
|
-
!*** ../node_modules/webpack/buildin/module.js ***!
|
|
10369
|
-
\*************************************************/
|
|
10370
|
-
/*! no static exports found */
|
|
10371
|
-
/***/ (function(module, exports) {
|
|
10372
|
-
|
|
10373
|
-
module.exports = function(module) {
|
|
10374
|
-
if (!module.webpackPolyfill) {
|
|
10375
|
-
module.deprecate = function() {};
|
|
10376
|
-
module.paths = [];
|
|
10377
|
-
// module.parent = undefined by default
|
|
10378
|
-
if (!module.children) module.children = [];
|
|
10379
|
-
Object.defineProperty(module, "loaded", {
|
|
10380
|
-
enumerable: true,
|
|
10381
|
-
get: function() {
|
|
10382
|
-
return module.l;
|
|
10383
|
-
}
|
|
10384
|
-
});
|
|
10385
|
-
Object.defineProperty(module, "id", {
|
|
10386
|
-
enumerable: true,
|
|
10387
|
-
get: function() {
|
|
10388
|
-
return module.i;
|
|
10389
|
-
}
|
|
10390
|
-
});
|
|
10391
|
-
module.webpackPolyfill = 1;
|
|
10392
|
-
}
|
|
10393
|
-
return module;
|
|
10394
|
-
};
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
8830
|
/***/ }),
|
|
10398
8831
|
|
|
10399
8832
|
/***/ "./contentful.js":
|
|
@@ -10479,7 +8912,7 @@ function createClient(params) {
|
|
|
10479
8912
|
|
|
10480
8913
|
const config = _objectSpread(_objectSpread({}, defaultConfig), params);
|
|
10481
8914
|
|
|
10482
|
-
const userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])(`contentful.js/${"9.1.
|
|
8915
|
+
const userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])(`contentful.js/${"9.1.26"}`, config.application, config.integration);
|
|
10483
8916
|
config.headers = _objectSpread(_objectSpread({}, config.headers), {}, {
|
|
10484
8917
|
'Content-Type': 'application/vnd.contentful.delivery.v1+json',
|
|
10485
8918
|
'X-Contentful-User-Agent': userAgentHeader
|