@tryghost/content-api 1.11.8 → 1.11.10
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/cjs/content-api.js +6 -6
- package/es/content-api.js +841 -3054
- package/es/content-api.js.map +1 -1
- package/package.json +6 -6
- package/umd/content-api.min.js +1 -1
- package/umd/content-api.min.js.map +1 -1
package/es/content-api.js
CHANGED
|
@@ -1,3214 +1,996 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
12
|
-
var global_1 =
|
|
13
|
-
// eslint-disable-next-line es/no-global-this -- safe
|
|
14
|
-
check(typeof globalThis == 'object' && globalThis) ||
|
|
15
|
-
check(typeof window == 'object' && window) ||
|
|
16
|
-
// eslint-disable-next-line no-restricted-globals -- safe
|
|
17
|
-
check(typeof self == 'object' && self) ||
|
|
18
|
-
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
19
|
-
// eslint-disable-next-line no-new-func -- fallback
|
|
20
|
-
(function () { return this; })() || Function('return this')();
|
|
21
|
-
|
|
22
|
-
var fails = function (exec) {
|
|
23
|
-
try {
|
|
24
|
-
return !!exec();
|
|
25
|
-
} catch (error) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// Detect IE8's incomplete defineProperty implementation
|
|
31
|
-
var descriptors$1 = !fails(function () {
|
|
32
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
33
|
-
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
var functionBindNative = !fails(function () {
|
|
37
|
-
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
38
|
-
var test = (function () { /* empty */ }).bind();
|
|
39
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
40
|
-
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
var call$1 = Function.prototype.call;
|
|
44
|
-
|
|
45
|
-
var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
|
|
46
|
-
return call$1.apply(call$1, arguments);
|
|
1
|
+
var bind = function bind(fn, thisArg) {
|
|
2
|
+
return function wrap() {
|
|
3
|
+
var args = new Array(arguments.length);
|
|
4
|
+
for (var i = 0; i < args.length; i++) {
|
|
5
|
+
args[i] = arguments[i];
|
|
6
|
+
}
|
|
7
|
+
return fn.apply(thisArg, args);
|
|
8
|
+
};
|
|
47
9
|
};
|
|
48
10
|
|
|
49
|
-
|
|
50
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
51
|
-
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
52
|
-
|
|
53
|
-
// Nashorn ~ JDK8 bug
|
|
54
|
-
var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
55
|
-
|
|
56
|
-
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
57
|
-
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
58
|
-
var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
59
|
-
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
|
60
|
-
return !!descriptor && descriptor.enumerable;
|
|
61
|
-
} : $propertyIsEnumerable;
|
|
11
|
+
// utils is a library of generic helper functions non-specific to axios
|
|
62
12
|
|
|
63
|
-
var
|
|
64
|
-
f: f$5
|
|
65
|
-
};
|
|
13
|
+
var toString = Object.prototype.toString;
|
|
66
14
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
15
|
+
// eslint-disable-next-line func-names
|
|
16
|
+
var kindOf = (function(cache) {
|
|
17
|
+
// eslint-disable-next-line func-names
|
|
18
|
+
return function(thing) {
|
|
19
|
+
var str = toString.call(thing);
|
|
20
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
73
21
|
};
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
var FunctionPrototype$1 = Function.prototype;
|
|
77
|
-
var call = FunctionPrototype$1.call;
|
|
78
|
-
var uncurryThisWithBind = functionBindNative && FunctionPrototype$1.bind.bind(call, call);
|
|
22
|
+
})(Object.create(null));
|
|
79
23
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
24
|
+
function kindOfTest(type) {
|
|
25
|
+
type = type.toLowerCase();
|
|
26
|
+
return function isKindOf(thing) {
|
|
27
|
+
return kindOf(thing) === type;
|
|
83
28
|
};
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
var toString$2 = functionUncurryThisRaw({}.toString);
|
|
87
|
-
var stringSlice = functionUncurryThisRaw(''.slice);
|
|
88
|
-
|
|
89
|
-
var classofRaw = function (it) {
|
|
90
|
-
return stringSlice(toString$2(it), 8, -1);
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
var functionUncurryThis = function (fn) {
|
|
94
|
-
// Nashorn bug:
|
|
95
|
-
// https://github.com/zloirock/core-js/issues/1128
|
|
96
|
-
// https://github.com/zloirock/core-js/issues/1130
|
|
97
|
-
if (classofRaw(fn) === 'Function') return functionUncurryThisRaw(fn);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
var $Object$2 = Object;
|
|
101
|
-
var split = functionUncurryThis(''.split);
|
|
102
|
-
|
|
103
|
-
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
104
|
-
var indexedObject = fails(function () {
|
|
105
|
-
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
106
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
107
|
-
return !$Object$2('z').propertyIsEnumerable(0);
|
|
108
|
-
}) ? function (it) {
|
|
109
|
-
return classofRaw(it) == 'String' ? split(it, '') : $Object$2(it);
|
|
110
|
-
} : $Object$2;
|
|
111
|
-
|
|
112
|
-
// we can't use just `it == null` since of `document.all` special case
|
|
113
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
114
|
-
var isNullOrUndefined$1 = function (it) {
|
|
115
|
-
return it === null || it === undefined;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
var $TypeError$5 = TypeError;
|
|
119
|
-
|
|
120
|
-
// `RequireObjectCoercible` abstract operation
|
|
121
|
-
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
122
|
-
var requireObjectCoercible = function (it) {
|
|
123
|
-
if (isNullOrUndefined$1(it)) throw $TypeError$5("Can't call method on " + it);
|
|
124
|
-
return it;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
// toObject with fallback for non-array-like ES3 strings
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
var toIndexedObject = function (it) {
|
|
132
|
-
return indexedObject(requireObjectCoercible(it));
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
var documentAll$2 = typeof document == 'object' && document.all;
|
|
136
|
-
|
|
137
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
138
|
-
var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
|
|
139
|
-
|
|
140
|
-
var documentAll_1 = {
|
|
141
|
-
all: documentAll$2,
|
|
142
|
-
IS_HTMLDDA: IS_HTMLDDA
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
var documentAll$1 = documentAll_1.all;
|
|
146
|
-
|
|
147
|
-
// `IsCallable` abstract operation
|
|
148
|
-
// https://tc39.es/ecma262/#sec-iscallable
|
|
149
|
-
var isCallable = documentAll_1.IS_HTMLDDA ? function (argument) {
|
|
150
|
-
return typeof argument == 'function' || argument === documentAll$1;
|
|
151
|
-
} : function (argument) {
|
|
152
|
-
return typeof argument == 'function';
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
var documentAll = documentAll_1.all;
|
|
156
|
-
|
|
157
|
-
var isObject$2 = documentAll_1.IS_HTMLDDA ? function (it) {
|
|
158
|
-
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;
|
|
159
|
-
} : function (it) {
|
|
160
|
-
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
var aFunction = function (argument) {
|
|
164
|
-
return isCallable(argument) ? argument : undefined;
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
var getBuiltIn = function (namespace, method) {
|
|
168
|
-
return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
172
|
-
|
|
173
|
-
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
|
174
|
-
|
|
175
|
-
var process$1 = global_1.process;
|
|
176
|
-
var Deno = global_1.Deno;
|
|
177
|
-
var versions = process$1 && process$1.versions || Deno && Deno.version;
|
|
178
|
-
var v8 = versions && versions.v8;
|
|
179
|
-
var match, version$1;
|
|
180
|
-
|
|
181
|
-
if (v8) {
|
|
182
|
-
match = v8.split('.');
|
|
183
|
-
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
184
|
-
// but their correct versions are not interesting for us
|
|
185
|
-
version$1 = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
186
29
|
}
|
|
187
30
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Determine if a value is an Array
|
|
33
|
+
*
|
|
34
|
+
* @param {Object} val The value to test
|
|
35
|
+
* @returns {boolean} True if value is an Array, otherwise false
|
|
36
|
+
*/
|
|
37
|
+
function isArray(val) {
|
|
38
|
+
return Array.isArray(val);
|
|
196
39
|
}
|
|
197
40
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
// Chrome 38 Symbol has incorrect toString conversion
|
|
208
|
-
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
209
|
-
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
210
|
-
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
211
|
-
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
var useSymbolAsUid = symbolConstructorDetection
|
|
218
|
-
&& !Symbol.sham
|
|
219
|
-
&& typeof Symbol.iterator == 'symbol';
|
|
41
|
+
/**
|
|
42
|
+
* Determine if a value is undefined
|
|
43
|
+
*
|
|
44
|
+
* @param {Object} val The value to test
|
|
45
|
+
* @returns {boolean} True if the value is undefined, otherwise false
|
|
46
|
+
*/
|
|
47
|
+
function isUndefined(val) {
|
|
48
|
+
return typeof val === 'undefined';
|
|
49
|
+
}
|
|
220
50
|
|
|
221
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Determine if a value is a Buffer
|
|
53
|
+
*
|
|
54
|
+
* @param {Object} val The value to test
|
|
55
|
+
* @returns {boolean} True if value is a Buffer, otherwise false
|
|
56
|
+
*/
|
|
57
|
+
function isBuffer(val) {
|
|
58
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
|
59
|
+
&& typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
|
|
60
|
+
}
|
|
222
61
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
62
|
+
/**
|
|
63
|
+
* Determine if a value is an ArrayBuffer
|
|
64
|
+
*
|
|
65
|
+
* @function
|
|
66
|
+
* @param {Object} val The value to test
|
|
67
|
+
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
68
|
+
*/
|
|
69
|
+
var isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
229
70
|
|
|
230
|
-
var $String$1 = String;
|
|
231
71
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Determine if a value is a view on an ArrayBuffer
|
|
74
|
+
*
|
|
75
|
+
* @param {Object} val The value to test
|
|
76
|
+
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
|
|
77
|
+
*/
|
|
78
|
+
function isArrayBufferView(val) {
|
|
79
|
+
var result;
|
|
80
|
+
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
|
81
|
+
result = ArrayBuffer.isView(val);
|
|
82
|
+
} else {
|
|
83
|
+
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
|
|
237
84
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
var $TypeError$4 = TypeError;
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
241
87
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
88
|
+
/**
|
|
89
|
+
* Determine if a value is a String
|
|
90
|
+
*
|
|
91
|
+
* @param {Object} val The value to test
|
|
92
|
+
* @returns {boolean} True if value is a String, otherwise false
|
|
93
|
+
*/
|
|
94
|
+
function isString(val) {
|
|
95
|
+
return typeof val === 'string';
|
|
96
|
+
}
|
|
247
97
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Determine if a value is a Number
|
|
100
|
+
*
|
|
101
|
+
* @param {Object} val The value to test
|
|
102
|
+
* @returns {boolean} True if value is a Number, otherwise false
|
|
103
|
+
*/
|
|
104
|
+
function isNumber(val) {
|
|
105
|
+
return typeof val === 'number';
|
|
106
|
+
}
|
|
254
107
|
|
|
255
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Determine if a value is an Object
|
|
110
|
+
*
|
|
111
|
+
* @param {Object} val The value to test
|
|
112
|
+
* @returns {boolean} True if value is an Object, otherwise false
|
|
113
|
+
*/
|
|
114
|
+
function isObject(val) {
|
|
115
|
+
return val !== null && typeof val === 'object';
|
|
116
|
+
}
|
|
256
117
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Determine if a value is a plain Object
|
|
120
|
+
*
|
|
121
|
+
* @param {Object} val The value to test
|
|
122
|
+
* @return {boolean} True if value is a plain Object, otherwise false
|
|
123
|
+
*/
|
|
124
|
+
function isPlainObject(val) {
|
|
125
|
+
if (kindOf(val) !== 'object') {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
266
128
|
|
|
267
|
-
|
|
268
|
-
|
|
129
|
+
var prototype = Object.getPrototypeOf(val);
|
|
130
|
+
return prototype === null || prototype === Object.prototype;
|
|
131
|
+
}
|
|
269
132
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Determine if a value is a Date
|
|
135
|
+
*
|
|
136
|
+
* @function
|
|
137
|
+
* @param {Object} val The value to test
|
|
138
|
+
* @returns {boolean} True if value is a Date, otherwise false
|
|
139
|
+
*/
|
|
140
|
+
var isDate = kindOfTest('Date');
|
|
277
141
|
|
|
278
|
-
|
|
279
|
-
|
|
142
|
+
/**
|
|
143
|
+
* Determine if a value is a File
|
|
144
|
+
*
|
|
145
|
+
* @function
|
|
146
|
+
* @param {Object} val The value to test
|
|
147
|
+
* @returns {boolean} True if value is a File, otherwise false
|
|
148
|
+
*/
|
|
149
|
+
var isFile = kindOfTest('File');
|
|
280
150
|
|
|
281
|
-
|
|
151
|
+
/**
|
|
152
|
+
* Determine if a value is a Blob
|
|
153
|
+
*
|
|
154
|
+
* @function
|
|
155
|
+
* @param {Object} val The value to test
|
|
156
|
+
* @returns {boolean} True if value is a Blob, otherwise false
|
|
157
|
+
*/
|
|
158
|
+
var isBlob = kindOfTest('Blob');
|
|
282
159
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
source: 'https://github.com/zloirock/core-js'
|
|
292
|
-
});
|
|
293
|
-
});
|
|
160
|
+
/**
|
|
161
|
+
* Determine if a value is a FileList
|
|
162
|
+
*
|
|
163
|
+
* @function
|
|
164
|
+
* @param {Object} val The value to test
|
|
165
|
+
* @returns {boolean} True if value is a File, otherwise false
|
|
166
|
+
*/
|
|
167
|
+
var isFileList = kindOfTest('FileList');
|
|
294
168
|
|
|
295
|
-
|
|
169
|
+
/**
|
|
170
|
+
* Determine if a value is a Function
|
|
171
|
+
*
|
|
172
|
+
* @param {Object} val The value to test
|
|
173
|
+
* @returns {boolean} True if value is a Function, otherwise false
|
|
174
|
+
*/
|
|
175
|
+
function isFunction(val) {
|
|
176
|
+
return toString.call(val) === '[object Function]';
|
|
177
|
+
}
|
|
296
178
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}
|
|
179
|
+
/**
|
|
180
|
+
* Determine if a value is a Stream
|
|
181
|
+
*
|
|
182
|
+
* @param {Object} val The value to test
|
|
183
|
+
* @returns {boolean} True if value is a Stream, otherwise false
|
|
184
|
+
*/
|
|
185
|
+
function isStream(val) {
|
|
186
|
+
return isObject(val) && isFunction(val.pipe);
|
|
187
|
+
}
|
|
302
188
|
|
|
303
|
-
|
|
189
|
+
/**
|
|
190
|
+
* Determine if a value is a FormData
|
|
191
|
+
*
|
|
192
|
+
* @param {Object} thing The value to test
|
|
193
|
+
* @returns {boolean} True if value is an FormData, otherwise false
|
|
194
|
+
*/
|
|
195
|
+
function isFormData(thing) {
|
|
196
|
+
var pattern = '[object FormData]';
|
|
197
|
+
return thing && (
|
|
198
|
+
(typeof FormData === 'function' && thing instanceof FormData) ||
|
|
199
|
+
toString.call(thing) === pattern ||
|
|
200
|
+
(isFunction(thing.toString) && thing.toString() === pattern)
|
|
201
|
+
);
|
|
202
|
+
}
|
|
304
203
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
var id = 0;
|
|
313
|
-
var postfix = Math.random();
|
|
314
|
-
var toString$1 = functionUncurryThis(1.0.toString);
|
|
315
|
-
|
|
316
|
-
var uid = function (key) {
|
|
317
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$1(++id + postfix, 36);
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
var WellKnownSymbolsStore = shared('wks');
|
|
321
|
-
var Symbol$1 = global_1.Symbol;
|
|
322
|
-
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
323
|
-
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
324
|
-
|
|
325
|
-
var wellKnownSymbol = function (name) {
|
|
326
|
-
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(symbolConstructorDetection || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
327
|
-
var description = 'Symbol.' + name;
|
|
328
|
-
if (symbolConstructorDetection && hasOwnProperty_1(Symbol$1, name)) {
|
|
329
|
-
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
330
|
-
} else if (useSymbolAsUid && symbolFor) {
|
|
331
|
-
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
332
|
-
} else {
|
|
333
|
-
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
334
|
-
}
|
|
335
|
-
} return WellKnownSymbolsStore[name];
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
var $TypeError$2 = TypeError;
|
|
339
|
-
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
|
340
|
-
|
|
341
|
-
// `ToPrimitive` abstract operation
|
|
342
|
-
// https://tc39.es/ecma262/#sec-toprimitive
|
|
343
|
-
var toPrimitive = function (input, pref) {
|
|
344
|
-
if (!isObject$2(input) || isSymbol(input)) return input;
|
|
345
|
-
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
346
|
-
var result;
|
|
347
|
-
if (exoticToPrim) {
|
|
348
|
-
if (pref === undefined) pref = 'default';
|
|
349
|
-
result = functionCall(exoticToPrim, input, pref);
|
|
350
|
-
if (!isObject$2(result) || isSymbol(result)) return result;
|
|
351
|
-
throw $TypeError$2("Can't convert object to primitive value");
|
|
352
|
-
}
|
|
353
|
-
if (pref === undefined) pref = 'number';
|
|
354
|
-
return ordinaryToPrimitive(input, pref);
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
// `ToPropertyKey` abstract operation
|
|
358
|
-
// https://tc39.es/ecma262/#sec-topropertykey
|
|
359
|
-
var toPropertyKey = function (argument) {
|
|
360
|
-
var key = toPrimitive(argument, 'string');
|
|
361
|
-
return isSymbol(key) ? key : key + '';
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
var document$1 = global_1.document;
|
|
365
|
-
// typeof document.createElement is 'object' in old IE
|
|
366
|
-
var EXISTS$1 = isObject$2(document$1) && isObject$2(document$1.createElement);
|
|
367
|
-
|
|
368
|
-
var documentCreateElement = function (it) {
|
|
369
|
-
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
370
|
-
};
|
|
371
|
-
|
|
372
|
-
// Thanks to IE8 for its funny defineProperty
|
|
373
|
-
var ie8DomDefine = !descriptors$1 && !fails(function () {
|
|
374
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
375
|
-
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
376
|
-
get: function () { return 7; }
|
|
377
|
-
}).a != 7;
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
381
|
-
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
382
|
-
|
|
383
|
-
// `Object.getOwnPropertyDescriptor` method
|
|
384
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
385
|
-
var f$4 = descriptors$1 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
|
386
|
-
O = toIndexedObject(O);
|
|
387
|
-
P = toPropertyKey(P);
|
|
388
|
-
if (ie8DomDefine) try {
|
|
389
|
-
return $getOwnPropertyDescriptor$1(O, P);
|
|
390
|
-
} catch (error) { /* empty */ }
|
|
391
|
-
if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
var objectGetOwnPropertyDescriptor = {
|
|
395
|
-
f: f$4
|
|
396
|
-
};
|
|
397
|
-
|
|
398
|
-
// V8 ~ Chrome 36-
|
|
399
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
400
|
-
var v8PrototypeDefineBug = descriptors$1 && fails(function () {
|
|
401
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
402
|
-
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
403
|
-
value: 42,
|
|
404
|
-
writable: false
|
|
405
|
-
}).prototype != 42;
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
var $String = String;
|
|
409
|
-
var $TypeError$1 = TypeError;
|
|
410
|
-
|
|
411
|
-
// `Assert: Type(argument) is Object`
|
|
412
|
-
var anObject = function (argument) {
|
|
413
|
-
if (isObject$2(argument)) return argument;
|
|
414
|
-
throw $TypeError$1($String(argument) + ' is not an object');
|
|
415
|
-
};
|
|
416
|
-
|
|
417
|
-
var $TypeError = TypeError;
|
|
418
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
419
|
-
var $defineProperty = Object.defineProperty;
|
|
420
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
421
|
-
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
422
|
-
var ENUMERABLE = 'enumerable';
|
|
423
|
-
var CONFIGURABLE$1 = 'configurable';
|
|
424
|
-
var WRITABLE = 'writable';
|
|
425
|
-
|
|
426
|
-
// `Object.defineProperty` method
|
|
427
|
-
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
428
|
-
var f$3 = descriptors$1 ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
|
|
429
|
-
anObject(O);
|
|
430
|
-
P = toPropertyKey(P);
|
|
431
|
-
anObject(Attributes);
|
|
432
|
-
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
433
|
-
var current = $getOwnPropertyDescriptor(O, P);
|
|
434
|
-
if (current && current[WRITABLE]) {
|
|
435
|
-
O[P] = Attributes.value;
|
|
436
|
-
Attributes = {
|
|
437
|
-
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
438
|
-
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
439
|
-
writable: false
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
} return $defineProperty(O, P, Attributes);
|
|
443
|
-
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
444
|
-
anObject(O);
|
|
445
|
-
P = toPropertyKey(P);
|
|
446
|
-
anObject(Attributes);
|
|
447
|
-
if (ie8DomDefine) try {
|
|
448
|
-
return $defineProperty(O, P, Attributes);
|
|
449
|
-
} catch (error) { /* empty */ }
|
|
450
|
-
if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
|
|
451
|
-
if ('value' in Attributes) O[P] = Attributes.value;
|
|
452
|
-
return O;
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
var objectDefineProperty = {
|
|
456
|
-
f: f$3
|
|
457
|
-
};
|
|
458
|
-
|
|
459
|
-
var createNonEnumerableProperty = descriptors$1 ? function (object, key, value) {
|
|
460
|
-
return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
|
461
|
-
} : function (object, key, value) {
|
|
462
|
-
object[key] = value;
|
|
463
|
-
return object;
|
|
464
|
-
};
|
|
465
|
-
|
|
466
|
-
var FunctionPrototype = Function.prototype;
|
|
467
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
468
|
-
var getDescriptor = descriptors$1 && Object.getOwnPropertyDescriptor;
|
|
469
|
-
|
|
470
|
-
var EXISTS = hasOwnProperty_1(FunctionPrototype, 'name');
|
|
471
|
-
// additional protection from minified / mangled / dropped function names
|
|
472
|
-
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
473
|
-
var CONFIGURABLE = EXISTS && (!descriptors$1 || (descriptors$1 && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
474
|
-
|
|
475
|
-
var functionName = {
|
|
476
|
-
EXISTS: EXISTS,
|
|
477
|
-
PROPER: PROPER,
|
|
478
|
-
CONFIGURABLE: CONFIGURABLE
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
var functionToString = functionUncurryThis(Function.toString);
|
|
482
|
-
|
|
483
|
-
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
484
|
-
if (!isCallable(sharedStore.inspectSource)) {
|
|
485
|
-
sharedStore.inspectSource = function (it) {
|
|
486
|
-
return functionToString(it);
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
var inspectSource = sharedStore.inspectSource;
|
|
491
|
-
|
|
492
|
-
var WeakMap$1 = global_1.WeakMap;
|
|
493
|
-
|
|
494
|
-
var weakMapBasicDetection = isCallable(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
495
|
-
|
|
496
|
-
var keys = shared('keys');
|
|
497
|
-
|
|
498
|
-
var sharedKey = function (key) {
|
|
499
|
-
return keys[key] || (keys[key] = uid(key));
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
var hiddenKeys$1 = {};
|
|
503
|
-
|
|
504
|
-
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
505
|
-
var TypeError$1 = global_1.TypeError;
|
|
506
|
-
var WeakMap = global_1.WeakMap;
|
|
507
|
-
var set, get, has;
|
|
508
|
-
|
|
509
|
-
var enforce = function (it) {
|
|
510
|
-
return has(it) ? get(it) : set(it, {});
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
var getterFor = function (TYPE) {
|
|
514
|
-
return function (it) {
|
|
515
|
-
var state;
|
|
516
|
-
if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
|
|
517
|
-
throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
518
|
-
} return state;
|
|
519
|
-
};
|
|
520
|
-
};
|
|
521
|
-
|
|
522
|
-
if (weakMapBasicDetection || sharedStore.state) {
|
|
523
|
-
var store = sharedStore.state || (sharedStore.state = new WeakMap());
|
|
524
|
-
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
525
|
-
store.get = store.get;
|
|
526
|
-
store.has = store.has;
|
|
527
|
-
store.set = store.set;
|
|
528
|
-
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
529
|
-
set = function (it, metadata) {
|
|
530
|
-
if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
531
|
-
metadata.facade = it;
|
|
532
|
-
store.set(it, metadata);
|
|
533
|
-
return metadata;
|
|
534
|
-
};
|
|
535
|
-
get = function (it) {
|
|
536
|
-
return store.get(it) || {};
|
|
537
|
-
};
|
|
538
|
-
has = function (it) {
|
|
539
|
-
return store.has(it);
|
|
540
|
-
};
|
|
541
|
-
} else {
|
|
542
|
-
var STATE = sharedKey('state');
|
|
543
|
-
hiddenKeys$1[STATE] = true;
|
|
544
|
-
set = function (it, metadata) {
|
|
545
|
-
if (hasOwnProperty_1(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
546
|
-
metadata.facade = it;
|
|
547
|
-
createNonEnumerableProperty(it, STATE, metadata);
|
|
548
|
-
return metadata;
|
|
549
|
-
};
|
|
550
|
-
get = function (it) {
|
|
551
|
-
return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
|
|
552
|
-
};
|
|
553
|
-
has = function (it) {
|
|
554
|
-
return hasOwnProperty_1(it, STATE);
|
|
555
|
-
};
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
var internalState = {
|
|
559
|
-
set: set,
|
|
560
|
-
get: get,
|
|
561
|
-
has: has,
|
|
562
|
-
enforce: enforce,
|
|
563
|
-
getterFor: getterFor
|
|
564
|
-
};
|
|
565
|
-
|
|
566
|
-
var makeBuiltIn_1 = createCommonjsModule(function (module) {
|
|
567
|
-
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
var enforceInternalState = internalState.enforce;
|
|
572
|
-
var getInternalState = internalState.get;
|
|
573
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
574
|
-
var defineProperty = Object.defineProperty;
|
|
575
|
-
|
|
576
|
-
var CONFIGURABLE_LENGTH = descriptors$1 && !fails(function () {
|
|
577
|
-
return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
578
|
-
});
|
|
579
|
-
|
|
580
|
-
var TEMPLATE = String(String).split('String');
|
|
581
|
-
|
|
582
|
-
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
583
|
-
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
584
|
-
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
585
|
-
}
|
|
586
|
-
if (options && options.getter) name = 'get ' + name;
|
|
587
|
-
if (options && options.setter) name = 'set ' + name;
|
|
588
|
-
if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
589
|
-
if (descriptors$1) defineProperty(value, 'name', { value: name, configurable: true });
|
|
590
|
-
else value.name = name;
|
|
591
|
-
}
|
|
592
|
-
if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
|
|
593
|
-
defineProperty(value, 'length', { value: options.arity });
|
|
594
|
-
}
|
|
595
|
-
try {
|
|
596
|
-
if (options && hasOwnProperty_1(options, 'constructor') && options.constructor) {
|
|
597
|
-
if (descriptors$1) defineProperty(value, 'prototype', { writable: false });
|
|
598
|
-
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
599
|
-
} else if (value.prototype) value.prototype = undefined;
|
|
600
|
-
} catch (error) { /* empty */ }
|
|
601
|
-
var state = enforceInternalState(value);
|
|
602
|
-
if (!hasOwnProperty_1(state, 'source')) {
|
|
603
|
-
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
604
|
-
} return value;
|
|
605
|
-
};
|
|
606
|
-
|
|
607
|
-
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
608
|
-
// eslint-disable-next-line no-extend-native -- required
|
|
609
|
-
Function.prototype.toString = makeBuiltIn(function toString() {
|
|
610
|
-
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
|
611
|
-
}, 'toString');
|
|
612
|
-
});
|
|
613
|
-
|
|
614
|
-
var defineBuiltIn = function (O, key, value, options) {
|
|
615
|
-
if (!options) options = {};
|
|
616
|
-
var simple = options.enumerable;
|
|
617
|
-
var name = options.name !== undefined ? options.name : key;
|
|
618
|
-
if (isCallable(value)) makeBuiltIn_1(value, name, options);
|
|
619
|
-
if (options.global) {
|
|
620
|
-
if (simple) O[key] = value;
|
|
621
|
-
else defineGlobalProperty(key, value);
|
|
622
|
-
} else {
|
|
623
|
-
try {
|
|
624
|
-
if (!options.unsafe) delete O[key];
|
|
625
|
-
else if (O[key]) simple = true;
|
|
626
|
-
} catch (error) { /* empty */ }
|
|
627
|
-
if (simple) O[key] = value;
|
|
628
|
-
else objectDefineProperty.f(O, key, {
|
|
629
|
-
value: value,
|
|
630
|
-
enumerable: false,
|
|
631
|
-
configurable: !options.nonConfigurable,
|
|
632
|
-
writable: !options.nonWritable
|
|
633
|
-
});
|
|
634
|
-
} return O;
|
|
635
|
-
};
|
|
636
|
-
|
|
637
|
-
var ceil = Math.ceil;
|
|
638
|
-
var floor$1 = Math.floor;
|
|
639
|
-
|
|
640
|
-
// `Math.trunc` method
|
|
641
|
-
// https://tc39.es/ecma262/#sec-math.trunc
|
|
642
|
-
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
643
|
-
var mathTrunc = Math.trunc || function trunc(x) {
|
|
644
|
-
var n = +x;
|
|
645
|
-
return (n > 0 ? floor$1 : ceil)(n);
|
|
646
|
-
};
|
|
647
|
-
|
|
648
|
-
// `ToIntegerOrInfinity` abstract operation
|
|
649
|
-
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
650
|
-
var toIntegerOrInfinity = function (argument) {
|
|
651
|
-
var number = +argument;
|
|
652
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
653
|
-
return number !== number || number === 0 ? 0 : mathTrunc(number);
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
var max = Math.max;
|
|
657
|
-
var min$1 = Math.min;
|
|
658
|
-
|
|
659
|
-
// Helper for a popular repeating case of the spec:
|
|
660
|
-
// Let integer be ? ToInteger(index).
|
|
661
|
-
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
662
|
-
var toAbsoluteIndex = function (index, length) {
|
|
663
|
-
var integer = toIntegerOrInfinity(index);
|
|
664
|
-
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
665
|
-
};
|
|
666
|
-
|
|
667
|
-
var min = Math.min;
|
|
668
|
-
|
|
669
|
-
// `ToLength` abstract operation
|
|
670
|
-
// https://tc39.es/ecma262/#sec-tolength
|
|
671
|
-
var toLength = function (argument) {
|
|
672
|
-
return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
673
|
-
};
|
|
674
|
-
|
|
675
|
-
// `LengthOfArrayLike` abstract operation
|
|
676
|
-
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
677
|
-
var lengthOfArrayLike = function (obj) {
|
|
678
|
-
return toLength(obj.length);
|
|
679
|
-
};
|
|
680
|
-
|
|
681
|
-
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
682
|
-
var createMethod = function (IS_INCLUDES) {
|
|
683
|
-
return function ($this, el, fromIndex) {
|
|
684
|
-
var O = toIndexedObject($this);
|
|
685
|
-
var length = lengthOfArrayLike(O);
|
|
686
|
-
var index = toAbsoluteIndex(fromIndex, length);
|
|
687
|
-
var value;
|
|
688
|
-
// Array#includes uses SameValueZero equality algorithm
|
|
689
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
690
|
-
if (IS_INCLUDES && el != el) while (length > index) {
|
|
691
|
-
value = O[index++];
|
|
692
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
693
|
-
if (value != value) return true;
|
|
694
|
-
// Array#indexOf ignores holes, Array#includes - not
|
|
695
|
-
} else for (;length > index; index++) {
|
|
696
|
-
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
697
|
-
} return !IS_INCLUDES && -1;
|
|
698
|
-
};
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
var arrayIncludes = {
|
|
702
|
-
// `Array.prototype.includes` method
|
|
703
|
-
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
704
|
-
includes: createMethod(true),
|
|
705
|
-
// `Array.prototype.indexOf` method
|
|
706
|
-
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
707
|
-
indexOf: createMethod(false)
|
|
708
|
-
};
|
|
709
|
-
|
|
710
|
-
var indexOf = arrayIncludes.indexOf;
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
var push = functionUncurryThis([].push);
|
|
714
|
-
|
|
715
|
-
var objectKeysInternal = function (object, names) {
|
|
716
|
-
var O = toIndexedObject(object);
|
|
717
|
-
var i = 0;
|
|
718
|
-
var result = [];
|
|
719
|
-
var key;
|
|
720
|
-
for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push(result, key);
|
|
721
|
-
// Don't enum bug & hidden keys
|
|
722
|
-
while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
|
|
723
|
-
~indexOf(result, key) || push(result, key);
|
|
724
|
-
}
|
|
725
|
-
return result;
|
|
726
|
-
};
|
|
727
|
-
|
|
728
|
-
// IE8- don't enum bug keys
|
|
729
|
-
var enumBugKeys = [
|
|
730
|
-
'constructor',
|
|
731
|
-
'hasOwnProperty',
|
|
732
|
-
'isPrototypeOf',
|
|
733
|
-
'propertyIsEnumerable',
|
|
734
|
-
'toLocaleString',
|
|
735
|
-
'toString',
|
|
736
|
-
'valueOf'
|
|
737
|
-
];
|
|
738
|
-
|
|
739
|
-
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
|
740
|
-
|
|
741
|
-
// `Object.getOwnPropertyNames` method
|
|
742
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
743
|
-
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
744
|
-
var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
745
|
-
return objectKeysInternal(O, hiddenKeys);
|
|
746
|
-
};
|
|
747
|
-
|
|
748
|
-
var objectGetOwnPropertyNames = {
|
|
749
|
-
f: f$2
|
|
750
|
-
};
|
|
751
|
-
|
|
752
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
753
|
-
var f$1 = Object.getOwnPropertySymbols;
|
|
754
|
-
|
|
755
|
-
var objectGetOwnPropertySymbols = {
|
|
756
|
-
f: f$1
|
|
757
|
-
};
|
|
758
|
-
|
|
759
|
-
var concat = functionUncurryThis([].concat);
|
|
760
|
-
|
|
761
|
-
// all object keys, includes non-enumerable and symbols
|
|
762
|
-
var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
763
|
-
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
|
764
|
-
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
|
765
|
-
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
|
766
|
-
};
|
|
767
|
-
|
|
768
|
-
var copyConstructorProperties = function (target, source, exceptions) {
|
|
769
|
-
var keys = ownKeys(source);
|
|
770
|
-
var defineProperty = objectDefineProperty.f;
|
|
771
|
-
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
772
|
-
for (var i = 0; i < keys.length; i++) {
|
|
773
|
-
var key = keys[i];
|
|
774
|
-
if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
|
|
775
|
-
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
};
|
|
779
|
-
|
|
780
|
-
var replacement = /#|\.prototype\./;
|
|
781
|
-
|
|
782
|
-
var isForced = function (feature, detection) {
|
|
783
|
-
var value = data$1[normalize(feature)];
|
|
784
|
-
return value == POLYFILL ? true
|
|
785
|
-
: value == NATIVE ? false
|
|
786
|
-
: isCallable(detection) ? fails(detection)
|
|
787
|
-
: !!detection;
|
|
788
|
-
};
|
|
789
|
-
|
|
790
|
-
var normalize = isForced.normalize = function (string) {
|
|
791
|
-
return String(string).replace(replacement, '.').toLowerCase();
|
|
792
|
-
};
|
|
793
|
-
|
|
794
|
-
var data$1 = isForced.data = {};
|
|
795
|
-
var NATIVE = isForced.NATIVE = 'N';
|
|
796
|
-
var POLYFILL = isForced.POLYFILL = 'P';
|
|
797
|
-
|
|
798
|
-
var isForced_1 = isForced;
|
|
799
|
-
|
|
800
|
-
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
/*
|
|
808
|
-
options.target - name of the target object
|
|
809
|
-
options.global - target is the global object
|
|
810
|
-
options.stat - export as static methods of target
|
|
811
|
-
options.proto - export as prototype methods of target
|
|
812
|
-
options.real - real prototype method for the `pure` version
|
|
813
|
-
options.forced - export even if the native feature is available
|
|
814
|
-
options.bind - bind methods to the target, required for the `pure` version
|
|
815
|
-
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
816
|
-
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
817
|
-
options.sham - add a flag to not completely full polyfills
|
|
818
|
-
options.enumerable - export as enumerable property
|
|
819
|
-
options.dontCallGetSet - prevent calling a getter on target
|
|
820
|
-
options.name - the .name of the function if it does not match the key
|
|
821
|
-
*/
|
|
822
|
-
var _export = function (options, source) {
|
|
823
|
-
var TARGET = options.target;
|
|
824
|
-
var GLOBAL = options.global;
|
|
825
|
-
var STATIC = options.stat;
|
|
826
|
-
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
827
|
-
if (GLOBAL) {
|
|
828
|
-
target = global_1;
|
|
829
|
-
} else if (STATIC) {
|
|
830
|
-
target = global_1[TARGET] || defineGlobalProperty(TARGET, {});
|
|
831
|
-
} else {
|
|
832
|
-
target = (global_1[TARGET] || {}).prototype;
|
|
833
|
-
}
|
|
834
|
-
if (target) for (key in source) {
|
|
835
|
-
sourceProperty = source[key];
|
|
836
|
-
if (options.dontCallGetSet) {
|
|
837
|
-
descriptor = getOwnPropertyDescriptor(target, key);
|
|
838
|
-
targetProperty = descriptor && descriptor.value;
|
|
839
|
-
} else targetProperty = target[key];
|
|
840
|
-
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
841
|
-
// contained in target
|
|
842
|
-
if (!FORCED && targetProperty !== undefined) {
|
|
843
|
-
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
844
|
-
copyConstructorProperties(sourceProperty, targetProperty);
|
|
845
|
-
}
|
|
846
|
-
// add a flag to not completely full polyfills
|
|
847
|
-
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
848
|
-
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
849
|
-
}
|
|
850
|
-
defineBuiltIn(target, key, sourceProperty, options);
|
|
851
|
-
}
|
|
852
|
-
};
|
|
853
|
-
|
|
854
|
-
// `Object.keys` method
|
|
855
|
-
// https://tc39.es/ecma262/#sec-object.keys
|
|
856
|
-
// eslint-disable-next-line es/no-object-keys -- safe
|
|
857
|
-
var objectKeys$1 = Object.keys || function keys(O) {
|
|
858
|
-
return objectKeysInternal(O, enumBugKeys);
|
|
859
|
-
};
|
|
860
|
-
|
|
861
|
-
// `Object.defineProperties` method
|
|
862
|
-
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
863
|
-
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
864
|
-
var f = descriptors$1 && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
865
|
-
anObject(O);
|
|
866
|
-
var props = toIndexedObject(Properties);
|
|
867
|
-
var keys = objectKeys$1(Properties);
|
|
868
|
-
var length = keys.length;
|
|
869
|
-
var index = 0;
|
|
870
|
-
var key;
|
|
871
|
-
while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
|
|
872
|
-
return O;
|
|
873
|
-
};
|
|
874
|
-
|
|
875
|
-
var objectDefineProperties = {
|
|
876
|
-
f: f
|
|
877
|
-
};
|
|
878
|
-
|
|
879
|
-
var html = getBuiltIn('document', 'documentElement');
|
|
880
|
-
|
|
881
|
-
/* global ActiveXObject -- old IE, WSH */
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
var GT = '>';
|
|
891
|
-
var LT = '<';
|
|
892
|
-
var PROTOTYPE = 'prototype';
|
|
893
|
-
var SCRIPT = 'script';
|
|
894
|
-
var IE_PROTO = sharedKey('IE_PROTO');
|
|
895
|
-
|
|
896
|
-
var EmptyConstructor = function () { /* empty */ };
|
|
897
|
-
|
|
898
|
-
var scriptTag = function (content) {
|
|
899
|
-
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
900
|
-
};
|
|
901
|
-
|
|
902
|
-
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
903
|
-
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
904
|
-
activeXDocument.write(scriptTag(''));
|
|
905
|
-
activeXDocument.close();
|
|
906
|
-
var temp = activeXDocument.parentWindow.Object;
|
|
907
|
-
activeXDocument = null; // avoid memory leak
|
|
908
|
-
return temp;
|
|
909
|
-
};
|
|
910
|
-
|
|
911
|
-
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
912
|
-
var NullProtoObjectViaIFrame = function () {
|
|
913
|
-
// Thrash, waste and sodomy: IE GC bug
|
|
914
|
-
var iframe = documentCreateElement('iframe');
|
|
915
|
-
var JS = 'java' + SCRIPT + ':';
|
|
916
|
-
var iframeDocument;
|
|
917
|
-
iframe.style.display = 'none';
|
|
918
|
-
html.appendChild(iframe);
|
|
919
|
-
// https://github.com/zloirock/core-js/issues/475
|
|
920
|
-
iframe.src = String(JS);
|
|
921
|
-
iframeDocument = iframe.contentWindow.document;
|
|
922
|
-
iframeDocument.open();
|
|
923
|
-
iframeDocument.write(scriptTag('document.F=Object'));
|
|
924
|
-
iframeDocument.close();
|
|
925
|
-
return iframeDocument.F;
|
|
926
|
-
};
|
|
927
|
-
|
|
928
|
-
// Check for document.domain and active x support
|
|
929
|
-
// No need to use active x approach when document.domain is not set
|
|
930
|
-
// see https://github.com/es-shims/es5-shim/issues/150
|
|
931
|
-
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
932
|
-
// avoid IE GC bug
|
|
933
|
-
var activeXDocument;
|
|
934
|
-
var NullProtoObject = function () {
|
|
935
|
-
try {
|
|
936
|
-
activeXDocument = new ActiveXObject('htmlfile');
|
|
937
|
-
} catch (error) { /* ignore */ }
|
|
938
|
-
NullProtoObject = typeof document != 'undefined'
|
|
939
|
-
? document.domain && activeXDocument
|
|
940
|
-
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
941
|
-
: NullProtoObjectViaIFrame()
|
|
942
|
-
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
943
|
-
var length = enumBugKeys.length;
|
|
944
|
-
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
945
|
-
return NullProtoObject();
|
|
946
|
-
};
|
|
947
|
-
|
|
948
|
-
hiddenKeys$1[IE_PROTO] = true;
|
|
949
|
-
|
|
950
|
-
// `Object.create` method
|
|
951
|
-
// https://tc39.es/ecma262/#sec-object.create
|
|
952
|
-
// eslint-disable-next-line es/no-object-create -- safe
|
|
953
|
-
var objectCreate = Object.create || function create(O, Properties) {
|
|
954
|
-
var result;
|
|
955
|
-
if (O !== null) {
|
|
956
|
-
EmptyConstructor[PROTOTYPE] = anObject(O);
|
|
957
|
-
result = new EmptyConstructor();
|
|
958
|
-
EmptyConstructor[PROTOTYPE] = null;
|
|
959
|
-
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
960
|
-
result[IE_PROTO] = O;
|
|
961
|
-
} else result = NullProtoObject();
|
|
962
|
-
return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
|
|
963
|
-
};
|
|
964
|
-
|
|
965
|
-
var defineProperty = objectDefineProperty.f;
|
|
966
|
-
|
|
967
|
-
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
968
|
-
var ArrayPrototype = Array.prototype;
|
|
969
|
-
|
|
970
|
-
// Array.prototype[@@unscopables]
|
|
971
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
972
|
-
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
|
973
|
-
defineProperty(ArrayPrototype, UNSCOPABLES, {
|
|
974
|
-
configurable: true,
|
|
975
|
-
value: objectCreate(null)
|
|
976
|
-
});
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
// add a key to Array.prototype[@@unscopables]
|
|
980
|
-
var addToUnscopables = function (key) {
|
|
981
|
-
ArrayPrototype[UNSCOPABLES][key] = true;
|
|
982
|
-
};
|
|
983
|
-
|
|
984
|
-
var $includes = arrayIncludes.includes;
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
// FF99+ bug
|
|
989
|
-
var BROKEN_ON_SPARSE = fails(function () {
|
|
990
|
-
return !Array(1).includes();
|
|
991
|
-
});
|
|
992
|
-
|
|
993
|
-
// `Array.prototype.includes` method
|
|
994
|
-
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
995
|
-
_export({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
|
996
|
-
includes: function includes(el /* , fromIndex = 0 */) {
|
|
997
|
-
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
998
|
-
}
|
|
999
|
-
});
|
|
1000
|
-
|
|
1001
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1002
|
-
addToUnscopables('includes');
|
|
1003
|
-
|
|
1004
|
-
var bind = function bind(fn, thisArg) {
|
|
1005
|
-
return function wrap() {
|
|
1006
|
-
var args = new Array(arguments.length);
|
|
1007
|
-
for (var i = 0; i < args.length; i++) {
|
|
1008
|
-
args[i] = arguments[i];
|
|
1009
|
-
}
|
|
1010
|
-
return fn.apply(thisArg, args);
|
|
1011
|
-
};
|
|
1012
|
-
};
|
|
1013
|
-
|
|
1014
|
-
// utils is a library of generic helper functions non-specific to axios
|
|
1015
|
-
|
|
1016
|
-
var toString = Object.prototype.toString;
|
|
1017
|
-
|
|
1018
|
-
// eslint-disable-next-line func-names
|
|
1019
|
-
var kindOf = (function(cache) {
|
|
1020
|
-
// eslint-disable-next-line func-names
|
|
1021
|
-
return function(thing) {
|
|
1022
|
-
var str = toString.call(thing);
|
|
1023
|
-
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
1024
|
-
};
|
|
1025
|
-
})(Object.create(null));
|
|
1026
|
-
|
|
1027
|
-
function kindOfTest(type) {
|
|
1028
|
-
type = type.toLowerCase();
|
|
1029
|
-
return function isKindOf(thing) {
|
|
1030
|
-
return kindOf(thing) === type;
|
|
1031
|
-
};
|
|
1032
|
-
}
|
|
204
|
+
/**
|
|
205
|
+
* Determine if a value is a URLSearchParams object
|
|
206
|
+
* @function
|
|
207
|
+
* @param {Object} val The value to test
|
|
208
|
+
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
209
|
+
*/
|
|
210
|
+
var isURLSearchParams = kindOfTest('URLSearchParams');
|
|
1033
211
|
|
|
1034
212
|
/**
|
|
1035
|
-
*
|
|
1036
|
-
*/
|
|
1037
|
-
var supportedProtocols = [ 'http:', 'https:', 'file:' ];
|
|
1038
|
-
|
|
1039
|
-
/**
|
|
1040
|
-
* Returns URL protocol passed as param if is not undefined or null,
|
|
1041
|
-
* otherwise just returns 'http:'
|
|
213
|
+
* Trim excess whitespace off the beginning and end of a string
|
|
1042
214
|
*
|
|
1043
|
-
* @param {String}
|
|
1044
|
-
* @returns {String}
|
|
215
|
+
* @param {String} str The String to trim
|
|
216
|
+
* @returns {String} The String freed of excess whitespace
|
|
1045
217
|
*/
|
|
1046
|
-
function
|
|
1047
|
-
return
|
|
218
|
+
function trim(str) {
|
|
219
|
+
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
|
|
1048
220
|
}
|
|
1049
221
|
|
|
1050
222
|
/**
|
|
1051
|
-
* Determine if a
|
|
223
|
+
* Determine if we're running in a standard browser environment
|
|
1052
224
|
*
|
|
1053
|
-
*
|
|
1054
|
-
*
|
|
1055
|
-
*/
|
|
1056
|
-
function isArray$1(val) {
|
|
1057
|
-
return Array.isArray(val);
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
/**
|
|
1061
|
-
* Determine if a value is undefined
|
|
225
|
+
* This allows axios to run in a web worker, and react-native.
|
|
226
|
+
* Both environments support XMLHttpRequest, but not fully standard globals.
|
|
1062
227
|
*
|
|
1063
|
-
*
|
|
1064
|
-
*
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
* Determine if a value is a Buffer
|
|
1072
|
-
*
|
|
1073
|
-
* @param {Object} val The value to test
|
|
1074
|
-
* @returns {boolean} True if value is a Buffer, otherwise false
|
|
1075
|
-
*/
|
|
1076
|
-
function isBuffer(val) {
|
|
1077
|
-
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
|
1078
|
-
&& typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
/**
|
|
1082
|
-
* Determine if a value is an ArrayBuffer
|
|
1083
|
-
*
|
|
1084
|
-
* @function
|
|
1085
|
-
* @param {Object} val The value to test
|
|
1086
|
-
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
1087
|
-
*/
|
|
1088
|
-
var isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
/**
|
|
1092
|
-
* Determine if a value is a view on an ArrayBuffer
|
|
1093
|
-
*
|
|
1094
|
-
* @param {Object} val The value to test
|
|
1095
|
-
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
|
|
1096
|
-
*/
|
|
1097
|
-
function isArrayBufferView(val) {
|
|
1098
|
-
var result;
|
|
1099
|
-
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
|
1100
|
-
result = ArrayBuffer.isView(val);
|
|
1101
|
-
} else {
|
|
1102
|
-
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
|
|
1103
|
-
}
|
|
1104
|
-
return result;
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
/**
|
|
1108
|
-
* Determine if a value is a String
|
|
1109
|
-
*
|
|
1110
|
-
* @param {Object} val The value to test
|
|
1111
|
-
* @returns {boolean} True if value is a String, otherwise false
|
|
1112
|
-
*/
|
|
1113
|
-
function isString$1(val) {
|
|
1114
|
-
return typeof val === 'string';
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
/**
|
|
1118
|
-
* Determine if a value is a Number
|
|
1119
|
-
*
|
|
1120
|
-
* @param {Object} val The value to test
|
|
1121
|
-
* @returns {boolean} True if value is a Number, otherwise false
|
|
1122
|
-
*/
|
|
1123
|
-
function isNumber(val) {
|
|
1124
|
-
return typeof val === 'number';
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
/**
|
|
1128
|
-
* Determine if a value is an Object
|
|
1129
|
-
*
|
|
1130
|
-
* @param {Object} val The value to test
|
|
1131
|
-
* @returns {boolean} True if value is an Object, otherwise false
|
|
1132
|
-
*/
|
|
1133
|
-
function isObject$1(val) {
|
|
1134
|
-
return val !== null && typeof val === 'object';
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
/**
|
|
1138
|
-
* Determine if a value is a plain Object
|
|
1139
|
-
*
|
|
1140
|
-
* @param {Object} val The value to test
|
|
1141
|
-
* @return {boolean} True if value is a plain Object, otherwise false
|
|
1142
|
-
*/
|
|
1143
|
-
function isPlainObject(val) {
|
|
1144
|
-
if (kindOf(val) !== 'object') {
|
|
1145
|
-
return false;
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
|
-
var prototype = Object.getPrototypeOf(val);
|
|
1149
|
-
return prototype === null || prototype === Object.prototype;
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
/**
|
|
1153
|
-
* Determine if a value is a Date
|
|
1154
|
-
*
|
|
1155
|
-
* @function
|
|
1156
|
-
* @param {Object} val The value to test
|
|
1157
|
-
* @returns {boolean} True if value is a Date, otherwise false
|
|
1158
|
-
*/
|
|
1159
|
-
var isDate = kindOfTest('Date');
|
|
1160
|
-
|
|
1161
|
-
/**
|
|
1162
|
-
* Determine if a value is a File
|
|
1163
|
-
*
|
|
1164
|
-
* @function
|
|
1165
|
-
* @param {Object} val The value to test
|
|
1166
|
-
* @returns {boolean} True if value is a File, otherwise false
|
|
1167
|
-
*/
|
|
1168
|
-
var isFile = kindOfTest('File');
|
|
1169
|
-
|
|
1170
|
-
/**
|
|
1171
|
-
* Determine if a value is a Blob
|
|
1172
|
-
*
|
|
1173
|
-
* @function
|
|
1174
|
-
* @param {Object} val The value to test
|
|
1175
|
-
* @returns {boolean} True if value is a Blob, otherwise false
|
|
1176
|
-
*/
|
|
1177
|
-
var isBlob = kindOfTest('Blob');
|
|
1178
|
-
|
|
1179
|
-
/**
|
|
1180
|
-
* Determine if a value is a FileList
|
|
1181
|
-
*
|
|
1182
|
-
* @function
|
|
1183
|
-
* @param {Object} val The value to test
|
|
1184
|
-
* @returns {boolean} True if value is a File, otherwise false
|
|
1185
|
-
*/
|
|
1186
|
-
var isFileList = kindOfTest('FileList');
|
|
1187
|
-
|
|
1188
|
-
/**
|
|
1189
|
-
* Determine if a value is a Function
|
|
1190
|
-
*
|
|
1191
|
-
* @param {Object} val The value to test
|
|
1192
|
-
* @returns {boolean} True if value is a Function, otherwise false
|
|
1193
|
-
*/
|
|
1194
|
-
function isFunction(val) {
|
|
1195
|
-
return toString.call(val) === '[object Function]';
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
/**
|
|
1199
|
-
* Determine if a value is a Stream
|
|
1200
|
-
*
|
|
1201
|
-
* @param {Object} val The value to test
|
|
1202
|
-
* @returns {boolean} True if value is a Stream, otherwise false
|
|
1203
|
-
*/
|
|
1204
|
-
function isStream(val) {
|
|
1205
|
-
return isObject$1(val) && isFunction(val.pipe);
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
/**
|
|
1209
|
-
* Determine if a value is a FormData
|
|
1210
|
-
*
|
|
1211
|
-
* @param {Object} thing The value to test
|
|
1212
|
-
* @returns {boolean} True if value is an FormData, otherwise false
|
|
1213
|
-
*/
|
|
1214
|
-
function isFormData(thing) {
|
|
1215
|
-
var pattern = '[object FormData]';
|
|
1216
|
-
return thing && (
|
|
1217
|
-
(typeof FormData === 'function' && thing instanceof FormData) ||
|
|
1218
|
-
toString.call(thing) === pattern ||
|
|
1219
|
-
(isFunction(thing.toString) && thing.toString() === pattern)
|
|
1220
|
-
);
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1223
|
-
/**
|
|
1224
|
-
* Determine if a value is a URLSearchParams object
|
|
1225
|
-
* @function
|
|
1226
|
-
* @param {Object} val The value to test
|
|
1227
|
-
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
1228
|
-
*/
|
|
1229
|
-
var isURLSearchParams = kindOfTest('URLSearchParams');
|
|
1230
|
-
|
|
1231
|
-
/**
|
|
1232
|
-
* Trim excess whitespace off the beginning and end of a string
|
|
1233
|
-
*
|
|
1234
|
-
* @param {String} str The String to trim
|
|
1235
|
-
* @returns {String} The String freed of excess whitespace
|
|
1236
|
-
*/
|
|
1237
|
-
function trim(str) {
|
|
1238
|
-
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
/**
|
|
1242
|
-
* Determine if we're running in a standard browser environment
|
|
1243
|
-
*
|
|
1244
|
-
* This allows axios to run in a web worker, and react-native.
|
|
1245
|
-
* Both environments support XMLHttpRequest, but not fully standard globals.
|
|
1246
|
-
*
|
|
1247
|
-
* web workers:
|
|
1248
|
-
* typeof window -> undefined
|
|
1249
|
-
* typeof document -> undefined
|
|
1250
|
-
*
|
|
1251
|
-
* react-native:
|
|
1252
|
-
* navigator.product -> 'ReactNative'
|
|
1253
|
-
* nativescript
|
|
1254
|
-
* navigator.product -> 'NativeScript' or 'NS'
|
|
1255
|
-
*/
|
|
1256
|
-
function isStandardBrowserEnv() {
|
|
1257
|
-
if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
|
|
1258
|
-
navigator.product === 'NativeScript' ||
|
|
1259
|
-
navigator.product === 'NS')) {
|
|
1260
|
-
return false;
|
|
1261
|
-
}
|
|
1262
|
-
return (
|
|
1263
|
-
typeof window !== 'undefined' &&
|
|
1264
|
-
typeof document !== 'undefined'
|
|
1265
|
-
);
|
|
1266
|
-
}
|
|
1267
|
-
|
|
1268
|
-
/**
|
|
1269
|
-
* Iterate over an Array or an Object invoking a function for each item.
|
|
1270
|
-
*
|
|
1271
|
-
* If `obj` is an Array callback will be called passing
|
|
1272
|
-
* the value, index, and complete array for each item.
|
|
1273
|
-
*
|
|
1274
|
-
* If 'obj' is an Object callback will be called passing
|
|
1275
|
-
* the value, key, and complete object for each property.
|
|
1276
|
-
*
|
|
1277
|
-
* @param {Object|Array} obj The object to iterate
|
|
1278
|
-
* @param {Function} fn The callback to invoke for each item
|
|
1279
|
-
*/
|
|
1280
|
-
function forEach(obj, fn) {
|
|
1281
|
-
// Don't bother if no value provided
|
|
1282
|
-
if (obj === null || typeof obj === 'undefined') {
|
|
1283
|
-
return;
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
// Force an array if not already something iterable
|
|
1287
|
-
if (typeof obj !== 'object') {
|
|
1288
|
-
/*eslint no-param-reassign:0*/
|
|
1289
|
-
obj = [obj];
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
if (isArray$1(obj)) {
|
|
1293
|
-
// Iterate over array values
|
|
1294
|
-
for (var i = 0, l = obj.length; i < l; i++) {
|
|
1295
|
-
fn.call(null, obj[i], i, obj);
|
|
1296
|
-
}
|
|
1297
|
-
} else {
|
|
1298
|
-
// Iterate over object keys
|
|
1299
|
-
for (var key in obj) {
|
|
1300
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
1301
|
-
fn.call(null, obj[key], key, obj);
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
/**
|
|
1308
|
-
* Accepts varargs expecting each argument to be an object, then
|
|
1309
|
-
* immutably merges the properties of each object and returns result.
|
|
1310
|
-
*
|
|
1311
|
-
* When multiple objects contain the same key the later object in
|
|
1312
|
-
* the arguments list will take precedence.
|
|
1313
|
-
*
|
|
1314
|
-
* Example:
|
|
1315
|
-
*
|
|
1316
|
-
* ```js
|
|
1317
|
-
* var result = merge({foo: 123}, {foo: 456});
|
|
1318
|
-
* console.log(result.foo); // outputs 456
|
|
1319
|
-
* ```
|
|
1320
|
-
*
|
|
1321
|
-
* @param {Object} obj1 Object to merge
|
|
1322
|
-
* @returns {Object} Result of all merge properties
|
|
1323
|
-
*/
|
|
1324
|
-
function merge(/* obj1, obj2, obj3, ... */) {
|
|
1325
|
-
var result = {};
|
|
1326
|
-
function assignValue(val, key) {
|
|
1327
|
-
if (isPlainObject(result[key]) && isPlainObject(val)) {
|
|
1328
|
-
result[key] = merge(result[key], val);
|
|
1329
|
-
} else if (isPlainObject(val)) {
|
|
1330
|
-
result[key] = merge({}, val);
|
|
1331
|
-
} else if (isArray$1(val)) {
|
|
1332
|
-
result[key] = val.slice();
|
|
1333
|
-
} else {
|
|
1334
|
-
result[key] = val;
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
1339
|
-
forEach(arguments[i], assignValue);
|
|
1340
|
-
}
|
|
1341
|
-
return result;
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
/**
|
|
1345
|
-
* Extends object a by mutably adding to it the properties of object b.
|
|
1346
|
-
*
|
|
1347
|
-
* @param {Object} a The object to be extended
|
|
1348
|
-
* @param {Object} b The object to copy properties from
|
|
1349
|
-
* @param {Object} thisArg The object to bind function to
|
|
1350
|
-
* @return {Object} The resulting value of object a
|
|
1351
|
-
*/
|
|
1352
|
-
function extend(a, b, thisArg) {
|
|
1353
|
-
forEach(b, function assignValue(val, key) {
|
|
1354
|
-
if (thisArg && typeof val === 'function') {
|
|
1355
|
-
a[key] = bind(val, thisArg);
|
|
1356
|
-
} else {
|
|
1357
|
-
a[key] = val;
|
|
1358
|
-
}
|
|
1359
|
-
});
|
|
1360
|
-
return a;
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
/**
|
|
1364
|
-
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
|
|
1365
|
-
*
|
|
1366
|
-
* @param {string} content with BOM
|
|
1367
|
-
* @return {string} content value without BOM
|
|
1368
|
-
*/
|
|
1369
|
-
function stripBOM(content) {
|
|
1370
|
-
if (content.charCodeAt(0) === 0xFEFF) {
|
|
1371
|
-
content = content.slice(1);
|
|
1372
|
-
}
|
|
1373
|
-
return content;
|
|
1374
|
-
}
|
|
1375
|
-
|
|
1376
|
-
/**
|
|
1377
|
-
* Inherit the prototype methods from one constructor into another
|
|
1378
|
-
* @param {function} constructor
|
|
1379
|
-
* @param {function} superConstructor
|
|
1380
|
-
* @param {object} [props]
|
|
1381
|
-
* @param {object} [descriptors]
|
|
1382
|
-
*/
|
|
1383
|
-
|
|
1384
|
-
function inherits(constructor, superConstructor, props, descriptors) {
|
|
1385
|
-
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
1386
|
-
constructor.prototype.constructor = constructor;
|
|
1387
|
-
props && Object.assign(constructor.prototype, props);
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
/**
|
|
1391
|
-
* Resolve object with deep prototype chain to a flat object
|
|
1392
|
-
* @param {Object} sourceObj source object
|
|
1393
|
-
* @param {Object} [destObj]
|
|
1394
|
-
* @param {Function} [filter]
|
|
1395
|
-
* @returns {Object}
|
|
1396
|
-
*/
|
|
1397
|
-
|
|
1398
|
-
function toFlatObject(sourceObj, destObj, filter) {
|
|
1399
|
-
var props;
|
|
1400
|
-
var i;
|
|
1401
|
-
var prop;
|
|
1402
|
-
var merged = {};
|
|
1403
|
-
|
|
1404
|
-
destObj = destObj || {};
|
|
1405
|
-
|
|
1406
|
-
do {
|
|
1407
|
-
props = Object.getOwnPropertyNames(sourceObj);
|
|
1408
|
-
i = props.length;
|
|
1409
|
-
while (i-- > 0) {
|
|
1410
|
-
prop = props[i];
|
|
1411
|
-
if (!merged[prop]) {
|
|
1412
|
-
destObj[prop] = sourceObj[prop];
|
|
1413
|
-
merged[prop] = true;
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
sourceObj = Object.getPrototypeOf(sourceObj);
|
|
1417
|
-
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
1418
|
-
|
|
1419
|
-
return destObj;
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1422
|
-
/*
|
|
1423
|
-
* determines whether a string ends with the characters of a specified string
|
|
1424
|
-
* @param {String} str
|
|
1425
|
-
* @param {String} searchString
|
|
1426
|
-
* @param {Number} [position= 0]
|
|
1427
|
-
* @returns {boolean}
|
|
1428
|
-
*/
|
|
1429
|
-
function endsWith(str, searchString, position) {
|
|
1430
|
-
str = String(str);
|
|
1431
|
-
if (position === undefined || position > str.length) {
|
|
1432
|
-
position = str.length;
|
|
1433
|
-
}
|
|
1434
|
-
position -= searchString.length;
|
|
1435
|
-
var lastIndex = str.indexOf(searchString, position);
|
|
1436
|
-
return lastIndex !== -1 && lastIndex === position;
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
/**
|
|
1441
|
-
* Returns new array from array like object
|
|
1442
|
-
* @param {*} [thing]
|
|
1443
|
-
* @returns {Array}
|
|
1444
|
-
*/
|
|
1445
|
-
function toArray(thing) {
|
|
1446
|
-
if (!thing) return null;
|
|
1447
|
-
var i = thing.length;
|
|
1448
|
-
if (isUndefined(i)) return null;
|
|
1449
|
-
var arr = new Array(i);
|
|
1450
|
-
while (i-- > 0) {
|
|
1451
|
-
arr[i] = thing[i];
|
|
1452
|
-
}
|
|
1453
|
-
return arr;
|
|
1454
|
-
}
|
|
1455
|
-
|
|
1456
|
-
// eslint-disable-next-line func-names
|
|
1457
|
-
var isTypedArray = (function(TypedArray) {
|
|
1458
|
-
// eslint-disable-next-line func-names
|
|
1459
|
-
return function(thing) {
|
|
1460
|
-
return TypedArray && thing instanceof TypedArray;
|
|
1461
|
-
};
|
|
1462
|
-
})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
|
|
1463
|
-
|
|
1464
|
-
var utils = {
|
|
1465
|
-
supportedProtocols: supportedProtocols,
|
|
1466
|
-
getProtocol: getProtocol,
|
|
1467
|
-
isArray: isArray$1,
|
|
1468
|
-
isArrayBuffer: isArrayBuffer,
|
|
1469
|
-
isBuffer: isBuffer,
|
|
1470
|
-
isFormData: isFormData,
|
|
1471
|
-
isArrayBufferView: isArrayBufferView,
|
|
1472
|
-
isString: isString$1,
|
|
1473
|
-
isNumber: isNumber,
|
|
1474
|
-
isObject: isObject$1,
|
|
1475
|
-
isPlainObject: isPlainObject,
|
|
1476
|
-
isUndefined: isUndefined,
|
|
1477
|
-
isDate: isDate,
|
|
1478
|
-
isFile: isFile,
|
|
1479
|
-
isBlob: isBlob,
|
|
1480
|
-
isFunction: isFunction,
|
|
1481
|
-
isStream: isStream,
|
|
1482
|
-
isURLSearchParams: isURLSearchParams,
|
|
1483
|
-
isStandardBrowserEnv: isStandardBrowserEnv,
|
|
1484
|
-
forEach: forEach,
|
|
1485
|
-
merge: merge,
|
|
1486
|
-
extend: extend,
|
|
1487
|
-
trim: trim,
|
|
1488
|
-
stripBOM: stripBOM,
|
|
1489
|
-
inherits: inherits,
|
|
1490
|
-
toFlatObject: toFlatObject,
|
|
1491
|
-
kindOf: kindOf,
|
|
1492
|
-
kindOfTest: kindOfTest,
|
|
1493
|
-
endsWith: endsWith,
|
|
1494
|
-
toArray: toArray,
|
|
1495
|
-
isTypedArray: isTypedArray,
|
|
1496
|
-
isFileList: isFileList
|
|
1497
|
-
};
|
|
1498
|
-
|
|
1499
|
-
function encode$1(val) {
|
|
1500
|
-
return encodeURIComponent(val).
|
|
1501
|
-
replace(/%3A/gi, ':').
|
|
1502
|
-
replace(/%24/g, '$').
|
|
1503
|
-
replace(/%2C/gi, ',').
|
|
1504
|
-
replace(/%20/g, '+').
|
|
1505
|
-
replace(/%5B/gi, '[').
|
|
1506
|
-
replace(/%5D/gi, ']');
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
/**
|
|
1510
|
-
* Build a URL by appending params to the end
|
|
1511
|
-
*
|
|
1512
|
-
* @param {string} url The base of the url (e.g., http://www.google.com)
|
|
1513
|
-
* @param {object} [params] The params to be appended
|
|
1514
|
-
* @returns {string} The formatted url
|
|
1515
|
-
*/
|
|
1516
|
-
var buildURL = function buildURL(url, params, paramsSerializer) {
|
|
1517
|
-
/*eslint no-param-reassign:0*/
|
|
1518
|
-
if (!params) {
|
|
1519
|
-
return url;
|
|
1520
|
-
}
|
|
1521
|
-
|
|
1522
|
-
var serializedParams;
|
|
1523
|
-
if (paramsSerializer) {
|
|
1524
|
-
serializedParams = paramsSerializer(params);
|
|
1525
|
-
} else if (utils.isURLSearchParams(params)) {
|
|
1526
|
-
serializedParams = params.toString();
|
|
1527
|
-
} else {
|
|
1528
|
-
var parts = [];
|
|
1529
|
-
|
|
1530
|
-
utils.forEach(params, function serialize(val, key) {
|
|
1531
|
-
if (val === null || typeof val === 'undefined') {
|
|
1532
|
-
return;
|
|
1533
|
-
}
|
|
1534
|
-
|
|
1535
|
-
if (utils.isArray(val)) {
|
|
1536
|
-
key = key + '[]';
|
|
1537
|
-
} else {
|
|
1538
|
-
val = [val];
|
|
1539
|
-
}
|
|
1540
|
-
|
|
1541
|
-
utils.forEach(val, function parseValue(v) {
|
|
1542
|
-
if (utils.isDate(v)) {
|
|
1543
|
-
v = v.toISOString();
|
|
1544
|
-
} else if (utils.isObject(v)) {
|
|
1545
|
-
v = JSON.stringify(v);
|
|
1546
|
-
}
|
|
1547
|
-
parts.push(encode$1(key) + '=' + encode$1(v));
|
|
1548
|
-
});
|
|
1549
|
-
});
|
|
1550
|
-
|
|
1551
|
-
serializedParams = parts.join('&');
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
|
-
if (serializedParams) {
|
|
1555
|
-
var hashmarkIndex = url.indexOf('#');
|
|
1556
|
-
if (hashmarkIndex !== -1) {
|
|
1557
|
-
url = url.slice(0, hashmarkIndex);
|
|
1558
|
-
}
|
|
1559
|
-
|
|
1560
|
-
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
|
1561
|
-
}
|
|
1562
|
-
|
|
1563
|
-
return url;
|
|
1564
|
-
};
|
|
1565
|
-
|
|
1566
|
-
function InterceptorManager() {
|
|
1567
|
-
this.handlers = [];
|
|
1568
|
-
}
|
|
1569
|
-
|
|
1570
|
-
/**
|
|
1571
|
-
* Add a new interceptor to the stack
|
|
1572
|
-
*
|
|
1573
|
-
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
1574
|
-
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
1575
|
-
*
|
|
1576
|
-
* @return {Number} An ID used to remove interceptor later
|
|
1577
|
-
*/
|
|
1578
|
-
InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
|
|
1579
|
-
this.handlers.push({
|
|
1580
|
-
fulfilled: fulfilled,
|
|
1581
|
-
rejected: rejected,
|
|
1582
|
-
synchronous: options ? options.synchronous : false,
|
|
1583
|
-
runWhen: options ? options.runWhen : null
|
|
1584
|
-
});
|
|
1585
|
-
return this.handlers.length - 1;
|
|
1586
|
-
};
|
|
1587
|
-
|
|
1588
|
-
/**
|
|
1589
|
-
* Remove an interceptor from the stack
|
|
1590
|
-
*
|
|
1591
|
-
* @param {Number} id The ID that was returned by `use`
|
|
1592
|
-
*/
|
|
1593
|
-
InterceptorManager.prototype.eject = function eject(id) {
|
|
1594
|
-
if (this.handlers[id]) {
|
|
1595
|
-
this.handlers[id] = null;
|
|
1596
|
-
}
|
|
1597
|
-
};
|
|
1598
|
-
|
|
1599
|
-
/**
|
|
1600
|
-
* Iterate over all the registered interceptors
|
|
1601
|
-
*
|
|
1602
|
-
* This method is particularly useful for skipping over any
|
|
1603
|
-
* interceptors that may have become `null` calling `eject`.
|
|
1604
|
-
*
|
|
1605
|
-
* @param {Function} fn The function to call for each interceptor
|
|
1606
|
-
*/
|
|
1607
|
-
InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
1608
|
-
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
1609
|
-
if (h !== null) {
|
|
1610
|
-
fn(h);
|
|
1611
|
-
}
|
|
1612
|
-
});
|
|
1613
|
-
};
|
|
1614
|
-
|
|
1615
|
-
var InterceptorManager_1 = InterceptorManager;
|
|
1616
|
-
|
|
1617
|
-
var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
|
|
1618
|
-
utils.forEach(headers, function processHeader(value, name) {
|
|
1619
|
-
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
|
1620
|
-
headers[normalizedName] = value;
|
|
1621
|
-
delete headers[name];
|
|
1622
|
-
}
|
|
1623
|
-
});
|
|
1624
|
-
};
|
|
1625
|
-
|
|
1626
|
-
/**
|
|
1627
|
-
* Create an Error with the specified message, config, error code, request and response.
|
|
1628
|
-
*
|
|
1629
|
-
* @param {string} message The error message.
|
|
1630
|
-
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
1631
|
-
* @param {Object} [config] The config.
|
|
1632
|
-
* @param {Object} [request] The request.
|
|
1633
|
-
* @param {Object} [response] The response.
|
|
1634
|
-
* @returns {Error} The created error.
|
|
1635
|
-
*/
|
|
1636
|
-
function AxiosError(message, code, config, request, response) {
|
|
1637
|
-
Error.call(this);
|
|
1638
|
-
this.message = message;
|
|
1639
|
-
this.name = 'AxiosError';
|
|
1640
|
-
code && (this.code = code);
|
|
1641
|
-
config && (this.config = config);
|
|
1642
|
-
request && (this.request = request);
|
|
1643
|
-
response && (this.response = response);
|
|
1644
|
-
}
|
|
1645
|
-
|
|
1646
|
-
utils.inherits(AxiosError, Error, {
|
|
1647
|
-
toJSON: function toJSON() {
|
|
1648
|
-
return {
|
|
1649
|
-
// Standard
|
|
1650
|
-
message: this.message,
|
|
1651
|
-
name: this.name,
|
|
1652
|
-
// Microsoft
|
|
1653
|
-
description: this.description,
|
|
1654
|
-
number: this.number,
|
|
1655
|
-
// Mozilla
|
|
1656
|
-
fileName: this.fileName,
|
|
1657
|
-
lineNumber: this.lineNumber,
|
|
1658
|
-
columnNumber: this.columnNumber,
|
|
1659
|
-
stack: this.stack,
|
|
1660
|
-
// Axios
|
|
1661
|
-
config: this.config,
|
|
1662
|
-
code: this.code,
|
|
1663
|
-
status: this.response && this.response.status ? this.response.status : null
|
|
1664
|
-
};
|
|
1665
|
-
}
|
|
1666
|
-
});
|
|
1667
|
-
|
|
1668
|
-
var prototype = AxiosError.prototype;
|
|
1669
|
-
var descriptors = {};
|
|
1670
|
-
|
|
1671
|
-
[
|
|
1672
|
-
'ERR_BAD_OPTION_VALUE',
|
|
1673
|
-
'ERR_BAD_OPTION',
|
|
1674
|
-
'ECONNABORTED',
|
|
1675
|
-
'ETIMEDOUT',
|
|
1676
|
-
'ERR_NETWORK',
|
|
1677
|
-
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
1678
|
-
'ERR_DEPRECATED',
|
|
1679
|
-
'ERR_BAD_RESPONSE',
|
|
1680
|
-
'ERR_BAD_REQUEST',
|
|
1681
|
-
'ERR_CANCELED'
|
|
1682
|
-
// eslint-disable-next-line func-names
|
|
1683
|
-
].forEach(function(code) {
|
|
1684
|
-
descriptors[code] = {value: code};
|
|
1685
|
-
});
|
|
1686
|
-
|
|
1687
|
-
Object.defineProperties(AxiosError, descriptors);
|
|
1688
|
-
Object.defineProperty(prototype, 'isAxiosError', {value: true});
|
|
1689
|
-
|
|
1690
|
-
// eslint-disable-next-line func-names
|
|
1691
|
-
AxiosError.from = function(error, code, config, request, response, customProps) {
|
|
1692
|
-
var axiosError = Object.create(prototype);
|
|
1693
|
-
|
|
1694
|
-
utils.toFlatObject(error, axiosError, function filter(obj) {
|
|
1695
|
-
return obj !== Error.prototype;
|
|
1696
|
-
});
|
|
1697
|
-
|
|
1698
|
-
AxiosError.call(axiosError, error.message, code, config, request, response);
|
|
1699
|
-
|
|
1700
|
-
axiosError.name = error.name;
|
|
1701
|
-
|
|
1702
|
-
customProps && Object.assign(axiosError, customProps);
|
|
1703
|
-
|
|
1704
|
-
return axiosError;
|
|
1705
|
-
};
|
|
1706
|
-
|
|
1707
|
-
var AxiosError_1 = AxiosError;
|
|
1708
|
-
|
|
1709
|
-
var transitional = {
|
|
1710
|
-
silentJSONParsing: true,
|
|
1711
|
-
forcedJSONParsing: true,
|
|
1712
|
-
clarifyTimeoutError: false
|
|
1713
|
-
};
|
|
1714
|
-
transitional.silentJSONParsing;
|
|
1715
|
-
transitional.forcedJSONParsing;
|
|
1716
|
-
transitional.clarifyTimeoutError;
|
|
1717
|
-
|
|
1718
|
-
/**
|
|
1719
|
-
* Convert a data object to FormData
|
|
1720
|
-
* @param {Object} obj
|
|
1721
|
-
* @param {?Object} [formData]
|
|
1722
|
-
* @returns {Object}
|
|
1723
|
-
**/
|
|
1724
|
-
|
|
1725
|
-
function toFormData(obj, formData) {
|
|
1726
|
-
// eslint-disable-next-line no-param-reassign
|
|
1727
|
-
formData = formData || new FormData();
|
|
1728
|
-
|
|
1729
|
-
var stack = [];
|
|
1730
|
-
|
|
1731
|
-
function convertValue(value) {
|
|
1732
|
-
if (value === null) return '';
|
|
1733
|
-
|
|
1734
|
-
if (utils.isDate(value)) {
|
|
1735
|
-
return value.toISOString();
|
|
1736
|
-
}
|
|
1737
|
-
|
|
1738
|
-
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
|
1739
|
-
return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
return value;
|
|
1743
|
-
}
|
|
1744
|
-
|
|
1745
|
-
function build(data, parentKey) {
|
|
1746
|
-
if (utils.isPlainObject(data) || utils.isArray(data)) {
|
|
1747
|
-
if (stack.indexOf(data) !== -1) {
|
|
1748
|
-
throw Error('Circular reference detected in ' + parentKey);
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
stack.push(data);
|
|
1752
|
-
|
|
1753
|
-
utils.forEach(data, function each(value, key) {
|
|
1754
|
-
if (utils.isUndefined(value)) return;
|
|
1755
|
-
var fullKey = parentKey ? parentKey + '.' + key : key;
|
|
1756
|
-
var arr;
|
|
1757
|
-
|
|
1758
|
-
if (value && !parentKey && typeof value === 'object') {
|
|
1759
|
-
if (utils.endsWith(key, '{}')) {
|
|
1760
|
-
// eslint-disable-next-line no-param-reassign
|
|
1761
|
-
value = JSON.stringify(value);
|
|
1762
|
-
} else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
|
|
1763
|
-
// eslint-disable-next-line func-names
|
|
1764
|
-
arr.forEach(function(el) {
|
|
1765
|
-
!utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
|
|
1766
|
-
});
|
|
1767
|
-
return;
|
|
1768
|
-
}
|
|
1769
|
-
}
|
|
1770
|
-
|
|
1771
|
-
build(value, fullKey);
|
|
1772
|
-
});
|
|
1773
|
-
|
|
1774
|
-
stack.pop();
|
|
1775
|
-
} else {
|
|
1776
|
-
formData.append(parentKey, convertValue(data));
|
|
1777
|
-
}
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1780
|
-
build(obj);
|
|
1781
|
-
|
|
1782
|
-
return formData;
|
|
1783
|
-
}
|
|
1784
|
-
|
|
1785
|
-
var toFormData_1 = toFormData;
|
|
1786
|
-
|
|
1787
|
-
/**
|
|
1788
|
-
* Resolve or reject a Promise based on response status.
|
|
1789
|
-
*
|
|
1790
|
-
* @param {Function} resolve A function that resolves the promise.
|
|
1791
|
-
* @param {Function} reject A function that rejects the promise.
|
|
1792
|
-
* @param {object} response The response.
|
|
1793
|
-
*/
|
|
1794
|
-
var settle = function settle(resolve, reject, response) {
|
|
1795
|
-
var validateStatus = response.config.validateStatus;
|
|
1796
|
-
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
1797
|
-
resolve(response);
|
|
1798
|
-
} else {
|
|
1799
|
-
reject(new AxiosError_1(
|
|
1800
|
-
'Request failed with status code ' + response.status,
|
|
1801
|
-
[AxiosError_1.ERR_BAD_REQUEST, AxiosError_1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
1802
|
-
response.config,
|
|
1803
|
-
response.request,
|
|
1804
|
-
response
|
|
1805
|
-
));
|
|
1806
|
-
}
|
|
1807
|
-
};
|
|
1808
|
-
|
|
1809
|
-
var cookies = (
|
|
1810
|
-
utils.isStandardBrowserEnv() ?
|
|
1811
|
-
|
|
1812
|
-
// Standard browser envs support document.cookie
|
|
1813
|
-
(function standardBrowserEnv() {
|
|
1814
|
-
return {
|
|
1815
|
-
write: function write(name, value, expires, path, domain, secure) {
|
|
1816
|
-
var cookie = [];
|
|
1817
|
-
cookie.push(name + '=' + encodeURIComponent(value));
|
|
1818
|
-
|
|
1819
|
-
if (utils.isNumber(expires)) {
|
|
1820
|
-
cookie.push('expires=' + new Date(expires).toGMTString());
|
|
1821
|
-
}
|
|
1822
|
-
|
|
1823
|
-
if (utils.isString(path)) {
|
|
1824
|
-
cookie.push('path=' + path);
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
if (utils.isString(domain)) {
|
|
1828
|
-
cookie.push('domain=' + domain);
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1831
|
-
if (secure === true) {
|
|
1832
|
-
cookie.push('secure');
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
document.cookie = cookie.join('; ');
|
|
1836
|
-
},
|
|
1837
|
-
|
|
1838
|
-
read: function read(name) {
|
|
1839
|
-
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
1840
|
-
return (match ? decodeURIComponent(match[3]) : null);
|
|
1841
|
-
},
|
|
1842
|
-
|
|
1843
|
-
remove: function remove(name) {
|
|
1844
|
-
this.write(name, '', Date.now() - 86400000);
|
|
1845
|
-
}
|
|
1846
|
-
};
|
|
1847
|
-
})() :
|
|
1848
|
-
|
|
1849
|
-
// Non standard browser env (web workers, react-native) lack needed support.
|
|
1850
|
-
(function nonStandardBrowserEnv() {
|
|
1851
|
-
return {
|
|
1852
|
-
write: function write() {},
|
|
1853
|
-
read: function read() { return null; },
|
|
1854
|
-
remove: function remove() {}
|
|
1855
|
-
};
|
|
1856
|
-
})()
|
|
1857
|
-
);
|
|
1858
|
-
|
|
1859
|
-
/**
|
|
1860
|
-
* Determines whether the specified URL is absolute
|
|
1861
|
-
*
|
|
1862
|
-
* @param {string} url The URL to test
|
|
1863
|
-
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
1864
|
-
*/
|
|
1865
|
-
var isAbsoluteURL = function isAbsoluteURL(url) {
|
|
1866
|
-
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
1867
|
-
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
1868
|
-
// by any combination of letters, digits, plus, period, or hyphen.
|
|
1869
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
1870
|
-
};
|
|
1871
|
-
|
|
1872
|
-
/**
|
|
1873
|
-
* Creates a new URL by combining the specified URLs
|
|
1874
|
-
*
|
|
1875
|
-
* @param {string} baseURL The base URL
|
|
1876
|
-
* @param {string} relativeURL The relative URL
|
|
1877
|
-
* @returns {string} The combined URL
|
|
1878
|
-
*/
|
|
1879
|
-
var combineURLs = function combineURLs(baseURL, relativeURL) {
|
|
1880
|
-
return relativeURL
|
|
1881
|
-
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
1882
|
-
: baseURL;
|
|
1883
|
-
};
|
|
1884
|
-
|
|
1885
|
-
/**
|
|
1886
|
-
* Creates a new URL by combining the baseURL with the requestedURL,
|
|
1887
|
-
* only when the requestedURL is not already an absolute URL.
|
|
1888
|
-
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
|
1889
|
-
*
|
|
1890
|
-
* @param {string} baseURL The base URL
|
|
1891
|
-
* @param {string} requestedURL Absolute or relative URL to combine
|
|
1892
|
-
* @returns {string} The combined full path
|
|
1893
|
-
*/
|
|
1894
|
-
var buildFullPath = function buildFullPath(baseURL, requestedURL) {
|
|
1895
|
-
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
1896
|
-
return combineURLs(baseURL, requestedURL);
|
|
1897
|
-
}
|
|
1898
|
-
return requestedURL;
|
|
1899
|
-
};
|
|
1900
|
-
|
|
1901
|
-
// Headers whose duplicates are ignored by node
|
|
1902
|
-
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
1903
|
-
var ignoreDuplicateOf = [
|
|
1904
|
-
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
|
1905
|
-
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
|
1906
|
-
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
|
1907
|
-
'referer', 'retry-after', 'user-agent'
|
|
1908
|
-
];
|
|
1909
|
-
|
|
1910
|
-
/**
|
|
1911
|
-
* Parse headers into an object
|
|
1912
|
-
*
|
|
1913
|
-
* ```
|
|
1914
|
-
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
1915
|
-
* Content-Type: application/json
|
|
1916
|
-
* Connection: keep-alive
|
|
1917
|
-
* Transfer-Encoding: chunked
|
|
1918
|
-
* ```
|
|
1919
|
-
*
|
|
1920
|
-
* @param {String} headers Headers needing to be parsed
|
|
1921
|
-
* @returns {Object} Headers parsed into an object
|
|
1922
|
-
*/
|
|
1923
|
-
var parseHeaders = function parseHeaders(headers) {
|
|
1924
|
-
var parsed = {};
|
|
1925
|
-
var key;
|
|
1926
|
-
var val;
|
|
1927
|
-
var i;
|
|
1928
|
-
|
|
1929
|
-
if (!headers) { return parsed; }
|
|
1930
|
-
|
|
1931
|
-
utils.forEach(headers.split('\n'), function parser(line) {
|
|
1932
|
-
i = line.indexOf(':');
|
|
1933
|
-
key = utils.trim(line.substr(0, i)).toLowerCase();
|
|
1934
|
-
val = utils.trim(line.substr(i + 1));
|
|
1935
|
-
|
|
1936
|
-
if (key) {
|
|
1937
|
-
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
|
1938
|
-
return;
|
|
1939
|
-
}
|
|
1940
|
-
if (key === 'set-cookie') {
|
|
1941
|
-
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
1942
|
-
} else {
|
|
1943
|
-
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
});
|
|
1947
|
-
|
|
1948
|
-
return parsed;
|
|
1949
|
-
};
|
|
1950
|
-
|
|
1951
|
-
var isURLSameOrigin = (
|
|
1952
|
-
utils.isStandardBrowserEnv() ?
|
|
1953
|
-
|
|
1954
|
-
// Standard browser envs have full support of the APIs needed to test
|
|
1955
|
-
// whether the request URL is of the same origin as current location.
|
|
1956
|
-
(function standardBrowserEnv() {
|
|
1957
|
-
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
1958
|
-
var urlParsingNode = document.createElement('a');
|
|
1959
|
-
var originURL;
|
|
1960
|
-
|
|
1961
|
-
/**
|
|
1962
|
-
* Parse a URL to discover it's components
|
|
1963
|
-
*
|
|
1964
|
-
* @param {String} url The URL to be parsed
|
|
1965
|
-
* @returns {Object}
|
|
1966
|
-
*/
|
|
1967
|
-
function resolveURL(url) {
|
|
1968
|
-
var href = url;
|
|
1969
|
-
|
|
1970
|
-
if (msie) {
|
|
1971
|
-
// IE needs attribute set twice to normalize properties
|
|
1972
|
-
urlParsingNode.setAttribute('href', href);
|
|
1973
|
-
href = urlParsingNode.href;
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
urlParsingNode.setAttribute('href', href);
|
|
1977
|
-
|
|
1978
|
-
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
|
1979
|
-
return {
|
|
1980
|
-
href: urlParsingNode.href,
|
|
1981
|
-
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
|
1982
|
-
host: urlParsingNode.host,
|
|
1983
|
-
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
|
1984
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
|
1985
|
-
hostname: urlParsingNode.hostname,
|
|
1986
|
-
port: urlParsingNode.port,
|
|
1987
|
-
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
|
1988
|
-
urlParsingNode.pathname :
|
|
1989
|
-
'/' + urlParsingNode.pathname
|
|
1990
|
-
};
|
|
1991
|
-
}
|
|
1992
|
-
|
|
1993
|
-
originURL = resolveURL(window.location.href);
|
|
1994
|
-
|
|
1995
|
-
/**
|
|
1996
|
-
* Determine if a URL shares the same origin as the current location
|
|
1997
|
-
*
|
|
1998
|
-
* @param {String} requestURL The URL to test
|
|
1999
|
-
* @returns {boolean} True if URL shares the same origin, otherwise false
|
|
2000
|
-
*/
|
|
2001
|
-
return function isURLSameOrigin(requestURL) {
|
|
2002
|
-
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
|
2003
|
-
return (parsed.protocol === originURL.protocol &&
|
|
2004
|
-
parsed.host === originURL.host);
|
|
2005
|
-
};
|
|
2006
|
-
})() :
|
|
2007
|
-
|
|
2008
|
-
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
2009
|
-
(function nonStandardBrowserEnv() {
|
|
2010
|
-
return function isURLSameOrigin() {
|
|
2011
|
-
return true;
|
|
2012
|
-
};
|
|
2013
|
-
})()
|
|
2014
|
-
);
|
|
2015
|
-
|
|
2016
|
-
var global$1 = (typeof global !== "undefined" ? global :
|
|
2017
|
-
typeof self !== "undefined" ? self :
|
|
2018
|
-
typeof window !== "undefined" ? window : {});
|
|
2019
|
-
|
|
2020
|
-
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
/** Highest positive signed 32-bit float value */
|
|
2024
|
-
var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
|
|
2025
|
-
|
|
2026
|
-
/** Bootstring parameters */
|
|
2027
|
-
var base = 36;
|
|
2028
|
-
var tMin = 1;
|
|
2029
|
-
var tMax = 26;
|
|
2030
|
-
var skew = 38;
|
|
2031
|
-
var damp = 700;
|
|
2032
|
-
var initialBias = 72;
|
|
2033
|
-
var initialN = 128; // 0x80
|
|
2034
|
-
var delimiter = '-'; // '\x2D'
|
|
2035
|
-
var regexNonASCII = /[^\x20-\x7E]/; // unprintable ASCII chars + non-ASCII chars
|
|
2036
|
-
var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
|
|
2037
|
-
|
|
2038
|
-
/** Error messages */
|
|
2039
|
-
var errors = {
|
|
2040
|
-
'overflow': 'Overflow: input needs wider integers to process',
|
|
2041
|
-
'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
|
|
2042
|
-
'invalid-input': 'Invalid input'
|
|
2043
|
-
};
|
|
2044
|
-
|
|
2045
|
-
/** Convenience shortcuts */
|
|
2046
|
-
var baseMinusTMin = base - tMin;
|
|
2047
|
-
var floor = Math.floor;
|
|
2048
|
-
var stringFromCharCode = String.fromCharCode;
|
|
2049
|
-
|
|
2050
|
-
/*--------------------------------------------------------------------------*/
|
|
2051
|
-
|
|
2052
|
-
/**
|
|
2053
|
-
* A generic error utility function.
|
|
2054
|
-
* @private
|
|
2055
|
-
* @param {String} type The error type.
|
|
2056
|
-
* @returns {Error} Throws a `RangeError` with the applicable error message.
|
|
228
|
+
* web workers:
|
|
229
|
+
* typeof window -> undefined
|
|
230
|
+
* typeof document -> undefined
|
|
231
|
+
*
|
|
232
|
+
* react-native:
|
|
233
|
+
* navigator.product -> 'ReactNative'
|
|
234
|
+
* nativescript
|
|
235
|
+
* navigator.product -> 'NativeScript' or 'NS'
|
|
2057
236
|
*/
|
|
2058
|
-
function
|
|
2059
|
-
|
|
237
|
+
function isStandardBrowserEnv() {
|
|
238
|
+
if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
|
|
239
|
+
navigator.product === 'NativeScript' ||
|
|
240
|
+
navigator.product === 'NS')) {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
return (
|
|
244
|
+
typeof window !== 'undefined' &&
|
|
245
|
+
typeof document !== 'undefined'
|
|
246
|
+
);
|
|
2060
247
|
}
|
|
2061
248
|
|
|
2062
249
|
/**
|
|
2063
|
-
*
|
|
2064
|
-
*
|
|
2065
|
-
*
|
|
2066
|
-
*
|
|
2067
|
-
*
|
|
2068
|
-
*
|
|
250
|
+
* Iterate over an Array or an Object invoking a function for each item.
|
|
251
|
+
*
|
|
252
|
+
* If `obj` is an Array callback will be called passing
|
|
253
|
+
* the value, index, and complete array for each item.
|
|
254
|
+
*
|
|
255
|
+
* If 'obj' is an Object callback will be called passing
|
|
256
|
+
* the value, key, and complete object for each property.
|
|
257
|
+
*
|
|
258
|
+
* @param {Object|Array} obj The object to iterate
|
|
259
|
+
* @param {Function} fn The callback to invoke for each item
|
|
2069
260
|
*/
|
|
2070
|
-
function
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
result[length] = fn(array[length]);
|
|
261
|
+
function forEach(obj, fn) {
|
|
262
|
+
// Don't bother if no value provided
|
|
263
|
+
if (obj === null || typeof obj === 'undefined') {
|
|
264
|
+
return;
|
|
2075
265
|
}
|
|
2076
|
-
return result;
|
|
2077
|
-
}
|
|
2078
266
|
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
267
|
+
// Force an array if not already something iterable
|
|
268
|
+
if (typeof obj !== 'object') {
|
|
269
|
+
/*eslint no-param-reassign:0*/
|
|
270
|
+
obj = [obj];
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (isArray(obj)) {
|
|
274
|
+
// Iterate over array values
|
|
275
|
+
for (var i = 0, l = obj.length; i < l; i++) {
|
|
276
|
+
fn.call(null, obj[i], i, obj);
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
// Iterate over object keys
|
|
280
|
+
for (var key in obj) {
|
|
281
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
282
|
+
fn.call(null, obj[key], key, obj);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
2097
285
|
}
|
|
2098
|
-
// Avoid `split(regex)` for IE8 compatibility. See #17.
|
|
2099
|
-
string = string.replace(regexSeparators, '\x2E');
|
|
2100
|
-
var labels = string.split('.');
|
|
2101
|
-
var encoded = map$1(labels, fn).join('.');
|
|
2102
|
-
return result + encoded;
|
|
2103
286
|
}
|
|
2104
287
|
|
|
2105
288
|
/**
|
|
2106
|
-
*
|
|
2107
|
-
*
|
|
2108
|
-
*
|
|
2109
|
-
*
|
|
2110
|
-
*
|
|
2111
|
-
*
|
|
2112
|
-
*
|
|
2113
|
-
*
|
|
2114
|
-
*
|
|
2115
|
-
*
|
|
2116
|
-
*
|
|
289
|
+
* Accepts varargs expecting each argument to be an object, then
|
|
290
|
+
* immutably merges the properties of each object and returns result.
|
|
291
|
+
*
|
|
292
|
+
* When multiple objects contain the same key the later object in
|
|
293
|
+
* the arguments list will take precedence.
|
|
294
|
+
*
|
|
295
|
+
* Example:
|
|
296
|
+
*
|
|
297
|
+
* ```js
|
|
298
|
+
* var result = merge({foo: 123}, {foo: 456});
|
|
299
|
+
* console.log(result.foo); // outputs 456
|
|
300
|
+
* ```
|
|
301
|
+
*
|
|
302
|
+
* @param {Object} obj1 Object to merge
|
|
303
|
+
* @returns {Object} Result of all merge properties
|
|
2117
304
|
*/
|
|
2118
|
-
function
|
|
2119
|
-
var
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
// high surrogate, and there is a next character
|
|
2128
|
-
extra = string.charCodeAt(counter++);
|
|
2129
|
-
if ((extra & 0xFC00) == 0xDC00) { // low surrogate
|
|
2130
|
-
output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
|
2131
|
-
} else {
|
|
2132
|
-
// unmatched surrogate; only append this code unit, in case the next
|
|
2133
|
-
// code unit is the high surrogate of a surrogate pair
|
|
2134
|
-
output.push(value);
|
|
2135
|
-
counter--;
|
|
2136
|
-
}
|
|
305
|
+
function merge(/* obj1, obj2, obj3, ... */) {
|
|
306
|
+
var result = {};
|
|
307
|
+
function assignValue(val, key) {
|
|
308
|
+
if (isPlainObject(result[key]) && isPlainObject(val)) {
|
|
309
|
+
result[key] = merge(result[key], val);
|
|
310
|
+
} else if (isPlainObject(val)) {
|
|
311
|
+
result[key] = merge({}, val);
|
|
312
|
+
} else if (isArray(val)) {
|
|
313
|
+
result[key] = val.slice();
|
|
2137
314
|
} else {
|
|
2138
|
-
|
|
315
|
+
result[key] = val;
|
|
2139
316
|
}
|
|
2140
317
|
}
|
|
2141
|
-
|
|
318
|
+
|
|
319
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
320
|
+
forEach(arguments[i], assignValue);
|
|
321
|
+
}
|
|
322
|
+
return result;
|
|
2142
323
|
}
|
|
2143
324
|
|
|
2144
325
|
/**
|
|
2145
|
-
*
|
|
2146
|
-
*
|
|
2147
|
-
* @
|
|
2148
|
-
* @param {
|
|
2149
|
-
* @
|
|
2150
|
-
*
|
|
2151
|
-
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
|
|
2152
|
-
* used; else, the lowercase form is used. The behavior is undefined
|
|
2153
|
-
* if `flag` is non-zero and `digit` has no uppercase form.
|
|
326
|
+
* Extends object a by mutably adding to it the properties of object b.
|
|
327
|
+
*
|
|
328
|
+
* @param {Object} a The object to be extended
|
|
329
|
+
* @param {Object} b The object to copy properties from
|
|
330
|
+
* @param {Object} thisArg The object to bind function to
|
|
331
|
+
* @return {Object} The resulting value of object a
|
|
2154
332
|
*/
|
|
2155
|
-
function
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
333
|
+
function extend(a, b, thisArg) {
|
|
334
|
+
forEach(b, function assignValue(val, key) {
|
|
335
|
+
if (thisArg && typeof val === 'function') {
|
|
336
|
+
a[key] = bind(val, thisArg);
|
|
337
|
+
} else {
|
|
338
|
+
a[key] = val;
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
return a;
|
|
2159
342
|
}
|
|
2160
343
|
|
|
2161
344
|
/**
|
|
2162
|
-
*
|
|
2163
|
-
*
|
|
2164
|
-
* @
|
|
345
|
+
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
|
|
346
|
+
*
|
|
347
|
+
* @param {string} content with BOM
|
|
348
|
+
* @return {string} content value without BOM
|
|
2165
349
|
*/
|
|
2166
|
-
function
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
delta += floor(delta / numPoints);
|
|
2170
|
-
for ( /* no initialization */ ; delta > baseMinusTMin * tMax >> 1; k += base) {
|
|
2171
|
-
delta = floor(delta / baseMinusTMin);
|
|
350
|
+
function stripBOM(content) {
|
|
351
|
+
if (content.charCodeAt(0) === 0xFEFF) {
|
|
352
|
+
content = content.slice(1);
|
|
2172
353
|
}
|
|
2173
|
-
return
|
|
354
|
+
return content;
|
|
2174
355
|
}
|
|
2175
356
|
|
|
2176
357
|
/**
|
|
2177
|
-
*
|
|
2178
|
-
*
|
|
2179
|
-
* @
|
|
2180
|
-
* @param {
|
|
2181
|
-
* @
|
|
358
|
+
* Inherit the prototype methods from one constructor into another
|
|
359
|
+
* @param {function} constructor
|
|
360
|
+
* @param {function} superConstructor
|
|
361
|
+
* @param {object} [props]
|
|
362
|
+
* @param {object} [descriptors]
|
|
2182
363
|
*/
|
|
2183
|
-
function encode(input) {
|
|
2184
|
-
var n,
|
|
2185
|
-
delta,
|
|
2186
|
-
handledCPCount,
|
|
2187
|
-
basicLength,
|
|
2188
|
-
bias,
|
|
2189
|
-
j,
|
|
2190
|
-
m,
|
|
2191
|
-
q,
|
|
2192
|
-
k,
|
|
2193
|
-
t,
|
|
2194
|
-
currentValue,
|
|
2195
|
-
output = [],
|
|
2196
|
-
/** `inputLength` will hold the number of code points in `input`. */
|
|
2197
|
-
inputLength,
|
|
2198
|
-
/** Cached calculation results */
|
|
2199
|
-
handledCPCountPlusOne,
|
|
2200
|
-
baseMinusT,
|
|
2201
|
-
qMinusT;
|
|
2202
|
-
|
|
2203
|
-
// Convert the input in UCS-2 to Unicode
|
|
2204
|
-
input = ucs2decode(input);
|
|
2205
|
-
|
|
2206
|
-
// Cache the length
|
|
2207
|
-
inputLength = input.length;
|
|
2208
|
-
|
|
2209
|
-
// Initialize the state
|
|
2210
|
-
n = initialN;
|
|
2211
|
-
delta = 0;
|
|
2212
|
-
bias = initialBias;
|
|
2213
|
-
|
|
2214
|
-
// Handle the basic code points
|
|
2215
|
-
for (j = 0; j < inputLength; ++j) {
|
|
2216
|
-
currentValue = input[j];
|
|
2217
|
-
if (currentValue < 0x80) {
|
|
2218
|
-
output.push(stringFromCharCode(currentValue));
|
|
2219
|
-
}
|
|
2220
|
-
}
|
|
2221
|
-
|
|
2222
|
-
handledCPCount = basicLength = output.length;
|
|
2223
|
-
|
|
2224
|
-
// `handledCPCount` is the number of code points that have been handled;
|
|
2225
|
-
// `basicLength` is the number of basic code points.
|
|
2226
|
-
|
|
2227
|
-
// Finish the basic string - if it is not empty - with a delimiter
|
|
2228
|
-
if (basicLength) {
|
|
2229
|
-
output.push(delimiter);
|
|
2230
|
-
}
|
|
2231
|
-
|
|
2232
|
-
// Main encoding loop:
|
|
2233
|
-
while (handledCPCount < inputLength) {
|
|
2234
|
-
|
|
2235
|
-
// All non-basic code points < n have been handled already. Find the next
|
|
2236
|
-
// larger one:
|
|
2237
|
-
for (m = maxInt, j = 0; j < inputLength; ++j) {
|
|
2238
|
-
currentValue = input[j];
|
|
2239
|
-
if (currentValue >= n && currentValue < m) {
|
|
2240
|
-
m = currentValue;
|
|
2241
|
-
}
|
|
2242
|
-
}
|
|
2243
|
-
|
|
2244
|
-
// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
|
|
2245
|
-
// but guard against overflow
|
|
2246
|
-
handledCPCountPlusOne = handledCPCount + 1;
|
|
2247
|
-
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
|
2248
|
-
error('overflow');
|
|
2249
|
-
}
|
|
2250
364
|
|
|
2251
|
-
|
|
2252
|
-
|
|
365
|
+
function inherits(constructor, superConstructor, props, descriptors) {
|
|
366
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
367
|
+
constructor.prototype.constructor = constructor;
|
|
368
|
+
props && Object.assign(constructor.prototype, props);
|
|
369
|
+
}
|
|
2253
370
|
|
|
2254
|
-
|
|
2255
|
-
|
|
371
|
+
/**
|
|
372
|
+
* Resolve object with deep prototype chain to a flat object
|
|
373
|
+
* @param {Object} sourceObj source object
|
|
374
|
+
* @param {Object} [destObj]
|
|
375
|
+
* @param {Function} [filter]
|
|
376
|
+
* @returns {Object}
|
|
377
|
+
*/
|
|
2256
378
|
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
379
|
+
function toFlatObject(sourceObj, destObj, filter) {
|
|
380
|
+
var props;
|
|
381
|
+
var i;
|
|
382
|
+
var prop;
|
|
383
|
+
var merged = {};
|
|
2260
384
|
|
|
2261
|
-
|
|
2262
|
-
// Represent delta as a generalized variable-length integer
|
|
2263
|
-
for (q = delta, k = base; /* no condition */ ; k += base) {
|
|
2264
|
-
t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
|
2265
|
-
if (q < t) {
|
|
2266
|
-
break;
|
|
2267
|
-
}
|
|
2268
|
-
qMinusT = q - t;
|
|
2269
|
-
baseMinusT = base - t;
|
|
2270
|
-
output.push(
|
|
2271
|
-
stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
|
|
2272
|
-
);
|
|
2273
|
-
q = floor(qMinusT / baseMinusT);
|
|
2274
|
-
}
|
|
385
|
+
destObj = destObj || {};
|
|
2275
386
|
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
387
|
+
do {
|
|
388
|
+
props = Object.getOwnPropertyNames(sourceObj);
|
|
389
|
+
i = props.length;
|
|
390
|
+
while (i-- > 0) {
|
|
391
|
+
prop = props[i];
|
|
392
|
+
if (!merged[prop]) {
|
|
393
|
+
destObj[prop] = sourceObj[prop];
|
|
394
|
+
merged[prop] = true;
|
|
2280
395
|
}
|
|
2281
396
|
}
|
|
397
|
+
sourceObj = Object.getPrototypeOf(sourceObj);
|
|
398
|
+
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
2282
399
|
|
|
2283
|
-
|
|
2284
|
-
++n;
|
|
2285
|
-
|
|
2286
|
-
}
|
|
2287
|
-
return output.join('');
|
|
400
|
+
return destObj;
|
|
2288
401
|
}
|
|
2289
402
|
|
|
2290
|
-
|
|
2291
|
-
*
|
|
2292
|
-
*
|
|
2293
|
-
*
|
|
2294
|
-
*
|
|
2295
|
-
* @
|
|
2296
|
-
* @param {String} input The domain name or email address to convert, as a
|
|
2297
|
-
* Unicode string.
|
|
2298
|
-
* @returns {String} The Punycode representation of the given domain name or
|
|
2299
|
-
* email address.
|
|
403
|
+
/*
|
|
404
|
+
* determines whether a string ends with the characters of a specified string
|
|
405
|
+
* @param {String} str
|
|
406
|
+
* @param {String} searchString
|
|
407
|
+
* @param {Number} [position= 0]
|
|
408
|
+
* @returns {boolean}
|
|
2300
409
|
*/
|
|
2301
|
-
function
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
function isNull(arg) {
|
|
2310
|
-
return arg === null;
|
|
410
|
+
function endsWith(str, searchString, position) {
|
|
411
|
+
str = String(str);
|
|
412
|
+
if (position === undefined || position > str.length) {
|
|
413
|
+
position = str.length;
|
|
414
|
+
}
|
|
415
|
+
position -= searchString.length;
|
|
416
|
+
var lastIndex = str.indexOf(searchString, position);
|
|
417
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
2311
418
|
}
|
|
2312
419
|
|
|
2313
|
-
function isNullOrUndefined(arg) {
|
|
2314
|
-
return arg == null;
|
|
2315
|
-
}
|
|
2316
420
|
|
|
2317
|
-
|
|
2318
|
-
|
|
421
|
+
/**
|
|
422
|
+
* Returns new array from array like object
|
|
423
|
+
* @param {*} [thing]
|
|
424
|
+
* @returns {Array}
|
|
425
|
+
*/
|
|
426
|
+
function toArray(thing) {
|
|
427
|
+
if (!thing) return null;
|
|
428
|
+
var i = thing.length;
|
|
429
|
+
if (isUndefined(i)) return null;
|
|
430
|
+
var arr = new Array(i);
|
|
431
|
+
while (i-- > 0) {
|
|
432
|
+
arr[i] = thing[i];
|
|
433
|
+
}
|
|
434
|
+
return arr;
|
|
2319
435
|
}
|
|
2320
436
|
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
437
|
+
// eslint-disable-next-line func-names
|
|
438
|
+
var isTypedArray = (function(TypedArray) {
|
|
439
|
+
// eslint-disable-next-line func-names
|
|
440
|
+
return function(thing) {
|
|
441
|
+
return TypedArray && thing instanceof TypedArray;
|
|
442
|
+
};
|
|
443
|
+
})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
|
|
2324
444
|
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
445
|
+
var utils = {
|
|
446
|
+
isArray: isArray,
|
|
447
|
+
isArrayBuffer: isArrayBuffer,
|
|
448
|
+
isBuffer: isBuffer,
|
|
449
|
+
isFormData: isFormData,
|
|
450
|
+
isArrayBufferView: isArrayBufferView,
|
|
451
|
+
isString: isString,
|
|
452
|
+
isNumber: isNumber,
|
|
453
|
+
isObject: isObject,
|
|
454
|
+
isPlainObject: isPlainObject,
|
|
455
|
+
isUndefined: isUndefined,
|
|
456
|
+
isDate: isDate,
|
|
457
|
+
isFile: isFile,
|
|
458
|
+
isBlob: isBlob,
|
|
459
|
+
isFunction: isFunction,
|
|
460
|
+
isStream: isStream,
|
|
461
|
+
isURLSearchParams: isURLSearchParams,
|
|
462
|
+
isStandardBrowserEnv: isStandardBrowserEnv,
|
|
463
|
+
forEach: forEach,
|
|
464
|
+
merge: merge,
|
|
465
|
+
extend: extend,
|
|
466
|
+
trim: trim,
|
|
467
|
+
stripBOM: stripBOM,
|
|
468
|
+
inherits: inherits,
|
|
469
|
+
toFlatObject: toFlatObject,
|
|
470
|
+
kindOf: kindOf,
|
|
471
|
+
kindOfTest: kindOfTest,
|
|
472
|
+
endsWith: endsWith,
|
|
473
|
+
toArray: toArray,
|
|
474
|
+
isTypedArray: isTypedArray,
|
|
475
|
+
isFileList: isFileList
|
|
2355
476
|
};
|
|
2356
|
-
function stringifyPrimitive(v) {
|
|
2357
|
-
switch (typeof v) {
|
|
2358
|
-
case 'string':
|
|
2359
|
-
return v;
|
|
2360
477
|
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
478
|
+
function encode(val) {
|
|
479
|
+
return encodeURIComponent(val).
|
|
480
|
+
replace(/%3A/gi, ':').
|
|
481
|
+
replace(/%24/g, '$').
|
|
482
|
+
replace(/%2C/gi, ',').
|
|
483
|
+
replace(/%20/g, '+').
|
|
484
|
+
replace(/%5B/gi, '[').
|
|
485
|
+
replace(/%5D/gi, ']');
|
|
486
|
+
}
|
|
2366
487
|
|
|
2367
|
-
|
|
2368
|
-
|
|
488
|
+
/**
|
|
489
|
+
* Build a URL by appending params to the end
|
|
490
|
+
*
|
|
491
|
+
* @param {string} url The base of the url (e.g., http://www.google.com)
|
|
492
|
+
* @param {object} [params] The params to be appended
|
|
493
|
+
* @returns {string} The formatted url
|
|
494
|
+
*/
|
|
495
|
+
var buildURL = function buildURL(url, params, paramsSerializer) {
|
|
496
|
+
/*eslint no-param-reassign:0*/
|
|
497
|
+
if (!params) {
|
|
498
|
+
return url;
|
|
2369
499
|
}
|
|
2370
|
-
}
|
|
2371
500
|
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
if (
|
|
2376
|
-
|
|
2377
|
-
}
|
|
501
|
+
var serializedParams;
|
|
502
|
+
if (paramsSerializer) {
|
|
503
|
+
serializedParams = paramsSerializer(params);
|
|
504
|
+
} else if (utils.isURLSearchParams(params)) {
|
|
505
|
+
serializedParams = params.toString();
|
|
506
|
+
} else {
|
|
507
|
+
var parts = [];
|
|
508
|
+
|
|
509
|
+
utils.forEach(params, function serialize(val, key) {
|
|
510
|
+
if (val === null || typeof val === 'undefined') {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
2378
513
|
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
|
|
2382
|
-
if (isArray(obj[k])) {
|
|
2383
|
-
return map(obj[k], function(v) {
|
|
2384
|
-
return ks + encodeURIComponent(stringifyPrimitive(v));
|
|
2385
|
-
}).join(sep);
|
|
514
|
+
if (utils.isArray(val)) {
|
|
515
|
+
key = key + '[]';
|
|
2386
516
|
} else {
|
|
2387
|
-
|
|
517
|
+
val = [val];
|
|
2388
518
|
}
|
|
2389
|
-
}).join(sep);
|
|
2390
519
|
|
|
2391
|
-
|
|
520
|
+
utils.forEach(val, function parseValue(v) {
|
|
521
|
+
if (utils.isDate(v)) {
|
|
522
|
+
v = v.toISOString();
|
|
523
|
+
} else if (utils.isObject(v)) {
|
|
524
|
+
v = JSON.stringify(v);
|
|
525
|
+
}
|
|
526
|
+
parts.push(encode(key) + '=' + encode(v));
|
|
527
|
+
});
|
|
528
|
+
});
|
|
2392
529
|
|
|
2393
|
-
|
|
2394
|
-
return encodeURIComponent(stringifyPrimitive(name)) + eq +
|
|
2395
|
-
encodeURIComponent(stringifyPrimitive(obj));
|
|
2396
|
-
}
|
|
2397
|
-
function map (xs, f) {
|
|
2398
|
-
if (xs.map) return xs.map(f);
|
|
2399
|
-
var res = [];
|
|
2400
|
-
for (var i = 0; i < xs.length; i++) {
|
|
2401
|
-
res.push(f(xs[i], i));
|
|
530
|
+
serializedParams = parts.join('&');
|
|
2402
531
|
}
|
|
2403
|
-
return res;
|
|
2404
|
-
}
|
|
2405
532
|
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
533
|
+
if (serializedParams) {
|
|
534
|
+
var hashmarkIndex = url.indexOf('#');
|
|
535
|
+
if (hashmarkIndex !== -1) {
|
|
536
|
+
url = url.slice(0, hashmarkIndex);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
|
2410
540
|
}
|
|
2411
|
-
return res;
|
|
2412
|
-
};
|
|
2413
541
|
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
eq = eq || '=';
|
|
2417
|
-
var obj = {};
|
|
542
|
+
return url;
|
|
543
|
+
};
|
|
2418
544
|
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
545
|
+
function InterceptorManager() {
|
|
546
|
+
this.handlers = [];
|
|
547
|
+
}
|
|
2422
548
|
|
|
2423
|
-
|
|
2424
|
-
|
|
549
|
+
/**
|
|
550
|
+
* Add a new interceptor to the stack
|
|
551
|
+
*
|
|
552
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
553
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
554
|
+
*
|
|
555
|
+
* @return {Number} An ID used to remove interceptor later
|
|
556
|
+
*/
|
|
557
|
+
InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
|
|
558
|
+
this.handlers.push({
|
|
559
|
+
fulfilled: fulfilled,
|
|
560
|
+
rejected: rejected,
|
|
561
|
+
synchronous: options ? options.synchronous : false,
|
|
562
|
+
runWhen: options ? options.runWhen : null
|
|
563
|
+
});
|
|
564
|
+
return this.handlers.length - 1;
|
|
565
|
+
};
|
|
2425
566
|
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
567
|
+
/**
|
|
568
|
+
* Remove an interceptor from the stack
|
|
569
|
+
*
|
|
570
|
+
* @param {Number} id The ID that was returned by `use`
|
|
571
|
+
*/
|
|
572
|
+
InterceptorManager.prototype.eject = function eject(id) {
|
|
573
|
+
if (this.handlers[id]) {
|
|
574
|
+
this.handlers[id] = null;
|
|
2429
575
|
}
|
|
576
|
+
};
|
|
2430
577
|
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
578
|
+
/**
|
|
579
|
+
* Iterate over all the registered interceptors
|
|
580
|
+
*
|
|
581
|
+
* This method is particularly useful for skipping over any
|
|
582
|
+
* interceptors that may have become `null` calling `eject`.
|
|
583
|
+
*
|
|
584
|
+
* @param {Function} fn The function to call for each interceptor
|
|
585
|
+
*/
|
|
586
|
+
InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
587
|
+
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
588
|
+
if (h !== null) {
|
|
589
|
+
fn(h);
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
};
|
|
2436
593
|
|
|
2437
|
-
|
|
2438
|
-
var x = qs[i].replace(regexp, '%20'),
|
|
2439
|
-
idx = x.indexOf(eq),
|
|
2440
|
-
kstr, vstr, k, v;
|
|
594
|
+
var InterceptorManager_1 = InterceptorManager;
|
|
2441
595
|
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
vstr = '';
|
|
596
|
+
var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
|
|
597
|
+
utils.forEach(headers, function processHeader(value, name) {
|
|
598
|
+
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
|
599
|
+
headers[normalizedName] = value;
|
|
600
|
+
delete headers[name];
|
|
2448
601
|
}
|
|
602
|
+
});
|
|
603
|
+
};
|
|
2449
604
|
|
|
2450
|
-
|
|
2451
|
-
|
|
605
|
+
/**
|
|
606
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
607
|
+
*
|
|
608
|
+
* @param {string} message The error message.
|
|
609
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
610
|
+
* @param {Object} [config] The config.
|
|
611
|
+
* @param {Object} [request] The request.
|
|
612
|
+
* @param {Object} [response] The response.
|
|
613
|
+
* @returns {Error} The created error.
|
|
614
|
+
*/
|
|
615
|
+
function AxiosError(message, code, config, request, response) {
|
|
616
|
+
Error.call(this);
|
|
617
|
+
this.message = message;
|
|
618
|
+
this.name = 'AxiosError';
|
|
619
|
+
code && (this.code = code);
|
|
620
|
+
config && (this.config = config);
|
|
621
|
+
request && (this.request = request);
|
|
622
|
+
response && (this.response = response);
|
|
623
|
+
}
|
|
2452
624
|
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
625
|
+
utils.inherits(AxiosError, Error, {
|
|
626
|
+
toJSON: function toJSON() {
|
|
627
|
+
return {
|
|
628
|
+
// Standard
|
|
629
|
+
message: this.message,
|
|
630
|
+
name: this.name,
|
|
631
|
+
// Microsoft
|
|
632
|
+
description: this.description,
|
|
633
|
+
number: this.number,
|
|
634
|
+
// Mozilla
|
|
635
|
+
fileName: this.fileName,
|
|
636
|
+
lineNumber: this.lineNumber,
|
|
637
|
+
columnNumber: this.columnNumber,
|
|
638
|
+
stack: this.stack,
|
|
639
|
+
// Axios
|
|
640
|
+
config: this.config,
|
|
641
|
+
code: this.code,
|
|
642
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
643
|
+
};
|
|
2460
644
|
}
|
|
645
|
+
});
|
|
2461
646
|
|
|
2462
|
-
|
|
2463
|
-
}
|
|
647
|
+
var prototype = AxiosError.prototype;
|
|
648
|
+
var descriptors = {};
|
|
2464
649
|
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
};
|
|
2480
|
-
function Url() {
|
|
2481
|
-
this.protocol = null;
|
|
2482
|
-
this.slashes = null;
|
|
2483
|
-
this.auth = null;
|
|
2484
|
-
this.host = null;
|
|
2485
|
-
this.port = null;
|
|
2486
|
-
this.hostname = null;
|
|
2487
|
-
this.hash = null;
|
|
2488
|
-
this.search = null;
|
|
2489
|
-
this.query = null;
|
|
2490
|
-
this.pathname = null;
|
|
2491
|
-
this.path = null;
|
|
2492
|
-
this.href = null;
|
|
2493
|
-
}
|
|
650
|
+
[
|
|
651
|
+
'ERR_BAD_OPTION_VALUE',
|
|
652
|
+
'ERR_BAD_OPTION',
|
|
653
|
+
'ECONNABORTED',
|
|
654
|
+
'ETIMEDOUT',
|
|
655
|
+
'ERR_NETWORK',
|
|
656
|
+
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
657
|
+
'ERR_DEPRECATED',
|
|
658
|
+
'ERR_BAD_RESPONSE',
|
|
659
|
+
'ERR_BAD_REQUEST',
|
|
660
|
+
'ERR_CANCELED'
|
|
661
|
+
// eslint-disable-next-line func-names
|
|
662
|
+
].forEach(function(code) {
|
|
663
|
+
descriptors[code] = {value: code};
|
|
664
|
+
});
|
|
2494
665
|
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
// define these here so at least they only have to be
|
|
2498
|
-
// compiled once on the first module load.
|
|
2499
|
-
var protocolPattern = /^([a-z0-9.+-]+:)/i,
|
|
2500
|
-
portPattern = /:[0-9]*$/,
|
|
2501
|
-
|
|
2502
|
-
// Special case for a simple path URL
|
|
2503
|
-
simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
|
|
2504
|
-
|
|
2505
|
-
// RFC 2396: characters reserved for delimiting URLs.
|
|
2506
|
-
// We actually just auto-escape these.
|
|
2507
|
-
delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
|
|
2508
|
-
|
|
2509
|
-
// RFC 2396: characters not allowed for various reasons.
|
|
2510
|
-
unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims),
|
|
2511
|
-
|
|
2512
|
-
// Allowed by RFCs, but cause of XSS attacks. Always escape these.
|
|
2513
|
-
autoEscape = ['\''].concat(unwise),
|
|
2514
|
-
// Characters that are never ever allowed in a hostname.
|
|
2515
|
-
// Note that any invalid chars are also handled, but these
|
|
2516
|
-
// are the ones that are *expected* to be seen, so we fast-path
|
|
2517
|
-
// them.
|
|
2518
|
-
nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),
|
|
2519
|
-
hostEndingChars = ['/', '?', '#'],
|
|
2520
|
-
hostnameMaxLen = 255,
|
|
2521
|
-
hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
|
|
2522
|
-
hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
|
|
2523
|
-
// protocols that can allow "unsafe" and "unwise" chars.
|
|
2524
|
-
unsafeProtocol = {
|
|
2525
|
-
'javascript': true,
|
|
2526
|
-
'javascript:': true
|
|
2527
|
-
},
|
|
2528
|
-
// protocols that never have a hostname.
|
|
2529
|
-
hostlessProtocol = {
|
|
2530
|
-
'javascript': true,
|
|
2531
|
-
'javascript:': true
|
|
2532
|
-
},
|
|
2533
|
-
// protocols that always contain a // bit.
|
|
2534
|
-
slashedProtocol = {
|
|
2535
|
-
'http': true,
|
|
2536
|
-
'https': true,
|
|
2537
|
-
'ftp': true,
|
|
2538
|
-
'gopher': true,
|
|
2539
|
-
'file': true,
|
|
2540
|
-
'http:': true,
|
|
2541
|
-
'https:': true,
|
|
2542
|
-
'ftp:': true,
|
|
2543
|
-
'gopher:': true,
|
|
2544
|
-
'file:': true
|
|
2545
|
-
};
|
|
666
|
+
Object.defineProperties(AxiosError, descriptors);
|
|
667
|
+
Object.defineProperty(prototype, 'isAxiosError', {value: true});
|
|
2546
668
|
|
|
2547
|
-
|
|
2548
|
-
|
|
669
|
+
// eslint-disable-next-line func-names
|
|
670
|
+
AxiosError.from = function(error, code, config, request, response, customProps) {
|
|
671
|
+
var axiosError = Object.create(prototype);
|
|
2549
672
|
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
}
|
|
2554
|
-
Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
|
|
2555
|
-
return parse(this, url, parseQueryString, slashesDenoteHost);
|
|
2556
|
-
};
|
|
673
|
+
utils.toFlatObject(error, axiosError, function filter(obj) {
|
|
674
|
+
return obj !== Error.prototype;
|
|
675
|
+
});
|
|
2557
676
|
|
|
2558
|
-
|
|
2559
|
-
if (!isString(url)) {
|
|
2560
|
-
throw new TypeError('Parameter \'url\' must be a string, not ' + typeof url);
|
|
2561
|
-
}
|
|
677
|
+
AxiosError.call(axiosError, error.message, code, config, request, response);
|
|
2562
678
|
|
|
2563
|
-
|
|
2564
|
-
// Back slashes before the query string get converted to forward slashes
|
|
2565
|
-
// See: https://code.google.com/p/chromium/issues/detail?id=25916
|
|
2566
|
-
var queryIndex = url.indexOf('?'),
|
|
2567
|
-
splitter =
|
|
2568
|
-
(queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',
|
|
2569
|
-
uSplit = url.split(splitter),
|
|
2570
|
-
slashRegex = /\\/g;
|
|
2571
|
-
uSplit[0] = uSplit[0].replace(slashRegex, '/');
|
|
2572
|
-
url = uSplit.join(splitter);
|
|
2573
|
-
|
|
2574
|
-
var rest = url;
|
|
2575
|
-
|
|
2576
|
-
// trim before proceeding.
|
|
2577
|
-
// This is to support parse stuff like " http://foo.com \n"
|
|
2578
|
-
rest = rest.trim();
|
|
2579
|
-
|
|
2580
|
-
if (!slashesDenoteHost && url.split('#').length === 1) {
|
|
2581
|
-
// Try fast path regexp
|
|
2582
|
-
var simplePath = simplePathPattern.exec(rest);
|
|
2583
|
-
if (simplePath) {
|
|
2584
|
-
self.path = rest;
|
|
2585
|
-
self.href = rest;
|
|
2586
|
-
self.pathname = simplePath[1];
|
|
2587
|
-
if (simplePath[2]) {
|
|
2588
|
-
self.search = simplePath[2];
|
|
2589
|
-
if (parseQueryString) {
|
|
2590
|
-
self.query = parse$1(self.search.substr(1));
|
|
2591
|
-
} else {
|
|
2592
|
-
self.query = self.search.substr(1);
|
|
2593
|
-
}
|
|
2594
|
-
} else if (parseQueryString) {
|
|
2595
|
-
self.search = '';
|
|
2596
|
-
self.query = {};
|
|
2597
|
-
}
|
|
2598
|
-
return self;
|
|
2599
|
-
}
|
|
2600
|
-
}
|
|
679
|
+
axiosError.name = error.name;
|
|
2601
680
|
|
|
2602
|
-
|
|
2603
|
-
if (proto) {
|
|
2604
|
-
proto = proto[0];
|
|
2605
|
-
var lowerProto = proto.toLowerCase();
|
|
2606
|
-
self.protocol = lowerProto;
|
|
2607
|
-
rest = rest.substr(proto.length);
|
|
2608
|
-
}
|
|
681
|
+
customProps && Object.assign(axiosError, customProps);
|
|
2609
682
|
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
// resolution will treat //foo/bar as host=foo,path=bar because that's
|
|
2613
|
-
// how the browser resolves relative URLs.
|
|
2614
|
-
if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
|
|
2615
|
-
var slashes = rest.substr(0, 2) === '//';
|
|
2616
|
-
if (slashes && !(proto && hostlessProtocol[proto])) {
|
|
2617
|
-
rest = rest.substr(2);
|
|
2618
|
-
self.slashes = true;
|
|
2619
|
-
}
|
|
2620
|
-
}
|
|
2621
|
-
var i, hec, l, p;
|
|
2622
|
-
if (!hostlessProtocol[proto] &&
|
|
2623
|
-
(slashes || (proto && !slashedProtocol[proto]))) {
|
|
2624
|
-
|
|
2625
|
-
// there's a hostname.
|
|
2626
|
-
// the first instance of /, ?, ;, or # ends the host.
|
|
2627
|
-
//
|
|
2628
|
-
// If there is an @ in the hostname, then non-host chars *are* allowed
|
|
2629
|
-
// to the left of the last @ sign, unless some host-ending character
|
|
2630
|
-
// comes *before* the @-sign.
|
|
2631
|
-
// URLs are obnoxious.
|
|
2632
|
-
//
|
|
2633
|
-
// ex:
|
|
2634
|
-
// http://a@b@c/ => user:a@b host:c
|
|
2635
|
-
// http://a@b?@c => user:a host:c path:/?@c
|
|
2636
|
-
|
|
2637
|
-
// v0.12 TODO(isaacs): This is not quite how Chrome does things.
|
|
2638
|
-
// Review our test case against browsers more comprehensively.
|
|
2639
|
-
|
|
2640
|
-
// find the first instance of any hostEndingChars
|
|
2641
|
-
var hostEnd = -1;
|
|
2642
|
-
for (i = 0; i < hostEndingChars.length; i++) {
|
|
2643
|
-
hec = rest.indexOf(hostEndingChars[i]);
|
|
2644
|
-
if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
|
|
2645
|
-
hostEnd = hec;
|
|
2646
|
-
}
|
|
683
|
+
return axiosError;
|
|
684
|
+
};
|
|
2647
685
|
|
|
2648
|
-
|
|
2649
|
-
// auth portion cannot go past, or the last @ char is the decider.
|
|
2650
|
-
var auth, atSign;
|
|
2651
|
-
if (hostEnd === -1) {
|
|
2652
|
-
// atSign can be anywhere.
|
|
2653
|
-
atSign = rest.lastIndexOf('@');
|
|
2654
|
-
} else {
|
|
2655
|
-
// atSign must be in auth portion.
|
|
2656
|
-
// http://a@b/c@d => host:b auth:a path:/c@d
|
|
2657
|
-
atSign = rest.lastIndexOf('@', hostEnd);
|
|
2658
|
-
}
|
|
686
|
+
var AxiosError_1 = AxiosError;
|
|
2659
687
|
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
688
|
+
var transitional = {
|
|
689
|
+
silentJSONParsing: true,
|
|
690
|
+
forcedJSONParsing: true,
|
|
691
|
+
clarifyTimeoutError: false
|
|
692
|
+
};
|
|
693
|
+
transitional.silentJSONParsing;
|
|
694
|
+
transitional.forcedJSONParsing;
|
|
695
|
+
transitional.clarifyTimeoutError;
|
|
2667
696
|
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
}
|
|
2675
|
-
// if we still have not hit it, then the entire thing is a host.
|
|
2676
|
-
if (hostEnd === -1)
|
|
2677
|
-
hostEnd = rest.length;
|
|
2678
|
-
|
|
2679
|
-
self.host = rest.slice(0, hostEnd);
|
|
2680
|
-
rest = rest.slice(hostEnd);
|
|
2681
|
-
|
|
2682
|
-
// pull out port.
|
|
2683
|
-
parseHost(self);
|
|
2684
|
-
|
|
2685
|
-
// we've indicated that there is a hostname,
|
|
2686
|
-
// so even if it's empty, it has to be present.
|
|
2687
|
-
self.hostname = self.hostname || '';
|
|
2688
|
-
|
|
2689
|
-
// if hostname begins with [ and ends with ]
|
|
2690
|
-
// assume that it's an IPv6 address.
|
|
2691
|
-
var ipv6Hostname = self.hostname[0] === '[' &&
|
|
2692
|
-
self.hostname[self.hostname.length - 1] === ']';
|
|
2693
|
-
|
|
2694
|
-
// validate a little.
|
|
2695
|
-
if (!ipv6Hostname) {
|
|
2696
|
-
var hostparts = self.hostname.split(/\./);
|
|
2697
|
-
for (i = 0, l = hostparts.length; i < l; i++) {
|
|
2698
|
-
var part = hostparts[i];
|
|
2699
|
-
if (!part) continue;
|
|
2700
|
-
if (!part.match(hostnamePartPattern)) {
|
|
2701
|
-
var newpart = '';
|
|
2702
|
-
for (var j = 0, k = part.length; j < k; j++) {
|
|
2703
|
-
if (part.charCodeAt(j) > 127) {
|
|
2704
|
-
// we replace non-ASCII char with a temporary placeholder
|
|
2705
|
-
// we need this to make sure size of hostname is not
|
|
2706
|
-
// broken by replacing non-ASCII by nothing
|
|
2707
|
-
newpart += 'x';
|
|
2708
|
-
} else {
|
|
2709
|
-
newpart += part[j];
|
|
2710
|
-
}
|
|
2711
|
-
}
|
|
2712
|
-
// we test again with ASCII char only
|
|
2713
|
-
if (!newpart.match(hostnamePartPattern)) {
|
|
2714
|
-
var validParts = hostparts.slice(0, i);
|
|
2715
|
-
var notHost = hostparts.slice(i + 1);
|
|
2716
|
-
var bit = part.match(hostnamePartStart);
|
|
2717
|
-
if (bit) {
|
|
2718
|
-
validParts.push(bit[1]);
|
|
2719
|
-
notHost.unshift(bit[2]);
|
|
2720
|
-
}
|
|
2721
|
-
if (notHost.length) {
|
|
2722
|
-
rest = '/' + notHost.join('.') + rest;
|
|
2723
|
-
}
|
|
2724
|
-
self.hostname = validParts.join('.');
|
|
2725
|
-
break;
|
|
2726
|
-
}
|
|
2727
|
-
}
|
|
2728
|
-
}
|
|
2729
|
-
}
|
|
697
|
+
/**
|
|
698
|
+
* Convert a data object to FormData
|
|
699
|
+
* @param {Object} obj
|
|
700
|
+
* @param {?Object} [formData]
|
|
701
|
+
* @returns {Object}
|
|
702
|
+
**/
|
|
2730
703
|
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
// hostnames are always lower case.
|
|
2735
|
-
self.hostname = self.hostname.toLowerCase();
|
|
2736
|
-
}
|
|
704
|
+
function toFormData(obj, formData) {
|
|
705
|
+
// eslint-disable-next-line no-param-reassign
|
|
706
|
+
formData = formData || new FormData();
|
|
2737
707
|
|
|
2738
|
-
|
|
2739
|
-
// IDNA Support: Returns a punycoded representation of "domain".
|
|
2740
|
-
// It only converts parts of the domain name that
|
|
2741
|
-
// have non-ASCII characters, i.e. it doesn't matter if
|
|
2742
|
-
// you call it with a domain that already is ASCII-only.
|
|
2743
|
-
self.hostname = toASCII(self.hostname);
|
|
2744
|
-
}
|
|
708
|
+
var stack = [];
|
|
2745
709
|
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
self.host = h + p;
|
|
2749
|
-
self.href += self.host;
|
|
2750
|
-
|
|
2751
|
-
// strip [ and ] from the hostname
|
|
2752
|
-
// the host field still retains them, though
|
|
2753
|
-
if (ipv6Hostname) {
|
|
2754
|
-
self.hostname = self.hostname.substr(1, self.hostname.length - 2);
|
|
2755
|
-
if (rest[0] !== '/') {
|
|
2756
|
-
rest = '/' + rest;
|
|
2757
|
-
}
|
|
2758
|
-
}
|
|
2759
|
-
}
|
|
710
|
+
function convertValue(value) {
|
|
711
|
+
if (value === null) return '';
|
|
2760
712
|
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
if (!unsafeProtocol[lowerProto]) {
|
|
2764
|
-
|
|
2765
|
-
// First, make 100% sure that any "autoEscape" chars get
|
|
2766
|
-
// escaped, even if encodeURIComponent doesn't think they
|
|
2767
|
-
// need to be.
|
|
2768
|
-
for (i = 0, l = autoEscape.length; i < l; i++) {
|
|
2769
|
-
var ae = autoEscape[i];
|
|
2770
|
-
if (rest.indexOf(ae) === -1)
|
|
2771
|
-
continue;
|
|
2772
|
-
var esc = encodeURIComponent(ae);
|
|
2773
|
-
if (esc === ae) {
|
|
2774
|
-
esc = escape(ae);
|
|
2775
|
-
}
|
|
2776
|
-
rest = rest.split(ae).join(esc);
|
|
713
|
+
if (utils.isDate(value)) {
|
|
714
|
+
return value.toISOString();
|
|
2777
715
|
}
|
|
2778
|
-
}
|
|
2779
|
-
|
|
2780
716
|
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
if (hash !== -1) {
|
|
2784
|
-
// got a fragment string.
|
|
2785
|
-
self.hash = rest.substr(hash);
|
|
2786
|
-
rest = rest.slice(0, hash);
|
|
2787
|
-
}
|
|
2788
|
-
var qm = rest.indexOf('?');
|
|
2789
|
-
if (qm !== -1) {
|
|
2790
|
-
self.search = rest.substr(qm);
|
|
2791
|
-
self.query = rest.substr(qm + 1);
|
|
2792
|
-
if (parseQueryString) {
|
|
2793
|
-
self.query = parse$1(self.query);
|
|
717
|
+
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
|
718
|
+
return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
2794
719
|
}
|
|
2795
|
-
rest = rest.slice(0, qm);
|
|
2796
|
-
} else if (parseQueryString) {
|
|
2797
|
-
// no query string, but parseQueryString still requested
|
|
2798
|
-
self.search = '';
|
|
2799
|
-
self.query = {};
|
|
2800
|
-
}
|
|
2801
|
-
if (rest) self.pathname = rest;
|
|
2802
|
-
if (slashedProtocol[lowerProto] &&
|
|
2803
|
-
self.hostname && !self.pathname) {
|
|
2804
|
-
self.pathname = '/';
|
|
2805
|
-
}
|
|
2806
720
|
|
|
2807
|
-
|
|
2808
|
-
if (self.pathname || self.search) {
|
|
2809
|
-
p = self.pathname || '';
|
|
2810
|
-
var s = self.search || '';
|
|
2811
|
-
self.path = p + s;
|
|
721
|
+
return value;
|
|
2812
722
|
}
|
|
2813
723
|
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
724
|
+
function build(data, parentKey) {
|
|
725
|
+
if (utils.isPlainObject(data) || utils.isArray(data)) {
|
|
726
|
+
if (stack.indexOf(data) !== -1) {
|
|
727
|
+
throw Error('Circular reference detected in ' + parentKey);
|
|
728
|
+
}
|
|
2818
729
|
|
|
2819
|
-
|
|
2820
|
-
if (typeof path === 'string')
|
|
2821
|
-
path = new Url().parse(path);
|
|
2822
|
-
else if (!(path instanceof Url))
|
|
2823
|
-
throw new TypeError('The "path" argument must be of type string or an instance of URL. Received type ' + (typeof path) + String(path));
|
|
2824
|
-
if (path.protocol !== 'file:')
|
|
2825
|
-
throw new TypeError('The URL must be of scheme file');
|
|
2826
|
-
return getPathFromURLPosix(path);
|
|
2827
|
-
}
|
|
730
|
+
stack.push(data);
|
|
2828
731
|
|
|
2829
|
-
function
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
const third = pathname.codePointAt(n + 2) | 0x20;
|
|
2834
|
-
if (pathname[n + 1] === '2' && third === 102) {
|
|
2835
|
-
throw new TypeError(
|
|
2836
|
-
'must not include encoded / characters'
|
|
2837
|
-
);
|
|
2838
|
-
}
|
|
2839
|
-
}
|
|
2840
|
-
}
|
|
2841
|
-
return decodeURIComponent(pathname);
|
|
2842
|
-
}
|
|
732
|
+
utils.forEach(data, function each(value, key) {
|
|
733
|
+
if (utils.isUndefined(value)) return;
|
|
734
|
+
var fullKey = parentKey ? parentKey + '.' + key : key;
|
|
735
|
+
var arr;
|
|
2843
736
|
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
}
|
|
737
|
+
if (value && !parentKey && typeof value === 'object') {
|
|
738
|
+
if (utils.endsWith(key, '{}')) {
|
|
739
|
+
// eslint-disable-next-line no-param-reassign
|
|
740
|
+
value = JSON.stringify(value);
|
|
741
|
+
} else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
|
|
742
|
+
// eslint-disable-next-line func-names
|
|
743
|
+
arr.forEach(function(el) {
|
|
744
|
+
!utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
|
|
745
|
+
});
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
2853
749
|
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
if (auth) {
|
|
2857
|
-
auth = encodeURIComponent(auth);
|
|
2858
|
-
auth = auth.replace(/%3A/i, ':');
|
|
2859
|
-
auth += '@';
|
|
2860
|
-
}
|
|
750
|
+
build(value, fullKey);
|
|
751
|
+
});
|
|
2861
752
|
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
host = false,
|
|
2866
|
-
query = '';
|
|
2867
|
-
|
|
2868
|
-
if (self.host) {
|
|
2869
|
-
host = auth + self.host;
|
|
2870
|
-
} else if (self.hostname) {
|
|
2871
|
-
host = auth + (self.hostname.indexOf(':') === -1 ?
|
|
2872
|
-
self.hostname :
|
|
2873
|
-
'[' + this.hostname + ']');
|
|
2874
|
-
if (self.port) {
|
|
2875
|
-
host += ':' + self.port;
|
|
753
|
+
stack.pop();
|
|
754
|
+
} else {
|
|
755
|
+
formData.append(parentKey, convertValue(data));
|
|
2876
756
|
}
|
|
2877
757
|
}
|
|
2878
758
|
|
|
2879
|
-
|
|
2880
|
-
isObject(self.query) &&
|
|
2881
|
-
Object.keys(self.query).length) {
|
|
2882
|
-
query = stringify(self.query);
|
|
2883
|
-
}
|
|
759
|
+
build(obj);
|
|
2884
760
|
|
|
2885
|
-
|
|
761
|
+
return formData;
|
|
762
|
+
}
|
|
2886
763
|
|
|
2887
|
-
|
|
764
|
+
var toFormData_1 = toFormData;
|
|
2888
765
|
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
766
|
+
/**
|
|
767
|
+
* Resolve or reject a Promise based on response status.
|
|
768
|
+
*
|
|
769
|
+
* @param {Function} resolve A function that resolves the promise.
|
|
770
|
+
* @param {Function} reject A function that rejects the promise.
|
|
771
|
+
* @param {object} response The response.
|
|
772
|
+
*/
|
|
773
|
+
var settle = function settle(resolve, reject, response) {
|
|
774
|
+
var validateStatus = response.config.validateStatus;
|
|
775
|
+
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
776
|
+
resolve(response);
|
|
777
|
+
} else {
|
|
778
|
+
reject(new AxiosError_1(
|
|
779
|
+
'Request failed with status code ' + response.status,
|
|
780
|
+
[AxiosError_1.ERR_BAD_REQUEST, AxiosError_1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
781
|
+
response.config,
|
|
782
|
+
response.request,
|
|
783
|
+
response
|
|
784
|
+
));
|
|
2897
785
|
}
|
|
786
|
+
};
|
|
2898
787
|
|
|
2899
|
-
|
|
2900
|
-
|
|
788
|
+
var cookies = (
|
|
789
|
+
utils.isStandardBrowserEnv() ?
|
|
2901
790
|
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
791
|
+
// Standard browser envs support document.cookie
|
|
792
|
+
(function standardBrowserEnv() {
|
|
793
|
+
return {
|
|
794
|
+
write: function write(name, value, expires, path, domain, secure) {
|
|
795
|
+
var cookie = [];
|
|
796
|
+
cookie.push(name + '=' + encodeURIComponent(value));
|
|
2906
797
|
|
|
2907
|
-
|
|
2908
|
-
|
|
798
|
+
if (utils.isNumber(expires)) {
|
|
799
|
+
cookie.push('expires=' + new Date(expires).toGMTString());
|
|
800
|
+
}
|
|
2909
801
|
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
}
|
|
802
|
+
if (utils.isString(path)) {
|
|
803
|
+
cookie.push('path=' + path);
|
|
804
|
+
}
|
|
2913
805
|
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
}
|
|
806
|
+
if (utils.isString(domain)) {
|
|
807
|
+
cookie.push('domain=' + domain);
|
|
808
|
+
}
|
|
2917
809
|
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
}
|
|
810
|
+
if (secure === true) {
|
|
811
|
+
cookie.push('secure');
|
|
812
|
+
}
|
|
2921
813
|
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
return urlParse(source, false, true).resolveObject(relative);
|
|
2925
|
-
}
|
|
814
|
+
document.cookie = cookie.join('; ');
|
|
815
|
+
},
|
|
2926
816
|
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
relative = rel;
|
|
2932
|
-
}
|
|
817
|
+
read: function read(name) {
|
|
818
|
+
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
819
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
|
820
|
+
},
|
|
2933
821
|
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
822
|
+
remove: function remove(name) {
|
|
823
|
+
this.write(name, '', Date.now() - 86400000);
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
})() :
|
|
827
|
+
|
|
828
|
+
// Non standard browser env (web workers, react-native) lack needed support.
|
|
829
|
+
(function nonStandardBrowserEnv() {
|
|
830
|
+
return {
|
|
831
|
+
write: function write() {},
|
|
832
|
+
read: function read() { return null; },
|
|
833
|
+
remove: function remove() {}
|
|
834
|
+
};
|
|
835
|
+
})()
|
|
836
|
+
);
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Determines whether the specified URL is absolute
|
|
840
|
+
*
|
|
841
|
+
* @param {string} url The URL to test
|
|
842
|
+
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
843
|
+
*/
|
|
844
|
+
var isAbsoluteURL = function isAbsoluteURL(url) {
|
|
845
|
+
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
846
|
+
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
847
|
+
// by any combination of letters, digits, plus, period, or hyphen.
|
|
848
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
849
|
+
};
|
|
2940
850
|
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
851
|
+
/**
|
|
852
|
+
* Creates a new URL by combining the specified URLs
|
|
853
|
+
*
|
|
854
|
+
* @param {string} baseURL The base URL
|
|
855
|
+
* @param {string} relativeURL The relative URL
|
|
856
|
+
* @returns {string} The combined URL
|
|
857
|
+
*/
|
|
858
|
+
var combineURLs = function combineURLs(baseURL, relativeURL) {
|
|
859
|
+
return relativeURL
|
|
860
|
+
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
861
|
+
: baseURL;
|
|
862
|
+
};
|
|
2944
863
|
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
864
|
+
/**
|
|
865
|
+
* Creates a new URL by combining the baseURL with the requestedURL,
|
|
866
|
+
* only when the requestedURL is not already an absolute URL.
|
|
867
|
+
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
|
868
|
+
*
|
|
869
|
+
* @param {string} baseURL The base URL
|
|
870
|
+
* @param {string} requestedURL Absolute or relative URL to combine
|
|
871
|
+
* @returns {string} The combined full path
|
|
872
|
+
*/
|
|
873
|
+
var buildFullPath = function buildFullPath(baseURL, requestedURL) {
|
|
874
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
875
|
+
return combineURLs(baseURL, requestedURL);
|
|
2949
876
|
}
|
|
877
|
+
return requestedURL;
|
|
878
|
+
};
|
|
2950
879
|
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
}
|
|
880
|
+
// Headers whose duplicates are ignored by node
|
|
881
|
+
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
882
|
+
var ignoreDuplicateOf = [
|
|
883
|
+
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
|
884
|
+
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
|
885
|
+
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
|
886
|
+
'referer', 'retry-after', 'user-agent'
|
|
887
|
+
];
|
|
2960
888
|
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
889
|
+
/**
|
|
890
|
+
* Parse headers into an object
|
|
891
|
+
*
|
|
892
|
+
* ```
|
|
893
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
894
|
+
* Content-Type: application/json
|
|
895
|
+
* Connection: keep-alive
|
|
896
|
+
* Transfer-Encoding: chunked
|
|
897
|
+
* ```
|
|
898
|
+
*
|
|
899
|
+
* @param {String} headers Headers needing to be parsed
|
|
900
|
+
* @returns {Object} Headers parsed into an object
|
|
901
|
+
*/
|
|
902
|
+
var parseHeaders = function parseHeaders(headers) {
|
|
903
|
+
var parsed = {};
|
|
904
|
+
var key;
|
|
905
|
+
var val;
|
|
906
|
+
var i;
|
|
2966
907
|
|
|
2967
|
-
|
|
2968
|
-
return result;
|
|
2969
|
-
}
|
|
2970
|
-
var relPath;
|
|
2971
|
-
if (relative.protocol && relative.protocol !== result.protocol) {
|
|
2972
|
-
// if it's a known url protocol, then changing
|
|
2973
|
-
// the protocol does weird things
|
|
2974
|
-
// first, if it's not file:, then we MUST have a host,
|
|
2975
|
-
// and if there was a path
|
|
2976
|
-
// to begin with, then we MUST have a path.
|
|
2977
|
-
// if it is file:, then the host is dropped,
|
|
2978
|
-
// because that's known to be hostless.
|
|
2979
|
-
// anything else is assumed to be absolute.
|
|
2980
|
-
if (!slashedProtocol[relative.protocol]) {
|
|
2981
|
-
var keys = Object.keys(relative);
|
|
2982
|
-
for (var v = 0; v < keys.length; v++) {
|
|
2983
|
-
var k = keys[v];
|
|
2984
|
-
result[k] = relative[k];
|
|
2985
|
-
}
|
|
2986
|
-
result.href = result.format();
|
|
2987
|
-
return result;
|
|
2988
|
-
}
|
|
908
|
+
if (!headers) { return parsed; }
|
|
2989
909
|
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
if (!relative.host) relative.host = '';
|
|
2995
|
-
if (!relative.hostname) relative.hostname = '';
|
|
2996
|
-
if (relPath[0] !== '') relPath.unshift('');
|
|
2997
|
-
if (relPath.length < 2) relPath.unshift('');
|
|
2998
|
-
result.pathname = relPath.join('/');
|
|
2999
|
-
} else {
|
|
3000
|
-
result.pathname = relative.pathname;
|
|
3001
|
-
}
|
|
3002
|
-
result.search = relative.search;
|
|
3003
|
-
result.query = relative.query;
|
|
3004
|
-
result.host = relative.host || '';
|
|
3005
|
-
result.auth = relative.auth;
|
|
3006
|
-
result.hostname = relative.hostname || relative.host;
|
|
3007
|
-
result.port = relative.port;
|
|
3008
|
-
// to support http.request
|
|
3009
|
-
if (result.pathname || result.search) {
|
|
3010
|
-
var p = result.pathname || '';
|
|
3011
|
-
var s = result.search || '';
|
|
3012
|
-
result.path = p + s;
|
|
3013
|
-
}
|
|
3014
|
-
result.slashes = result.slashes || relative.slashes;
|
|
3015
|
-
result.href = result.format();
|
|
3016
|
-
return result;
|
|
3017
|
-
}
|
|
910
|
+
utils.forEach(headers.split('\n'), function parser(line) {
|
|
911
|
+
i = line.indexOf(':');
|
|
912
|
+
key = utils.trim(line.substr(0, i)).toLowerCase();
|
|
913
|
+
val = utils.trim(line.substr(i + 1));
|
|
3018
914
|
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
relative.pathname && relative.pathname.charAt(0) === '/'
|
|
3023
|
-
),
|
|
3024
|
-
mustEndAbs = (isRelAbs || isSourceAbs ||
|
|
3025
|
-
(result.host && relative.pathname)),
|
|
3026
|
-
removeAllDots = mustEndAbs,
|
|
3027
|
-
srcPath = result.pathname && result.pathname.split('/') || [],
|
|
3028
|
-
psychotic = result.protocol && !slashedProtocol[result.protocol];
|
|
3029
|
-
relPath = relative.pathname && relative.pathname.split('/') || [];
|
|
3030
|
-
// if the url is a non-slashed url, then relative
|
|
3031
|
-
// links like ../.. should be able
|
|
3032
|
-
// to crawl up to the hostname, as well. This is strange.
|
|
3033
|
-
// result.protocol has already been set by now.
|
|
3034
|
-
// Later on, put the first path part into the host field.
|
|
3035
|
-
if (psychotic) {
|
|
3036
|
-
result.hostname = '';
|
|
3037
|
-
result.port = null;
|
|
3038
|
-
if (result.host) {
|
|
3039
|
-
if (srcPath[0] === '') srcPath[0] = result.host;
|
|
3040
|
-
else srcPath.unshift(result.host);
|
|
3041
|
-
}
|
|
3042
|
-
result.host = '';
|
|
3043
|
-
if (relative.protocol) {
|
|
3044
|
-
relative.hostname = null;
|
|
3045
|
-
relative.port = null;
|
|
3046
|
-
if (relative.host) {
|
|
3047
|
-
if (relPath[0] === '') relPath[0] = relative.host;
|
|
3048
|
-
else relPath.unshift(relative.host);
|
|
915
|
+
if (key) {
|
|
916
|
+
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
|
917
|
+
return;
|
|
3049
918
|
}
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
var authInHost;
|
|
3055
|
-
if (isRelAbs) {
|
|
3056
|
-
// it's absolute.
|
|
3057
|
-
result.host = (relative.host || relative.host === '') ?
|
|
3058
|
-
relative.host : result.host;
|
|
3059
|
-
result.hostname = (relative.hostname || relative.hostname === '') ?
|
|
3060
|
-
relative.hostname : result.hostname;
|
|
3061
|
-
result.search = relative.search;
|
|
3062
|
-
result.query = relative.query;
|
|
3063
|
-
srcPath = relPath;
|
|
3064
|
-
// fall through to the dot-handling below.
|
|
3065
|
-
} else if (relPath.length) {
|
|
3066
|
-
// it's relative
|
|
3067
|
-
// throw away the existing file, and take the new path instead.
|
|
3068
|
-
if (!srcPath) srcPath = [];
|
|
3069
|
-
srcPath.pop();
|
|
3070
|
-
srcPath = srcPath.concat(relPath);
|
|
3071
|
-
result.search = relative.search;
|
|
3072
|
-
result.query = relative.query;
|
|
3073
|
-
} else if (!isNullOrUndefined(relative.search)) {
|
|
3074
|
-
// just pull out the search.
|
|
3075
|
-
// like href='?foo'.
|
|
3076
|
-
// Put this after the other two cases because it simplifies the booleans
|
|
3077
|
-
if (psychotic) {
|
|
3078
|
-
result.hostname = result.host = srcPath.shift();
|
|
3079
|
-
//occationaly the auth can get stuck only in host
|
|
3080
|
-
//this especially happens in cases like
|
|
3081
|
-
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
|
|
3082
|
-
authInHost = result.host && result.host.indexOf('@') > 0 ?
|
|
3083
|
-
result.host.split('@') : false;
|
|
3084
|
-
if (authInHost) {
|
|
3085
|
-
result.auth = authInHost.shift();
|
|
3086
|
-
result.host = result.hostname = authInHost.shift();
|
|
919
|
+
if (key === 'set-cookie') {
|
|
920
|
+
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
921
|
+
} else {
|
|
922
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
3087
923
|
}
|
|
3088
924
|
}
|
|
3089
|
-
|
|
3090
|
-
result.query = relative.query;
|
|
3091
|
-
//to support http.request
|
|
3092
|
-
if (!isNull(result.pathname) || !isNull(result.search)) {
|
|
3093
|
-
result.path = (result.pathname ? result.pathname : '') +
|
|
3094
|
-
(result.search ? result.search : '');
|
|
3095
|
-
}
|
|
3096
|
-
result.href = result.format();
|
|
3097
|
-
return result;
|
|
3098
|
-
}
|
|
3099
|
-
|
|
3100
|
-
if (!srcPath.length) {
|
|
3101
|
-
// no path at all. easy.
|
|
3102
|
-
// we've already handled the other stuff above.
|
|
3103
|
-
result.pathname = null;
|
|
3104
|
-
//to support http.request
|
|
3105
|
-
if (result.search) {
|
|
3106
|
-
result.path = '/' + result.search;
|
|
3107
|
-
} else {
|
|
3108
|
-
result.path = null;
|
|
3109
|
-
}
|
|
3110
|
-
result.href = result.format();
|
|
3111
|
-
return result;
|
|
3112
|
-
}
|
|
3113
|
-
|
|
3114
|
-
// if a url ENDs in . or .., then it must get a trailing slash.
|
|
3115
|
-
// however, if it ends in anything else non-slashy,
|
|
3116
|
-
// then it must NOT get a trailing slash.
|
|
3117
|
-
var last = srcPath.slice(-1)[0];
|
|
3118
|
-
var hasTrailingSlash = (
|
|
3119
|
-
(result.host || relative.host || srcPath.length > 1) &&
|
|
3120
|
-
(last === '.' || last === '..') || last === '');
|
|
3121
|
-
|
|
3122
|
-
// strip single dots, resolve double dots to parent dir
|
|
3123
|
-
// if the path tries to go above the root, `up` ends up > 0
|
|
3124
|
-
var up = 0;
|
|
3125
|
-
for (var i = srcPath.length; i >= 0; i--) {
|
|
3126
|
-
last = srcPath[i];
|
|
3127
|
-
if (last === '.') {
|
|
3128
|
-
srcPath.splice(i, 1);
|
|
3129
|
-
} else if (last === '..') {
|
|
3130
|
-
srcPath.splice(i, 1);
|
|
3131
|
-
up++;
|
|
3132
|
-
} else if (up) {
|
|
3133
|
-
srcPath.splice(i, 1);
|
|
3134
|
-
up--;
|
|
3135
|
-
}
|
|
3136
|
-
}
|
|
925
|
+
});
|
|
3137
926
|
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
for (; up--; up) {
|
|
3141
|
-
srcPath.unshift('..');
|
|
3142
|
-
}
|
|
3143
|
-
}
|
|
927
|
+
return parsed;
|
|
928
|
+
};
|
|
3144
929
|
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
srcPath.unshift('');
|
|
3148
|
-
}
|
|
930
|
+
var isURLSameOrigin = (
|
|
931
|
+
utils.isStandardBrowserEnv() ?
|
|
3149
932
|
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
933
|
+
// Standard browser envs have full support of the APIs needed to test
|
|
934
|
+
// whether the request URL is of the same origin as current location.
|
|
935
|
+
(function standardBrowserEnv() {
|
|
936
|
+
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
937
|
+
var urlParsingNode = document.createElement('a');
|
|
938
|
+
var originURL;
|
|
3153
939
|
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
//this especially happens in cases like
|
|
3163
|
-
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
|
|
3164
|
-
authInHost = result.host && result.host.indexOf('@') > 0 ?
|
|
3165
|
-
result.host.split('@') : false;
|
|
3166
|
-
if (authInHost) {
|
|
3167
|
-
result.auth = authInHost.shift();
|
|
3168
|
-
result.host = result.hostname = authInHost.shift();
|
|
3169
|
-
}
|
|
3170
|
-
}
|
|
940
|
+
/**
|
|
941
|
+
* Parse a URL to discover it's components
|
|
942
|
+
*
|
|
943
|
+
* @param {String} url The URL to be parsed
|
|
944
|
+
* @returns {Object}
|
|
945
|
+
*/
|
|
946
|
+
function resolveURL(url) {
|
|
947
|
+
var href = url;
|
|
3171
948
|
|
|
3172
|
-
|
|
949
|
+
if (msie) {
|
|
950
|
+
// IE needs attribute set twice to normalize properties
|
|
951
|
+
urlParsingNode.setAttribute('href', href);
|
|
952
|
+
href = urlParsingNode.href;
|
|
953
|
+
}
|
|
3173
954
|
|
|
3174
|
-
|
|
3175
|
-
srcPath.unshift('');
|
|
3176
|
-
}
|
|
955
|
+
urlParsingNode.setAttribute('href', href);
|
|
3177
956
|
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
957
|
+
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
|
958
|
+
return {
|
|
959
|
+
href: urlParsingNode.href,
|
|
960
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
|
961
|
+
host: urlParsingNode.host,
|
|
962
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
|
963
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
|
964
|
+
hostname: urlParsingNode.hostname,
|
|
965
|
+
port: urlParsingNode.port,
|
|
966
|
+
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
|
967
|
+
urlParsingNode.pathname :
|
|
968
|
+
'/' + urlParsingNode.pathname
|
|
969
|
+
};
|
|
970
|
+
}
|
|
3184
971
|
|
|
3185
|
-
|
|
3186
|
-
if (!isNull(result.pathname) || !isNull(result.search)) {
|
|
3187
|
-
result.path = (result.pathname ? result.pathname : '') +
|
|
3188
|
-
(result.search ? result.search : '');
|
|
3189
|
-
}
|
|
3190
|
-
result.auth = relative.auth || result.auth;
|
|
3191
|
-
result.slashes = result.slashes || relative.slashes;
|
|
3192
|
-
result.href = result.format();
|
|
3193
|
-
return result;
|
|
3194
|
-
};
|
|
972
|
+
originURL = resolveURL(window.location.href);
|
|
3195
973
|
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
974
|
+
/**
|
|
975
|
+
* Determine if a URL shares the same origin as the current location
|
|
976
|
+
*
|
|
977
|
+
* @param {String} requestURL The URL to test
|
|
978
|
+
* @returns {boolean} True if URL shares the same origin, otherwise false
|
|
979
|
+
*/
|
|
980
|
+
return function isURLSameOrigin(requestURL) {
|
|
981
|
+
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
|
982
|
+
return (parsed.protocol === originURL.protocol &&
|
|
983
|
+
parsed.host === originURL.host);
|
|
984
|
+
};
|
|
985
|
+
})() :
|
|
3199
986
|
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
}
|
|
3208
|
-
host = host.substr(0, host.length - port.length);
|
|
3209
|
-
}
|
|
3210
|
-
if (host) self.hostname = host;
|
|
3211
|
-
}
|
|
987
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
988
|
+
(function nonStandardBrowserEnv() {
|
|
989
|
+
return function isURLSameOrigin() {
|
|
990
|
+
return true;
|
|
991
|
+
};
|
|
992
|
+
})()
|
|
993
|
+
);
|
|
3212
994
|
|
|
3213
995
|
/**
|
|
3214
996
|
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
@@ -3228,6 +1010,11 @@ utils.inherits(CanceledError, AxiosError_1, {
|
|
|
3228
1010
|
|
|
3229
1011
|
var CanceledError_1 = CanceledError;
|
|
3230
1012
|
|
|
1013
|
+
var parseProtocol = function parseProtocol(url) {
|
|
1014
|
+
var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
1015
|
+
return match && match[1] || '';
|
|
1016
|
+
};
|
|
1017
|
+
|
|
3231
1018
|
var xhr = function xhrAdapter(config) {
|
|
3232
1019
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
3233
1020
|
var requestData = config.data;
|
|
@@ -3244,6 +1031,10 @@ var xhr = function xhrAdapter(config) {
|
|
|
3244
1031
|
}
|
|
3245
1032
|
}
|
|
3246
1033
|
|
|
1034
|
+
if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
|
|
1035
|
+
delete requestHeaders['Content-Type']; // Let the browser set it
|
|
1036
|
+
}
|
|
1037
|
+
|
|
3247
1038
|
var request = new XMLHttpRequest();
|
|
3248
1039
|
|
|
3249
1040
|
// HTTP basic authentication
|
|
@@ -3254,8 +1045,6 @@ var xhr = function xhrAdapter(config) {
|
|
|
3254
1045
|
}
|
|
3255
1046
|
|
|
3256
1047
|
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
3257
|
-
var parsed = url.parse(fullPath);
|
|
3258
|
-
var protocol = utils.getProtocol(parsed.protocol);
|
|
3259
1048
|
|
|
3260
1049
|
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
3261
1050
|
|
|
@@ -3422,16 +1211,14 @@ var xhr = function xhrAdapter(config) {
|
|
|
3422
1211
|
requestData = null;
|
|
3423
1212
|
}
|
|
3424
1213
|
|
|
3425
|
-
|
|
3426
|
-
reject(new AxiosError_1('Malformed URL ' + fullPath, AxiosError_1.ERR_BAD_REQUEST, config));
|
|
3427
|
-
return;
|
|
3428
|
-
}
|
|
1214
|
+
var protocol = parseProtocol(fullPath);
|
|
3429
1215
|
|
|
3430
|
-
if (
|
|
3431
|
-
reject(new AxiosError_1('Unsupported protocol ' + protocol, AxiosError_1.ERR_BAD_REQUEST, config));
|
|
1216
|
+
if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
|
|
1217
|
+
reject(new AxiosError_1('Unsupported protocol ' + protocol + ':', AxiosError_1.ERR_BAD_REQUEST, config));
|
|
3432
1218
|
return;
|
|
3433
1219
|
}
|
|
3434
1220
|
|
|
1221
|
+
|
|
3435
1222
|
// Send the request
|
|
3436
1223
|
request.send(requestData);
|
|
3437
1224
|
});
|
|
@@ -3779,7 +1566,7 @@ var mergeConfig = function mergeConfig(config1, config2) {
|
|
|
3779
1566
|
};
|
|
3780
1567
|
|
|
3781
1568
|
var data = {
|
|
3782
|
-
"version": "0.27.
|
|
1569
|
+
"version": "0.27.2"
|
|
3783
1570
|
};
|
|
3784
1571
|
|
|
3785
1572
|
var VERSION = data.version;
|
|
@@ -4231,7 +2018,7 @@ axios_1.default = default_1;
|
|
|
4231
2018
|
var axios = axios_1;
|
|
4232
2019
|
|
|
4233
2020
|
var name$1 = "@tryghost/content-api";
|
|
4234
|
-
var version = "1.11.
|
|
2021
|
+
var version = "1.11.10";
|
|
4235
2022
|
var repository = "https://github.com/TryGhost/SDK/tree/master/packages/content-api";
|
|
4236
2023
|
var author = "Ghost Foundation";
|
|
4237
2024
|
var license = "MIT";
|
|
@@ -4260,12 +2047,12 @@ var publishConfig = {
|
|
|
4260
2047
|
access: "public"
|
|
4261
2048
|
};
|
|
4262
2049
|
var devDependencies = {
|
|
4263
|
-
"@babel/core": "7.21.
|
|
2050
|
+
"@babel/core": "7.21.8",
|
|
4264
2051
|
"@babel/polyfill": "7.12.1",
|
|
4265
|
-
"@babel/preset-env": "7.21.
|
|
2052
|
+
"@babel/preset-env": "7.21.5",
|
|
4266
2053
|
"@rollup/plugin-json": "6.0.0",
|
|
4267
2054
|
c8: "7.13.0",
|
|
4268
|
-
"core-js": "3.30.
|
|
2055
|
+
"core-js": "3.30.2",
|
|
4269
2056
|
"eslint-plugin-ghost": "2.16.0",
|
|
4270
2057
|
mocha: "10.2.0",
|
|
4271
2058
|
rollup: "2.79.1",
|
|
@@ -4276,12 +2063,12 @@ var devDependencies = {
|
|
|
4276
2063
|
"rollup-plugin-replace": "2.2.0",
|
|
4277
2064
|
"rollup-plugin-terser": "7.0.2",
|
|
4278
2065
|
should: "13.2.3",
|
|
4279
|
-
sinon: "15.0.
|
|
2066
|
+
sinon: "15.0.4"
|
|
4280
2067
|
};
|
|
4281
2068
|
var dependencies = {
|
|
4282
2069
|
axios: "^0.27.0"
|
|
4283
2070
|
};
|
|
4284
|
-
var gitHead = "
|
|
2071
|
+
var gitHead = "fdddca8236ffcf6db746e87140913112facdb382";
|
|
4285
2072
|
var packageInfo = {
|
|
4286
2073
|
name: name$1,
|
|
4287
2074
|
version: version,
|