tp-react-elements 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index.esm12.js +2 -2
- package/dist/_virtual/index.esm13.js +2 -2
- package/dist/_virtual/index.esm14.js +2 -2
- package/dist/_virtual/index.esm4.js +2 -2
- package/dist/_virtual/index.esm5.js +2 -2
- package/dist/_virtual/index.esm6.js +2 -2
- package/dist/_virtual/index.esm7.js +2 -2
- package/dist/components/DatePicker/index.esm.js +6 -2
- package/dist/components/DateRangePicker/DateRangePicker.esm.js +1 -1
- package/dist/components/FileUpload/index.esm.js +7 -3
- package/dist/components/Form/FormRenderWrapper.esm.js +2 -2
- package/dist/components/FormComponents/index.esm.js +2 -2
- package/dist/components/TimePicker/index.esm.js +5 -1
- package/dist/index.esm.js +6 -6
- package/dist/node_modules/axios/lib/adapters/fetch.esm.js +2 -2
- package/dist/node_modules/axios/lib/cancel/CanceledError.esm.js +15 -18
- package/dist/node_modules/axios/lib/core/Axios.esm.js +11 -2
- package/dist/node_modules/axios/lib/core/AxiosError.esm.js +65 -102
- package/dist/node_modules/axios/lib/core/InterceptorManager.esm.js +1 -0
- package/dist/node_modules/axios/lib/core/mergeConfig.esm.js +22 -9
- package/dist/node_modules/axios/lib/defaults/transitional.esm.js +2 -1
- package/dist/node_modules/axios/lib/env/data.esm.js +1 -1
- package/dist/node_modules/axios/lib/helpers/buildURL.esm.js +7 -10
- package/dist/node_modules/axios/lib/helpers/composeSignals.esm.js +1 -1
- package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.esm.js +4 -0
- package/dist/node_modules/axios/lib/helpers/spread.esm.js +1 -1
- package/dist/node_modules/axios/lib/utils.esm.js +198 -117
- package/dist/node_modules/date-fns/_lib/defaultLocale.esm.js +2 -2
- package/dist/node_modules/date-fns/addDays.esm.js +1 -1
- package/dist/node_modules/date-fns/constructFrom.esm.js +1 -1
- package/dist/node_modules/date-fns/differenceInCalendarDays.esm.js +1 -1
- package/dist/node_modules/date-fns/format.esm.js +1 -1
- package/dist/node_modules/date-fns/format.esm2.js +4 -4
- package/dist/node_modules/date-fns/getDayOfYear.esm.js +1 -1
- package/dist/node_modules/date-fns/getDefaultOptions.esm.js +1 -1
- package/dist/node_modules/date-fns/getISODay.esm.js +1 -1
- package/dist/node_modules/date-fns/getISOWeek.esm.js +1 -1
- package/dist/node_modules/date-fns/getISOWeekYear.esm.js +1 -1
- package/dist/node_modules/date-fns/getWeek.esm.js +1 -1
- package/dist/node_modules/date-fns/getWeekYear.esm.js +1 -1
- package/dist/node_modules/date-fns/index.esm.js +491 -491
- package/dist/node_modules/date-fns/isDate.esm.js +1 -1
- package/dist/node_modules/date-fns/isValid.esm.js +1 -1
- package/dist/node_modules/date-fns/lightFormat.esm.js +3 -3
- package/dist/node_modules/date-fns/locale/en-US.esm.js +1 -1
- package/dist/node_modules/date-fns/parse.esm.js +1 -1
- package/dist/node_modules/date-fns/parse.esm2.js +4 -4
- package/dist/node_modules/date-fns/setDay.esm.js +1 -1
- package/dist/node_modules/date-fns/setISODay.esm.js +1 -1
- package/dist/node_modules/date-fns/setISOWeek.esm.js +1 -1
- package/dist/node_modules/date-fns/setWeek.esm.js +1 -1
- package/dist/node_modules/date-fns/startOfDay.esm.js +1 -1
- package/dist/node_modules/date-fns/startOfISOWeek.esm.js +1 -1
- package/dist/node_modules/date-fns/startOfISOWeekYear.esm.js +1 -1
- package/dist/node_modules/date-fns/startOfWeek.esm.js +1 -1
- package/dist/node_modules/date-fns/startOfWeekYear.esm.js +1 -1
- package/dist/node_modules/date-fns/startOfYear.esm.js +1 -1
- package/dist/node_modules/date-fns/toDate.esm.js +1 -1
- package/dist/node_modules/date-fns/transpose.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/Calendar/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateInput/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateRange/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateRangePicker/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DefinedRange/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/InputRangeField/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/Month/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/index.esm.js +9 -9
- package/dist/node_modules/react-list/react-list.esm.js +2 -2
- package/package.json +1 -1
|
@@ -2,30 +2,30 @@ import bind from './helpers/bind.esm.js';
|
|
|
2
2
|
|
|
3
3
|
// utils is a library of generic helper functions non-specific to axios
|
|
4
4
|
|
|
5
|
-
const {toString} = Object.prototype;
|
|
6
|
-
const {getPrototypeOf} = Object;
|
|
7
|
-
const {iterator, toStringTag} = Symbol;
|
|
5
|
+
const { toString } = Object.prototype;
|
|
6
|
+
const { getPrototypeOf } = Object;
|
|
7
|
+
const { iterator, toStringTag } = Symbol;
|
|
8
8
|
|
|
9
|
-
const kindOf = (cache => thing => {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const kindOf = ((cache) => (thing) => {
|
|
10
|
+
const str = toString.call(thing);
|
|
11
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
12
12
|
})(Object.create(null));
|
|
13
13
|
|
|
14
14
|
const kindOfTest = (type) => {
|
|
15
15
|
type = type.toLowerCase();
|
|
16
|
-
return (thing) => kindOf(thing) === type
|
|
16
|
+
return (thing) => kindOf(thing) === type;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const typeOfTest = type => thing => typeof thing === type;
|
|
19
|
+
const typeOfTest = (type) => (thing) => typeof thing === type;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* Determine if a value is
|
|
22
|
+
* Determine if a value is a non-null object
|
|
23
23
|
*
|
|
24
24
|
* @param {Object} val The value to test
|
|
25
25
|
*
|
|
26
26
|
* @returns {boolean} True if value is an Array, otherwise false
|
|
27
27
|
*/
|
|
28
|
-
const {isArray} = Array;
|
|
28
|
+
const { isArray } = Array;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Determine if a value is undefined
|
|
@@ -34,7 +34,7 @@ const {isArray} = Array;
|
|
|
34
34
|
*
|
|
35
35
|
* @returns {boolean} True if the value is undefined, otherwise false
|
|
36
36
|
*/
|
|
37
|
-
const isUndefined = typeOfTest(
|
|
37
|
+
const isUndefined = typeOfTest("undefined");
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Determine if a value is a Buffer
|
|
@@ -44,8 +44,14 @@ const isUndefined = typeOfTest('undefined');
|
|
|
44
44
|
* @returns {boolean} True if value is a Buffer, otherwise false
|
|
45
45
|
*/
|
|
46
46
|
function isBuffer(val) {
|
|
47
|
-
return
|
|
48
|
-
|
|
47
|
+
return (
|
|
48
|
+
val !== null &&
|
|
49
|
+
!isUndefined(val) &&
|
|
50
|
+
val.constructor !== null &&
|
|
51
|
+
!isUndefined(val.constructor) &&
|
|
52
|
+
isFunction(val.constructor.isBuffer) &&
|
|
53
|
+
val.constructor.isBuffer(val)
|
|
54
|
+
);
|
|
49
55
|
}
|
|
50
56
|
|
|
51
57
|
/**
|
|
@@ -55,8 +61,7 @@ function isBuffer(val) {
|
|
|
55
61
|
*
|
|
56
62
|
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
57
63
|
*/
|
|
58
|
-
const isArrayBuffer = kindOfTest(
|
|
59
|
-
|
|
64
|
+
const isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
60
65
|
|
|
61
66
|
/**
|
|
62
67
|
* Determine if a value is a view on an ArrayBuffer
|
|
@@ -67,10 +72,10 @@ const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
|
67
72
|
*/
|
|
68
73
|
function isArrayBufferView(val) {
|
|
69
74
|
let result;
|
|
70
|
-
if (
|
|
75
|
+
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
71
76
|
result = ArrayBuffer.isView(val);
|
|
72
77
|
} else {
|
|
73
|
-
result =
|
|
78
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
74
79
|
}
|
|
75
80
|
return result;
|
|
76
81
|
}
|
|
@@ -82,7 +87,7 @@ function isArrayBufferView(val) {
|
|
|
82
87
|
*
|
|
83
88
|
* @returns {boolean} True if value is a String, otherwise false
|
|
84
89
|
*/
|
|
85
|
-
const isString = typeOfTest(
|
|
90
|
+
const isString = typeOfTest("string");
|
|
86
91
|
|
|
87
92
|
/**
|
|
88
93
|
* Determine if a value is a Function
|
|
@@ -90,7 +95,7 @@ const isString = typeOfTest('string');
|
|
|
90
95
|
* @param {*} val The value to test
|
|
91
96
|
* @returns {boolean} True if value is a Function, otherwise false
|
|
92
97
|
*/
|
|
93
|
-
const isFunction = typeOfTest(
|
|
98
|
+
const isFunction = typeOfTest("function");
|
|
94
99
|
|
|
95
100
|
/**
|
|
96
101
|
* Determine if a value is a Number
|
|
@@ -99,7 +104,7 @@ const isFunction = typeOfTest('function');
|
|
|
99
104
|
*
|
|
100
105
|
* @returns {boolean} True if value is a Number, otherwise false
|
|
101
106
|
*/
|
|
102
|
-
const isNumber = typeOfTest(
|
|
107
|
+
const isNumber = typeOfTest("number");
|
|
103
108
|
|
|
104
109
|
/**
|
|
105
110
|
* Determine if a value is an Object
|
|
@@ -108,7 +113,7 @@ const isNumber = typeOfTest('number');
|
|
|
108
113
|
*
|
|
109
114
|
* @returns {boolean} True if value is an Object, otherwise false
|
|
110
115
|
*/
|
|
111
|
-
const isObject = (thing) => thing !== null && typeof thing ===
|
|
116
|
+
const isObject = (thing) => thing !== null && typeof thing === "object";
|
|
112
117
|
|
|
113
118
|
/**
|
|
114
119
|
* Determine if a value is a Boolean
|
|
@@ -116,7 +121,7 @@ const isObject = (thing) => thing !== null && typeof thing === 'object';
|
|
|
116
121
|
* @param {*} thing The value to test
|
|
117
122
|
* @returns {boolean} True if value is a Boolean, otherwise false
|
|
118
123
|
*/
|
|
119
|
-
const isBoolean = thing => thing === true || thing === false;
|
|
124
|
+
const isBoolean = (thing) => thing === true || thing === false;
|
|
120
125
|
|
|
121
126
|
/**
|
|
122
127
|
* Determine if a value is a plain Object
|
|
@@ -126,12 +131,18 @@ const isBoolean = thing => thing === true || thing === false;
|
|
|
126
131
|
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
127
132
|
*/
|
|
128
133
|
const isPlainObject = (val) => {
|
|
129
|
-
if (kindOf(val) !==
|
|
134
|
+
if (kindOf(val) !== "object") {
|
|
130
135
|
return false;
|
|
131
136
|
}
|
|
132
137
|
|
|
133
138
|
const prototype = getPrototypeOf(val);
|
|
134
|
-
return (
|
|
139
|
+
return (
|
|
140
|
+
(prototype === null ||
|
|
141
|
+
prototype === Object.prototype ||
|
|
142
|
+
Object.getPrototypeOf(prototype) === null) &&
|
|
143
|
+
!(toStringTag in val) &&
|
|
144
|
+
!(iterator in val)
|
|
145
|
+
);
|
|
135
146
|
};
|
|
136
147
|
|
|
137
148
|
/**
|
|
@@ -148,7 +159,10 @@ const isEmptyObject = (val) => {
|
|
|
148
159
|
}
|
|
149
160
|
|
|
150
161
|
try {
|
|
151
|
-
return
|
|
162
|
+
return (
|
|
163
|
+
Object.keys(val).length === 0 &&
|
|
164
|
+
Object.getPrototypeOf(val) === Object.prototype
|
|
165
|
+
);
|
|
152
166
|
} catch (e) {
|
|
153
167
|
// Fallback for any other objects that might cause RangeError with Object.keys()
|
|
154
168
|
return false;
|
|
@@ -162,7 +176,7 @@ const isEmptyObject = (val) => {
|
|
|
162
176
|
*
|
|
163
177
|
* @returns {boolean} True if value is a Date, otherwise false
|
|
164
178
|
*/
|
|
165
|
-
const isDate = kindOfTest(
|
|
179
|
+
const isDate = kindOfTest("Date");
|
|
166
180
|
|
|
167
181
|
/**
|
|
168
182
|
* Determine if a value is a File
|
|
@@ -171,7 +185,7 @@ const isDate = kindOfTest('Date');
|
|
|
171
185
|
*
|
|
172
186
|
* @returns {boolean} True if value is a File, otherwise false
|
|
173
187
|
*/
|
|
174
|
-
const isFile = kindOfTest(
|
|
188
|
+
const isFile = kindOfTest("File");
|
|
175
189
|
|
|
176
190
|
/**
|
|
177
191
|
* Determine if a value is a Blob
|
|
@@ -180,7 +194,7 @@ const isFile = kindOfTest('File');
|
|
|
180
194
|
*
|
|
181
195
|
* @returns {boolean} True if value is a Blob, otherwise false
|
|
182
196
|
*/
|
|
183
|
-
const isBlob = kindOfTest(
|
|
197
|
+
const isBlob = kindOfTest("Blob");
|
|
184
198
|
|
|
185
199
|
/**
|
|
186
200
|
* Determine if a value is a FileList
|
|
@@ -189,7 +203,7 @@ const isBlob = kindOfTest('Blob');
|
|
|
189
203
|
*
|
|
190
204
|
* @returns {boolean} True if value is a File, otherwise false
|
|
191
205
|
*/
|
|
192
|
-
const isFileList = kindOfTest(
|
|
206
|
+
const isFileList = kindOfTest("FileList");
|
|
193
207
|
|
|
194
208
|
/**
|
|
195
209
|
* Determine if a value is a Stream
|
|
@@ -209,15 +223,16 @@ const isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
|
209
223
|
*/
|
|
210
224
|
const isFormData = (thing) => {
|
|
211
225
|
let kind;
|
|
212
|
-
return
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
226
|
+
return (
|
|
227
|
+
thing &&
|
|
228
|
+
((typeof FormData === "function" && thing instanceof FormData) ||
|
|
229
|
+
(isFunction(thing.append) &&
|
|
230
|
+
((kind = kindOf(thing)) === "formdata" ||
|
|
231
|
+
// detect form-data instance
|
|
232
|
+
(kind === "object" &&
|
|
233
|
+
isFunction(thing.toString) &&
|
|
234
|
+
thing.toString() === "[object FormData]"))))
|
|
235
|
+
);
|
|
221
236
|
};
|
|
222
237
|
|
|
223
238
|
/**
|
|
@@ -227,9 +242,14 @@ const isFormData = (thing) => {
|
|
|
227
242
|
*
|
|
228
243
|
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
229
244
|
*/
|
|
230
|
-
const isURLSearchParams = kindOfTest(
|
|
245
|
+
const isURLSearchParams = kindOfTest("URLSearchParams");
|
|
231
246
|
|
|
232
|
-
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
247
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
248
|
+
"ReadableStream",
|
|
249
|
+
"Request",
|
|
250
|
+
"Response",
|
|
251
|
+
"Headers",
|
|
252
|
+
].map(kindOfTest);
|
|
233
253
|
|
|
234
254
|
/**
|
|
235
255
|
* Trim excess whitespace off the beginning and end of a string
|
|
@@ -238,8 +258,8 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream',
|
|
|
238
258
|
*
|
|
239
259
|
* @returns {String} The String freed of excess whitespace
|
|
240
260
|
*/
|
|
241
|
-
const trim = (str) =>
|
|
242
|
-
str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
|
|
261
|
+
const trim = (str) =>
|
|
262
|
+
str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
243
263
|
|
|
244
264
|
/**
|
|
245
265
|
* Iterate over an Array or an Object invoking a function for each item.
|
|
@@ -250,15 +270,16 @@ const trim = (str) => str.trim ?
|
|
|
250
270
|
* If 'obj' is an Object callback will be called passing
|
|
251
271
|
* the value, key, and complete object for each property.
|
|
252
272
|
*
|
|
253
|
-
* @param {Object|Array} obj The object to iterate
|
|
273
|
+
* @param {Object|Array<unknown>} obj The object to iterate
|
|
254
274
|
* @param {Function} fn The callback to invoke for each item
|
|
255
275
|
*
|
|
256
|
-
* @param {
|
|
276
|
+
* @param {Object} [options]
|
|
277
|
+
* @param {Boolean} [options.allOwnKeys = false]
|
|
257
278
|
* @returns {any}
|
|
258
279
|
*/
|
|
259
|
-
function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
280
|
+
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
260
281
|
// Don't bother if no value provided
|
|
261
|
-
if (obj === null || typeof obj ===
|
|
282
|
+
if (obj === null || typeof obj === "undefined") {
|
|
262
283
|
return;
|
|
263
284
|
}
|
|
264
285
|
|
|
@@ -266,7 +287,7 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
266
287
|
let l;
|
|
267
288
|
|
|
268
289
|
// Force an array if not already something iterable
|
|
269
|
-
if (typeof obj !==
|
|
290
|
+
if (typeof obj !== "object") {
|
|
270
291
|
/*eslint no-param-reassign:0*/
|
|
271
292
|
obj = [obj];
|
|
272
293
|
}
|
|
@@ -283,7 +304,9 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
283
304
|
}
|
|
284
305
|
|
|
285
306
|
// Iterate over object keys
|
|
286
|
-
const keys = allOwnKeys
|
|
307
|
+
const keys = allOwnKeys
|
|
308
|
+
? Object.getOwnPropertyNames(obj)
|
|
309
|
+
: Object.keys(obj);
|
|
287
310
|
const len = keys.length;
|
|
288
311
|
let key;
|
|
289
312
|
|
|
@@ -295,7 +318,7 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
295
318
|
}
|
|
296
319
|
|
|
297
320
|
function findKey(obj, key) {
|
|
298
|
-
if (isBuffer(obj)){
|
|
321
|
+
if (isBuffer(obj)) {
|
|
299
322
|
return null;
|
|
300
323
|
}
|
|
301
324
|
|
|
@@ -315,10 +338,15 @@ function findKey(obj, key) {
|
|
|
315
338
|
const _global = (() => {
|
|
316
339
|
/*eslint no-undef:0*/
|
|
317
340
|
if (typeof globalThis !== "undefined") return globalThis;
|
|
318
|
-
return typeof self !== "undefined"
|
|
341
|
+
return typeof self !== "undefined"
|
|
342
|
+
? self
|
|
343
|
+
: typeof window !== "undefined"
|
|
344
|
+
? window
|
|
345
|
+
: global;
|
|
319
346
|
})();
|
|
320
347
|
|
|
321
|
-
const isContextDefined = (context) =>
|
|
348
|
+
const isContextDefined = (context) =>
|
|
349
|
+
!isUndefined(context) && context !== _global;
|
|
322
350
|
|
|
323
351
|
/**
|
|
324
352
|
* Accepts varargs expecting each argument to be an object, then
|
|
@@ -330,7 +358,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
330
358
|
* Example:
|
|
331
359
|
*
|
|
332
360
|
* ```js
|
|
333
|
-
*
|
|
361
|
+
* const result = merge({foo: 123}, {foo: 456});
|
|
334
362
|
* console.log(result.foo); // outputs 456
|
|
335
363
|
* ```
|
|
336
364
|
*
|
|
@@ -339,10 +367,15 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
339
367
|
* @returns {Object} Result of all merge properties
|
|
340
368
|
*/
|
|
341
369
|
function merge(/* obj1, obj2, obj3, ... */) {
|
|
342
|
-
const {caseless, skipUndefined} = isContextDefined(this) && this || {};
|
|
370
|
+
const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
|
|
343
371
|
const result = {};
|
|
344
372
|
const assignValue = (val, key) => {
|
|
345
|
-
|
|
373
|
+
// Skip dangerous property names to prevent prototype pollution
|
|
374
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const targetKey = (caseless && findKey(result, key)) || key;
|
|
346
379
|
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
347
380
|
result[targetKey] = merge(result[targetKey], val);
|
|
348
381
|
} else if (isPlainObject(val)) {
|
|
@@ -367,17 +400,32 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
|
367
400
|
* @param {Object} b The object to copy properties from
|
|
368
401
|
* @param {Object} thisArg The object to bind function to
|
|
369
402
|
*
|
|
370
|
-
* @param {
|
|
403
|
+
* @param {Object} [options]
|
|
404
|
+
* @param {Boolean} [options.allOwnKeys]
|
|
371
405
|
* @returns {Object} The resulting value of object a
|
|
372
406
|
*/
|
|
373
|
-
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
374
|
-
forEach(
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
407
|
+
const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
408
|
+
forEach(
|
|
409
|
+
b,
|
|
410
|
+
(val, key) => {
|
|
411
|
+
if (thisArg && isFunction(val)) {
|
|
412
|
+
Object.defineProperty(a, key, {
|
|
413
|
+
value: bind(val, thisArg),
|
|
414
|
+
writable: true,
|
|
415
|
+
enumerable: true,
|
|
416
|
+
configurable: true,
|
|
417
|
+
});
|
|
418
|
+
} else {
|
|
419
|
+
Object.defineProperty(a, key, {
|
|
420
|
+
value: val,
|
|
421
|
+
writable: true,
|
|
422
|
+
enumerable: true,
|
|
423
|
+
configurable: true,
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
{ allOwnKeys },
|
|
428
|
+
);
|
|
381
429
|
return a;
|
|
382
430
|
};
|
|
383
431
|
|
|
@@ -389,7 +437,7 @@ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
|
389
437
|
* @returns {string} content value without BOM
|
|
390
438
|
*/
|
|
391
439
|
const stripBOM = (content) => {
|
|
392
|
-
if (content.charCodeAt(0) ===
|
|
440
|
+
if (content.charCodeAt(0) === 0xfeff) {
|
|
393
441
|
content = content.slice(1);
|
|
394
442
|
}
|
|
395
443
|
return content;
|
|
@@ -405,10 +453,18 @@ const stripBOM = (content) => {
|
|
|
405
453
|
* @returns {void}
|
|
406
454
|
*/
|
|
407
455
|
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
408
|
-
constructor.prototype = Object.create(
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
456
|
+
constructor.prototype = Object.create(
|
|
457
|
+
superConstructor.prototype,
|
|
458
|
+
descriptors,
|
|
459
|
+
);
|
|
460
|
+
Object.defineProperty(constructor.prototype, "constructor", {
|
|
461
|
+
value: constructor,
|
|
462
|
+
writable: true,
|
|
463
|
+
enumerable: false,
|
|
464
|
+
configurable: true,
|
|
465
|
+
});
|
|
466
|
+
Object.defineProperty(constructor, "super", {
|
|
467
|
+
value: superConstructor.prototype,
|
|
412
468
|
});
|
|
413
469
|
props && Object.assign(constructor.prototype, props);
|
|
414
470
|
};
|
|
@@ -437,13 +493,20 @@ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
|
|
|
437
493
|
i = props.length;
|
|
438
494
|
while (i-- > 0) {
|
|
439
495
|
prop = props[i];
|
|
440
|
-
if (
|
|
496
|
+
if (
|
|
497
|
+
(!propFilter || propFilter(prop, sourceObj, destObj)) &&
|
|
498
|
+
!merged[prop]
|
|
499
|
+
) {
|
|
441
500
|
destObj[prop] = sourceObj[prop];
|
|
442
501
|
merged[prop] = true;
|
|
443
502
|
}
|
|
444
503
|
}
|
|
445
504
|
sourceObj = filter !== false && getPrototypeOf(sourceObj);
|
|
446
|
-
} while (
|
|
505
|
+
} while (
|
|
506
|
+
sourceObj &&
|
|
507
|
+
(!filter || filter(sourceObj, destObj)) &&
|
|
508
|
+
sourceObj !== Object.prototype
|
|
509
|
+
);
|
|
447
510
|
|
|
448
511
|
return destObj;
|
|
449
512
|
};
|
|
@@ -467,7 +530,6 @@ const endsWith = (str, searchString, position) => {
|
|
|
467
530
|
return lastIndex !== -1 && lastIndex === position;
|
|
468
531
|
};
|
|
469
532
|
|
|
470
|
-
|
|
471
533
|
/**
|
|
472
534
|
* Returns new array from array like object or null if failed
|
|
473
535
|
*
|
|
@@ -496,12 +558,12 @@ const toArray = (thing) => {
|
|
|
496
558
|
* @returns {Array}
|
|
497
559
|
*/
|
|
498
560
|
// eslint-disable-next-line func-names
|
|
499
|
-
const isTypedArray = (TypedArray => {
|
|
561
|
+
const isTypedArray = ((TypedArray) => {
|
|
500
562
|
// eslint-disable-next-line func-names
|
|
501
|
-
return thing => {
|
|
563
|
+
return (thing) => {
|
|
502
564
|
return TypedArray && thing instanceof TypedArray;
|
|
503
565
|
};
|
|
504
|
-
})(typeof Uint8Array !==
|
|
566
|
+
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
505
567
|
|
|
506
568
|
/**
|
|
507
569
|
* For each entry in the object, call the function with the key and value.
|
|
@@ -544,18 +606,22 @@ const matchAll = (regExp, str) => {
|
|
|
544
606
|
};
|
|
545
607
|
|
|
546
608
|
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
|
|
547
|
-
const isHTMLForm = kindOfTest(
|
|
609
|
+
const isHTMLForm = kindOfTest("HTMLFormElement");
|
|
548
610
|
|
|
549
|
-
const toCamelCase = str => {
|
|
550
|
-
return str
|
|
551
|
-
|
|
611
|
+
const toCamelCase = (str) => {
|
|
612
|
+
return str
|
|
613
|
+
.toLowerCase()
|
|
614
|
+
.replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
552
615
|
return p1.toUpperCase() + p2;
|
|
553
|
-
}
|
|
554
|
-
);
|
|
616
|
+
});
|
|
555
617
|
};
|
|
556
618
|
|
|
557
619
|
/* Creating a function that will check if an object has a property. */
|
|
558
|
-
const hasOwnProperty = (
|
|
620
|
+
const hasOwnProperty = (
|
|
621
|
+
({ hasOwnProperty }) =>
|
|
622
|
+
(obj, prop) =>
|
|
623
|
+
hasOwnProperty.call(obj, prop)
|
|
624
|
+
)(Object.prototype);
|
|
559
625
|
|
|
560
626
|
/**
|
|
561
627
|
* Determine if a value is a RegExp object
|
|
@@ -564,7 +630,7 @@ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call
|
|
|
564
630
|
*
|
|
565
631
|
* @returns {boolean} True if value is a RegExp object, otherwise false
|
|
566
632
|
*/
|
|
567
|
-
const isRegExp = kindOfTest(
|
|
633
|
+
const isRegExp = kindOfTest("RegExp");
|
|
568
634
|
|
|
569
635
|
const reduceDescriptors = (obj, reducer) => {
|
|
570
636
|
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
@@ -588,7 +654,10 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
588
654
|
const freezeMethods = (obj) => {
|
|
589
655
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
590
656
|
// skip restricted props in strict mode
|
|
591
|
-
if (
|
|
657
|
+
if (
|
|
658
|
+
isFunction(obj) &&
|
|
659
|
+
["arguments", "caller", "callee"].indexOf(name) !== -1
|
|
660
|
+
) {
|
|
592
661
|
return false;
|
|
593
662
|
}
|
|
594
663
|
|
|
@@ -598,14 +667,14 @@ const freezeMethods = (obj) => {
|
|
|
598
667
|
|
|
599
668
|
descriptor.enumerable = false;
|
|
600
669
|
|
|
601
|
-
if (
|
|
670
|
+
if ("writable" in descriptor) {
|
|
602
671
|
descriptor.writable = false;
|
|
603
672
|
return;
|
|
604
673
|
}
|
|
605
674
|
|
|
606
675
|
if (!descriptor.set) {
|
|
607
676
|
descriptor.set = () => {
|
|
608
|
-
throw Error(
|
|
677
|
+
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
609
678
|
};
|
|
610
679
|
}
|
|
611
680
|
});
|
|
@@ -615,12 +684,14 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
615
684
|
const obj = {};
|
|
616
685
|
|
|
617
686
|
const define = (arr) => {
|
|
618
|
-
arr.forEach(value => {
|
|
687
|
+
arr.forEach((value) => {
|
|
619
688
|
obj[value] = true;
|
|
620
689
|
});
|
|
621
690
|
};
|
|
622
691
|
|
|
623
|
-
isArray(arrayOrString)
|
|
692
|
+
isArray(arrayOrString)
|
|
693
|
+
? define(arrayOrString)
|
|
694
|
+
: define(String(arrayOrString).split(delimiter));
|
|
624
695
|
|
|
625
696
|
return obj;
|
|
626
697
|
};
|
|
@@ -628,11 +699,11 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
628
699
|
const noop = () => {};
|
|
629
700
|
|
|
630
701
|
const toFiniteNumber = (value, defaultValue) => {
|
|
631
|
-
return value != null && Number.isFinite(value = +value)
|
|
702
|
+
return value != null && Number.isFinite((value = +value))
|
|
703
|
+
? value
|
|
704
|
+
: defaultValue;
|
|
632
705
|
};
|
|
633
706
|
|
|
634
|
-
|
|
635
|
-
|
|
636
707
|
/**
|
|
637
708
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
638
709
|
*
|
|
@@ -641,14 +712,18 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
|
641
712
|
* @returns {boolean}
|
|
642
713
|
*/
|
|
643
714
|
function isSpecCompliantForm(thing) {
|
|
644
|
-
return !!(
|
|
715
|
+
return !!(
|
|
716
|
+
thing &&
|
|
717
|
+
isFunction(thing.append) &&
|
|
718
|
+
thing[toStringTag] === "FormData" &&
|
|
719
|
+
thing[iterator]
|
|
720
|
+
);
|
|
645
721
|
}
|
|
646
722
|
|
|
647
723
|
const toJSONObject = (obj) => {
|
|
648
724
|
const stack = new Array(10);
|
|
649
725
|
|
|
650
726
|
const visit = (source, i) => {
|
|
651
|
-
|
|
652
727
|
if (isObject(source)) {
|
|
653
728
|
if (stack.indexOf(source) >= 0) {
|
|
654
729
|
return;
|
|
@@ -659,7 +734,7 @@ const toJSONObject = (obj) => {
|
|
|
659
734
|
return source;
|
|
660
735
|
}
|
|
661
736
|
|
|
662
|
-
if(!(
|
|
737
|
+
if (!("toJSON" in source)) {
|
|
663
738
|
stack[i] = source;
|
|
664
739
|
const target = isArray(source) ? [] : {};
|
|
665
740
|
|
|
@@ -680,10 +755,13 @@ const toJSONObject = (obj) => {
|
|
|
680
755
|
return visit(obj, 0);
|
|
681
756
|
};
|
|
682
757
|
|
|
683
|
-
const isAsyncFn = kindOfTest(
|
|
758
|
+
const isAsyncFn = kindOfTest("AsyncFunction");
|
|
684
759
|
|
|
685
760
|
const isThenable = (thing) =>
|
|
686
|
-
thing &&
|
|
761
|
+
thing &&
|
|
762
|
+
(isObject(thing) || isFunction(thing)) &&
|
|
763
|
+
isFunction(thing.then) &&
|
|
764
|
+
isFunction(thing.catch);
|
|
687
765
|
|
|
688
766
|
// original code
|
|
689
767
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
@@ -693,32 +771,35 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
|
693
771
|
return setImmediate;
|
|
694
772
|
}
|
|
695
773
|
|
|
696
|
-
return postMessageSupported
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
774
|
+
return postMessageSupported
|
|
775
|
+
? ((token, callbacks) => {
|
|
776
|
+
_global.addEventListener(
|
|
777
|
+
"message",
|
|
778
|
+
({ source, data }) => {
|
|
779
|
+
if (source === _global && data === token) {
|
|
780
|
+
callbacks.length && callbacks.shift()();
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
false,
|
|
784
|
+
);
|
|
785
|
+
|
|
786
|
+
return (cb) => {
|
|
787
|
+
callbacks.push(cb);
|
|
788
|
+
_global.postMessage(token, "*");
|
|
789
|
+
};
|
|
790
|
+
})(`axios@${Math.random()}`, [])
|
|
791
|
+
: (cb) => setTimeout(cb);
|
|
792
|
+
})(typeof setImmediate === "function", isFunction(_global.postMessage));
|
|
793
|
+
|
|
794
|
+
const asap =
|
|
795
|
+
typeof queueMicrotask !== "undefined"
|
|
796
|
+
? queueMicrotask.bind(_global)
|
|
797
|
+
: (typeof process !== "undefined" && process.nextTick) || _setImmediate;
|
|
715
798
|
|
|
716
799
|
// *********************
|
|
717
800
|
|
|
718
|
-
|
|
719
801
|
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
720
802
|
|
|
721
|
-
|
|
722
803
|
var utils = {
|
|
723
804
|
isArray,
|
|
724
805
|
isArrayBuffer,
|
|
@@ -776,7 +857,7 @@ var utils = {
|
|
|
776
857
|
isThenable,
|
|
777
858
|
setImmediate: _setImmediate,
|
|
778
859
|
asap,
|
|
779
|
-
isIterable
|
|
860
|
+
isIterable,
|
|
780
861
|
};
|
|
781
862
|
|
|
782
863
|
export { utils as default };
|
|
@@ -6,8 +6,8 @@ var hasRequiredDefaultLocale;
|
|
|
6
6
|
function requireDefaultLocale () {
|
|
7
7
|
if (hasRequiredDefaultLocale) return defaultLocale;
|
|
8
8
|
hasRequiredDefaultLocale = 1;
|
|
9
|
-
(function (exports) {
|
|
10
|
-
Object.defineProperty(exports, "defaultLocale", {
|
|
9
|
+
(function (exports$1) {
|
|
10
|
+
Object.defineProperty(exports$1, "defaultLocale", {
|
|
11
11
|
enumerable: true,
|
|
12
12
|
get: function () {
|
|
13
13
|
return _index.enUS;
|