contentful 11.2.1 → 11.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contentful.browser.js +1236 -1522
- package/dist/contentful.browser.min.js +1 -1
- package/dist/contentful.cjs +960 -1364
- package/dist/esm/contentful.js +1 -1
- package/dist/esm/create-contentful-api.js +1 -1
- package/dist/stats-browser-min.html +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var contentful = (function (exports) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
function asyncGeneratorStep
|
|
4
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
5
5
|
try {
|
|
6
6
|
var i = n[a](c),
|
|
7
7
|
u = i.value;
|
|
@@ -10,17 +10,17 @@ var contentful = (function (exports) {
|
|
|
10
10
|
}
|
|
11
11
|
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
12
12
|
}
|
|
13
|
-
function _asyncToGenerator
|
|
13
|
+
function _asyncToGenerator(n) {
|
|
14
14
|
return function () {
|
|
15
15
|
var t = this,
|
|
16
16
|
e = arguments;
|
|
17
17
|
return new Promise(function (r, o) {
|
|
18
18
|
var a = n.apply(t, e);
|
|
19
19
|
function _next(n) {
|
|
20
|
-
asyncGeneratorStep
|
|
20
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
21
21
|
}
|
|
22
22
|
function _throw(n) {
|
|
23
|
-
asyncGeneratorStep
|
|
23
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
24
24
|
}
|
|
25
25
|
_next(void 0);
|
|
26
26
|
});
|
|
@@ -57,34 +57,34 @@ var contentful = (function (exports) {
|
|
|
57
57
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$4(r) || _nonIterableSpread();
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
function _arrayWithHoles
|
|
60
|
+
function _arrayWithHoles(r) {
|
|
61
61
|
if (Array.isArray(r)) return r;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function _nonIterableRest
|
|
64
|
+
function _nonIterableRest() {
|
|
65
65
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
function _toArray(r) {
|
|
69
|
-
return _arrayWithHoles
|
|
69
|
+
return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$4(r) || _nonIterableRest();
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
function _typeof$
|
|
72
|
+
function _typeof$2(o) {
|
|
73
73
|
"@babel/helpers - typeof";
|
|
74
74
|
|
|
75
|
-
return _typeof$
|
|
75
|
+
return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
76
76
|
return typeof o;
|
|
77
77
|
} : function (o) {
|
|
78
78
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
79
|
-
}, _typeof$
|
|
79
|
+
}, _typeof$2(o);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
function toPrimitive(t, r) {
|
|
83
|
-
if ("object" != _typeof$
|
|
83
|
+
if ("object" != _typeof$2(t) || !t) return t;
|
|
84
84
|
var e = t[Symbol.toPrimitive];
|
|
85
85
|
if (void 0 !== e) {
|
|
86
86
|
var i = e.call(t, r || "default");
|
|
87
|
-
if ("object" != _typeof$
|
|
87
|
+
if ("object" != _typeof$2(i)) return i;
|
|
88
88
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
89
89
|
}
|
|
90
90
|
return ("string" === r ? String : Number)(t);
|
|
@@ -92,10 +92,10 @@ var contentful = (function (exports) {
|
|
|
92
92
|
|
|
93
93
|
function toPropertyKey(t) {
|
|
94
94
|
var i = toPrimitive(t, "string");
|
|
95
|
-
return "symbol" == _typeof$
|
|
95
|
+
return "symbol" == _typeof$2(i) ? i : i + "";
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
function _defineProperty
|
|
98
|
+
function _defineProperty(e, r, t) {
|
|
99
99
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
100
100
|
value: t,
|
|
101
101
|
enumerable: !0,
|
|
@@ -120,7 +120,7 @@ var contentful = (function (exports) {
|
|
|
120
120
|
}), e;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
function _iterableToArrayLimit
|
|
123
|
+
function _iterableToArrayLimit(r, l) {
|
|
124
124
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
125
125
|
if (null != t) {
|
|
126
126
|
var e,
|
|
@@ -148,8 +148,8 @@ var contentful = (function (exports) {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
function _slicedToArray$
|
|
152
|
-
return _arrayWithHoles
|
|
151
|
+
function _slicedToArray$1(r, e) {
|
|
152
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$4(r, e) || _nonIterableRest();
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
function _OverloadYield(e, d) {
|
|
@@ -261,7 +261,7 @@ var contentful = (function (exports) {
|
|
|
261
261
|
|
|
262
262
|
var regeneratorRuntime$1 = {exports: {}};
|
|
263
263
|
|
|
264
|
-
var _typeof$
|
|
264
|
+
var _typeof$1 = {exports: {}};
|
|
265
265
|
|
|
266
266
|
(function (module) {
|
|
267
267
|
function _typeof(o) {
|
|
@@ -274,8 +274,8 @@ var contentful = (function (exports) {
|
|
|
274
274
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
|
|
275
275
|
}
|
|
276
276
|
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
277
|
-
})(_typeof$
|
|
278
|
-
var _typeofExports = _typeof$
|
|
277
|
+
})(_typeof$1);
|
|
278
|
+
var _typeofExports = _typeof$1.exports;
|
|
279
279
|
|
|
280
280
|
(function (module) {
|
|
281
281
|
var _typeof = _typeofExports["default"];
|
|
@@ -595,19 +595,19 @@ var contentful = (function (exports) {
|
|
|
595
595
|
try {
|
|
596
596
|
regeneratorRuntime = runtime;
|
|
597
597
|
} catch (accidentalStrictMode) {
|
|
598
|
-
if ((typeof globalThis === "undefined" ? "undefined" : _typeof$
|
|
598
|
+
if ((typeof globalThis === "undefined" ? "undefined" : _typeof$2(globalThis)) === "object") {
|
|
599
599
|
globalThis.regeneratorRuntime = runtime;
|
|
600
600
|
} else {
|
|
601
601
|
Function("r", "regeneratorRuntime = r")(runtime);
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
|
-
var _regeneratorRuntime
|
|
604
|
+
var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
|
|
605
605
|
|
|
606
606
|
function _createForOfIteratorHelper$3(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$3(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
607
607
|
function _unsupportedIterableToArray$3(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$3(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0; } }
|
|
608
608
|
function _arrayLikeToArray$3(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
609
609
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
610
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty
|
|
610
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
611
611
|
function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
|
|
612
612
|
function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(r) { var n = this.s.return; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, throw: function _throw(r) { var n = this.s.return; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }
|
|
613
613
|
function bind$2(fn, thisArg) {
|
|
@@ -619,7 +619,7 @@ var contentful = (function (exports) {
|
|
|
619
619
|
// utils is a library of generic helper functions non-specific to axios
|
|
620
620
|
|
|
621
621
|
var toString = Object.prototype.toString;
|
|
622
|
-
var getPrototypeOf = Object.getPrototypeOf;
|
|
622
|
+
var getPrototypeOf$1 = Object.getPrototypeOf;
|
|
623
623
|
var kindOf = function (cache) {
|
|
624
624
|
return function (thing) {
|
|
625
625
|
var str = toString.call(thing);
|
|
@@ -634,7 +634,7 @@ var contentful = (function (exports) {
|
|
|
634
634
|
};
|
|
635
635
|
var typeOfTest = function typeOfTest(type) {
|
|
636
636
|
return function (thing) {
|
|
637
|
-
return _typeof$
|
|
637
|
+
return _typeof$2(thing) === type;
|
|
638
638
|
};
|
|
639
639
|
};
|
|
640
640
|
|
|
@@ -645,7 +645,7 @@ var contentful = (function (exports) {
|
|
|
645
645
|
*
|
|
646
646
|
* @returns {boolean} True if value is an Array, otherwise false
|
|
647
647
|
*/
|
|
648
|
-
var isArray$
|
|
648
|
+
var isArray$7 = Array.isArray;
|
|
649
649
|
|
|
650
650
|
/**
|
|
651
651
|
* Determine if a value is undefined
|
|
@@ -727,7 +727,7 @@ var contentful = (function (exports) {
|
|
|
727
727
|
* @returns {boolean} True if value is an Object, otherwise false
|
|
728
728
|
*/
|
|
729
729
|
var isObject = function isObject(thing) {
|
|
730
|
-
return thing !== null && _typeof$
|
|
730
|
+
return thing !== null && _typeof$2(thing) === 'object';
|
|
731
731
|
};
|
|
732
732
|
|
|
733
733
|
/**
|
|
@@ -751,7 +751,7 @@ var contentful = (function (exports) {
|
|
|
751
751
|
if (kindOf(val) !== 'object') {
|
|
752
752
|
return false;
|
|
753
753
|
}
|
|
754
|
-
var prototype = getPrototypeOf(val);
|
|
754
|
+
var prototype = getPrototypeOf$1(val);
|
|
755
755
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
|
|
756
756
|
};
|
|
757
757
|
|
|
@@ -825,7 +825,7 @@ var contentful = (function (exports) {
|
|
|
825
825
|
*/
|
|
826
826
|
var isURLSearchParams = kindOfTest('URLSearchParams');
|
|
827
827
|
var _map = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest),
|
|
828
|
-
_map2 = _slicedToArray$
|
|
828
|
+
_map2 = _slicedToArray$1(_map, 4),
|
|
829
829
|
isReadableStream = _map2[0],
|
|
830
830
|
isRequest = _map2[1],
|
|
831
831
|
isResponse = _map2[2],
|
|
@@ -869,11 +869,11 @@ var contentful = (function (exports) {
|
|
|
869
869
|
var l;
|
|
870
870
|
|
|
871
871
|
// Force an array if not already something iterable
|
|
872
|
-
if (_typeof$
|
|
872
|
+
if (_typeof$2(obj) !== 'object') {
|
|
873
873
|
/*eslint no-param-reassign:0*/
|
|
874
874
|
obj = [obj];
|
|
875
875
|
}
|
|
876
|
-
if (isArray$
|
|
876
|
+
if (isArray$7(obj)) {
|
|
877
877
|
// Iterate over array values
|
|
878
878
|
for (i = 0, l = obj.length; i < l; i++) {
|
|
879
879
|
fn.call(null, obj[i], i, obj);
|
|
@@ -940,7 +940,7 @@ var contentful = (function (exports) {
|
|
|
940
940
|
result[targetKey] = merge$1(result[targetKey], val);
|
|
941
941
|
} else if (isPlainObject$2(val)) {
|
|
942
942
|
result[targetKey] = merge$1({}, val);
|
|
943
|
-
} else if (isArray$
|
|
943
|
+
} else if (isArray$7(val)) {
|
|
944
944
|
result[targetKey] = val.slice();
|
|
945
945
|
} else {
|
|
946
946
|
result[targetKey] = val;
|
|
@@ -1036,7 +1036,7 @@ var contentful = (function (exports) {
|
|
|
1036
1036
|
merged[prop] = true;
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
sourceObj = filter !== false && getPrototypeOf(sourceObj);
|
|
1039
|
+
sourceObj = filter !== false && getPrototypeOf$1(sourceObj);
|
|
1040
1040
|
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
1041
1041
|
return destObj;
|
|
1042
1042
|
};
|
|
@@ -1069,7 +1069,7 @@ var contentful = (function (exports) {
|
|
|
1069
1069
|
*/
|
|
1070
1070
|
var toArray = function toArray(thing) {
|
|
1071
1071
|
if (!thing) return null;
|
|
1072
|
-
if (isArray$
|
|
1072
|
+
if (isArray$7(thing)) return thing;
|
|
1073
1073
|
var i = thing.length;
|
|
1074
1074
|
if (!isNumber$1(i)) return null;
|
|
1075
1075
|
var arr = new Array(i);
|
|
@@ -1093,7 +1093,7 @@ var contentful = (function (exports) {
|
|
|
1093
1093
|
return function (thing) {
|
|
1094
1094
|
return TypedArray && thing instanceof TypedArray;
|
|
1095
1095
|
};
|
|
1096
|
-
}(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
|
|
1096
|
+
}(typeof Uint8Array !== 'undefined' && getPrototypeOf$1(Uint8Array));
|
|
1097
1097
|
|
|
1098
1098
|
/**
|
|
1099
1099
|
* For each entry in the object, call the function with the key and value.
|
|
@@ -1139,7 +1139,7 @@ var contentful = (function (exports) {
|
|
|
1139
1139
|
};
|
|
1140
1140
|
|
|
1141
1141
|
/* Creating a function that will check if an object has a property. */
|
|
1142
|
-
var hasOwnProperty$
|
|
1142
|
+
var hasOwnProperty$3 = function (_ref6) {
|
|
1143
1143
|
var hasOwnProperty = _ref6.hasOwnProperty;
|
|
1144
1144
|
return function (obj, prop) {
|
|
1145
1145
|
return hasOwnProperty.call(obj, prop);
|
|
@@ -1198,10 +1198,10 @@ var contentful = (function (exports) {
|
|
|
1198
1198
|
obj[value] = true;
|
|
1199
1199
|
});
|
|
1200
1200
|
};
|
|
1201
|
-
isArray$
|
|
1201
|
+
isArray$7(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
1202
1202
|
return obj;
|
|
1203
1203
|
};
|
|
1204
|
-
var noop$
|
|
1204
|
+
var noop$2 = function noop() {};
|
|
1205
1205
|
var toFiniteNumber = function toFiniteNumber(value, defaultValue) {
|
|
1206
1206
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
1207
1207
|
};
|
|
@@ -1242,7 +1242,7 @@ var contentful = (function (exports) {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
if (!('toJSON' in source)) {
|
|
1244
1244
|
stack[i] = source;
|
|
1245
|
-
var target = isArray$
|
|
1245
|
+
var target = isArray$7(source) ? [] : {};
|
|
1246
1246
|
forEach(source, function (value, key) {
|
|
1247
1247
|
var reducedValue = _visit(value, i + 1);
|
|
1248
1248
|
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
@@ -1288,7 +1288,7 @@ var contentful = (function (exports) {
|
|
|
1288
1288
|
// *********************
|
|
1289
1289
|
|
|
1290
1290
|
var utils$1$1 = {
|
|
1291
|
-
isArray: isArray$
|
|
1291
|
+
isArray: isArray$7,
|
|
1292
1292
|
isArrayBuffer: isArrayBuffer,
|
|
1293
1293
|
isBuffer: isBuffer$1,
|
|
1294
1294
|
isFormData: isFormData,
|
|
@@ -1326,14 +1326,14 @@ var contentful = (function (exports) {
|
|
|
1326
1326
|
forEachEntry: forEachEntry,
|
|
1327
1327
|
matchAll: matchAll,
|
|
1328
1328
|
isHTMLForm: isHTMLForm,
|
|
1329
|
-
hasOwnProperty: hasOwnProperty$
|
|
1330
|
-
hasOwnProp: hasOwnProperty$
|
|
1329
|
+
hasOwnProperty: hasOwnProperty$3,
|
|
1330
|
+
hasOwnProp: hasOwnProperty$3,
|
|
1331
1331
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
1332
1332
|
reduceDescriptors: reduceDescriptors,
|
|
1333
1333
|
freezeMethods: freezeMethods,
|
|
1334
1334
|
toObjectSet: toObjectSet,
|
|
1335
1335
|
toCamelCase: toCamelCase,
|
|
1336
|
-
noop: noop$
|
|
1336
|
+
noop: noop$2,
|
|
1337
1337
|
toFiniteNumber: toFiniteNumber,
|
|
1338
1338
|
findKey: findKey,
|
|
1339
1339
|
global: _global,
|
|
@@ -1559,7 +1559,7 @@ var contentful = (function (exports) {
|
|
|
1559
1559
|
*/
|
|
1560
1560
|
function defaultVisitor(value, key, path) {
|
|
1561
1561
|
var arr = value;
|
|
1562
|
-
if (value && !path && _typeof$
|
|
1562
|
+
if (value && !path && _typeof$2(value) === 'object') {
|
|
1563
1563
|
if (utils$1$1.endsWith(key, '{}')) {
|
|
1564
1564
|
// eslint-disable-next-line no-param-reassign
|
|
1565
1565
|
key = metaTokens ? key : key.slice(0, -2);
|
|
@@ -1794,7 +1794,7 @@ var contentful = (function (exports) {
|
|
|
1794
1794
|
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
|
1795
1795
|
};
|
|
1796
1796
|
var hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
1797
|
-
var _navigator = (typeof navigator === "undefined" ? "undefined" : _typeof$
|
|
1797
|
+
var _navigator = (typeof navigator === "undefined" ? "undefined" : _typeof$2(navigator)) === 'object' && navigator || undefined;
|
|
1798
1798
|
|
|
1799
1799
|
/**
|
|
1800
1800
|
* Determine if we're running in a standard browser environment
|
|
@@ -1838,7 +1838,7 @@ var contentful = (function (exports) {
|
|
|
1838
1838
|
navigator: _navigator,
|
|
1839
1839
|
origin: origin
|
|
1840
1840
|
});
|
|
1841
|
-
var platform = _objectSpread(_objectSpread({}, utils$3), platform$1);
|
|
1841
|
+
var platform = _objectSpread$1(_objectSpread$1({}, utils$3), platform$1);
|
|
1842
1842
|
function toURLEncodedForm(data, options) {
|
|
1843
1843
|
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
|
1844
1844
|
visitor: function visitor(value, key, path, helpers) {
|
|
@@ -2173,7 +2173,7 @@ var contentful = (function (exports) {
|
|
|
2173
2173
|
_step2;
|
|
2174
2174
|
try {
|
|
2175
2175
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
2176
|
-
var _step2$value = _slicedToArray$
|
|
2176
|
+
var _step2$value = _slicedToArray$1(_step2.value, 2),
|
|
2177
2177
|
key = _step2$value[0],
|
|
2178
2178
|
value = _step2$value[1];
|
|
2179
2179
|
setHeader(value, key, rewrite);
|
|
@@ -2307,7 +2307,7 @@ var contentful = (function (exports) {
|
|
|
2307
2307
|
key: "toString",
|
|
2308
2308
|
value: function toString() {
|
|
2309
2309
|
return Object.entries(this.toJSON()).map(function (_ref8) {
|
|
2310
|
-
var _ref9 = _slicedToArray$
|
|
2310
|
+
var _ref9 = _slicedToArray$1(_ref8, 2),
|
|
2311
2311
|
header = _ref9[0],
|
|
2312
2312
|
value = _ref9[1];
|
|
2313
2313
|
return header + ': ' + value;
|
|
@@ -2531,7 +2531,7 @@ var contentful = (function (exports) {
|
|
|
2531
2531
|
var rate = _speedometer(progressBytes);
|
|
2532
2532
|
var inRange = loaded <= total;
|
|
2533
2533
|
bytesNotified = loaded;
|
|
2534
|
-
var data = _defineProperty
|
|
2534
|
+
var data = _defineProperty({
|
|
2535
2535
|
loaded: loaded,
|
|
2536
2536
|
total: total,
|
|
2537
2537
|
progress: total ? loaded / total : undefined,
|
|
@@ -2689,7 +2689,7 @@ var contentful = (function (exports) {
|
|
|
2689
2689
|
return requestedURL;
|
|
2690
2690
|
}
|
|
2691
2691
|
var headersToObject = function headersToObject(thing) {
|
|
2692
|
-
return thing instanceof AxiosHeaders$1 ? _objectSpread({}, thing) : thing;
|
|
2692
|
+
return thing instanceof AxiosHeaders$1 ? _objectSpread$1({}, thing) : thing;
|
|
2693
2693
|
};
|
|
2694
2694
|
|
|
2695
2695
|
/**
|
|
@@ -2968,7 +2968,7 @@ var contentful = (function (exports) {
|
|
|
2968
2968
|
// Handle progress if needed
|
|
2969
2969
|
if (onDownloadProgress) {
|
|
2970
2970
|
var _progressEventReducer = progressEventReducer(onDownloadProgress, true);
|
|
2971
|
-
var _progressEventReducer2 = _slicedToArray$
|
|
2971
|
+
var _progressEventReducer2 = _slicedToArray$1(_progressEventReducer, 2);
|
|
2972
2972
|
downloadThrottled = _progressEventReducer2[0];
|
|
2973
2973
|
flushDownload = _progressEventReducer2[1];
|
|
2974
2974
|
request.addEventListener('progress', downloadThrottled);
|
|
@@ -2977,7 +2977,7 @@ var contentful = (function (exports) {
|
|
|
2977
2977
|
// Not all browsers support upload events
|
|
2978
2978
|
if (onUploadProgress && request.upload) {
|
|
2979
2979
|
var _progressEventReducer3 = progressEventReducer(onUploadProgress);
|
|
2980
|
-
var _progressEventReducer4 = _slicedToArray$
|
|
2980
|
+
var _progressEventReducer4 = _slicedToArray$1(_progressEventReducer3, 2);
|
|
2981
2981
|
uploadThrottled = _progressEventReducer4[0];
|
|
2982
2982
|
flushUpload = _progressEventReducer4[1];
|
|
2983
2983
|
request.upload.addEventListener('progress', uploadThrottled);
|
|
@@ -3048,9 +3048,9 @@ var contentful = (function (exports) {
|
|
|
3048
3048
|
}
|
|
3049
3049
|
};
|
|
3050
3050
|
var composeSignals$1 = composeSignals;
|
|
3051
|
-
var streamChunk = /*#__PURE__*/_regeneratorRuntime
|
|
3051
|
+
var streamChunk = /*#__PURE__*/_regeneratorRuntime.mark(function streamChunk(chunk, chunkSize) {
|
|
3052
3052
|
var len, pos, end;
|
|
3053
|
-
return _regeneratorRuntime
|
|
3053
|
+
return _regeneratorRuntime.wrap(function streamChunk$(_context) {
|
|
3054
3054
|
while (1) switch (_context.prev = _context.next) {
|
|
3055
3055
|
case 0:
|
|
3056
3056
|
len = chunk.byteLength;
|
|
@@ -3083,9 +3083,9 @@ var contentful = (function (exports) {
|
|
|
3083
3083
|
}, streamChunk);
|
|
3084
3084
|
});
|
|
3085
3085
|
var readBytes = /*#__PURE__*/function () {
|
|
3086
|
-
var _ref = _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime
|
|
3086
|
+
var _ref = _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(iterable, chunkSize) {
|
|
3087
3087
|
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk;
|
|
3088
|
-
return _regeneratorRuntime
|
|
3088
|
+
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
3089
3089
|
while (1) switch (_context2.prev = _context2.next) {
|
|
3090
3090
|
case 0:
|
|
3091
3091
|
_iteratorAbruptCompletion = false;
|
|
@@ -3145,9 +3145,9 @@ var contentful = (function (exports) {
|
|
|
3145
3145
|
};
|
|
3146
3146
|
}();
|
|
3147
3147
|
var readStream = /*#__PURE__*/function () {
|
|
3148
|
-
var _ref2 = _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime
|
|
3148
|
+
var _ref2 = _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(stream) {
|
|
3149
3149
|
var reader, _yield$_awaitAsyncGen, done, value;
|
|
3150
|
-
return _regeneratorRuntime
|
|
3150
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context3) {
|
|
3151
3151
|
while (1) switch (_context3.prev = _context3.next) {
|
|
3152
3152
|
case 0:
|
|
3153
3153
|
if (!stream[Symbol.asyncIterator]) {
|
|
@@ -3206,9 +3206,9 @@ var contentful = (function (exports) {
|
|
|
3206
3206
|
};
|
|
3207
3207
|
return new ReadableStream({
|
|
3208
3208
|
pull: function pull(controller) {
|
|
3209
|
-
return _asyncToGenerator
|
|
3209
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
3210
3210
|
var _yield$iterator$next, _done, value, len, loadedBytes;
|
|
3211
|
-
return _regeneratorRuntime
|
|
3211
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context4) {
|
|
3212
3212
|
while (1) switch (_context4.prev = _context4.next) {
|
|
3213
3213
|
case 0:
|
|
3214
3214
|
_context4.prev = 0;
|
|
@@ -3263,8 +3263,8 @@ var contentful = (function (exports) {
|
|
|
3263
3263
|
return encoder.encode(str);
|
|
3264
3264
|
};
|
|
3265
3265
|
}(new TextEncoder()) : (/*#__PURE__*/function () {
|
|
3266
|
-
var _ref13 = _asyncToGenerator
|
|
3267
|
-
return _regeneratorRuntime
|
|
3266
|
+
var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(str) {
|
|
3267
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context5) {
|
|
3268
3268
|
while (1) switch (_context5.prev = _context5.next) {
|
|
3269
3269
|
case 0:
|
|
3270
3270
|
_context5.t0 = Uint8Array;
|
|
@@ -3324,9 +3324,9 @@ var contentful = (function (exports) {
|
|
|
3324
3324
|
});
|
|
3325
3325
|
}(new Response());
|
|
3326
3326
|
var getBodyLength = /*#__PURE__*/function () {
|
|
3327
|
-
var _ref14 = _asyncToGenerator
|
|
3327
|
+
var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(body) {
|
|
3328
3328
|
var _request;
|
|
3329
|
-
return _regeneratorRuntime
|
|
3329
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
|
3330
3330
|
while (1) switch (_context6.prev = _context6.next) {
|
|
3331
3331
|
case 0:
|
|
3332
3332
|
if (!(body == null)) {
|
|
@@ -3382,9 +3382,9 @@ var contentful = (function (exports) {
|
|
|
3382
3382
|
};
|
|
3383
3383
|
}();
|
|
3384
3384
|
var resolveBodyLength = /*#__PURE__*/function () {
|
|
3385
|
-
var _ref15 = _asyncToGenerator
|
|
3385
|
+
var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(headers, body) {
|
|
3386
3386
|
var length;
|
|
3387
|
-
return _regeneratorRuntime
|
|
3387
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
|
3388
3388
|
while (1) switch (_context7.prev = _context7.next) {
|
|
3389
3389
|
case 0:
|
|
3390
3390
|
length = utils$1$1.toFiniteNumber(headers.getContentLength());
|
|
@@ -3400,9 +3400,9 @@ var contentful = (function (exports) {
|
|
|
3400
3400
|
};
|
|
3401
3401
|
}();
|
|
3402
3402
|
var fetchAdapter = isFetchSupported && (/*#__PURE__*/function () {
|
|
3403
|
-
var _ref16 = _asyncToGenerator
|
|
3403
|
+
var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(config) {
|
|
3404
3404
|
var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, composedSignal, request, unsubscribe, requestContentLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, response, isStreamResponse, options, responseContentLength, _ref17, _ref18, _onProgress, _flush, responseData;
|
|
3405
|
-
return _regeneratorRuntime
|
|
3405
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context8) {
|
|
3406
3406
|
while (1) switch (_context8.prev = _context8.next) {
|
|
3407
3407
|
case 0:
|
|
3408
3408
|
_resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions;
|
|
@@ -3436,7 +3436,7 @@ var contentful = (function (exports) {
|
|
|
3436
3436
|
headers.setContentType(contentTypeHeader);
|
|
3437
3437
|
}
|
|
3438
3438
|
if (_request.body) {
|
|
3439
|
-
_progressEventDecorat = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))), _progressEventDecorat2 = _slicedToArray$
|
|
3439
|
+
_progressEventDecorat = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))), _progressEventDecorat2 = _slicedToArray$1(_progressEventDecorat, 2), onProgress = _progressEventDecorat2[0], flush = _progressEventDecorat2[1];
|
|
3440
3440
|
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
3441
3441
|
}
|
|
3442
3442
|
case 15:
|
|
@@ -3447,7 +3447,7 @@ var contentful = (function (exports) {
|
|
|
3447
3447
|
// Cloudflare Workers throws when credentials are defined
|
|
3448
3448
|
// see https://github.com/cloudflare/workerd/issues/902
|
|
3449
3449
|
isCredentialsSupported = "credentials" in Request.prototype;
|
|
3450
|
-
request = new Request(url, _objectSpread(_objectSpread({}, fetchOptions), {}, {
|
|
3450
|
+
request = new Request(url, _objectSpread$1(_objectSpread$1({}, fetchOptions), {}, {
|
|
3451
3451
|
signal: composedSignal,
|
|
3452
3452
|
method: method.toUpperCase(),
|
|
3453
3453
|
headers: headers.normalize().toJSON(),
|
|
@@ -3466,7 +3466,7 @@ var contentful = (function (exports) {
|
|
|
3466
3466
|
options[prop] = response[prop];
|
|
3467
3467
|
});
|
|
3468
3468
|
responseContentLength = utils$1$1.toFiniteNumber(response.headers.get('content-length'));
|
|
3469
|
-
_ref17 = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], _ref18 = _slicedToArray$
|
|
3469
|
+
_ref17 = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], _ref18 = _slicedToArray$1(_ref17, 2), _onProgress = _ref18[0], _flush = _ref18[1];
|
|
3470
3470
|
response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, _onProgress, function () {
|
|
3471
3471
|
_flush && _flush();
|
|
3472
3472
|
unsubscribe && unsubscribe();
|
|
@@ -3564,7 +3564,7 @@ var contentful = (function (exports) {
|
|
|
3564
3564
|
}
|
|
3565
3565
|
if (!adapter) {
|
|
3566
3566
|
var reasons = Object.entries(rejectedReasons).map(function (_ref19) {
|
|
3567
|
-
var _ref20 = _slicedToArray$
|
|
3567
|
+
var _ref20 = _slicedToArray$1(_ref19, 2),
|
|
3568
3568
|
id = _ref20[0],
|
|
3569
3569
|
state = _ref20[1];
|
|
3570
3570
|
return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build');
|
|
@@ -3636,7 +3636,7 @@ var contentful = (function (exports) {
|
|
|
3636
3636
|
// eslint-disable-next-line func-names
|
|
3637
3637
|
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function (type, i) {
|
|
3638
3638
|
validators$1[type] = function validator(thing) {
|
|
3639
|
-
return _typeof$
|
|
3639
|
+
return _typeof$2(thing) === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
|
|
3640
3640
|
};
|
|
3641
3641
|
});
|
|
3642
3642
|
var deprecatedWarnings = {};
|
|
@@ -3680,7 +3680,7 @@ var contentful = (function (exports) {
|
|
|
3680
3680
|
*/
|
|
3681
3681
|
|
|
3682
3682
|
function assertOptions(options, schema, allowUnknown) {
|
|
3683
|
-
if (_typeof$
|
|
3683
|
+
if (_typeof$2(options) !== 'object') {
|
|
3684
3684
|
throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
|
|
3685
3685
|
}
|
|
3686
3686
|
var keys = Object.keys(options);
|
|
@@ -3735,9 +3735,9 @@ var contentful = (function (exports) {
|
|
|
3735
3735
|
return _createClass(Axios, [{
|
|
3736
3736
|
key: "request",
|
|
3737
3737
|
value: (function () {
|
|
3738
|
-
var _request2 = _asyncToGenerator
|
|
3738
|
+
var _request2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(configOrUrl, config) {
|
|
3739
3739
|
var dummy, stack;
|
|
3740
|
-
return _regeneratorRuntime
|
|
3740
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context9) {
|
|
3741
3741
|
while (1) switch (_context9.prev = _context9.next) {
|
|
3742
3742
|
case 0:
|
|
3743
3743
|
_context9.prev = 0;
|
|
@@ -4146,7 +4146,7 @@ var contentful = (function (exports) {
|
|
|
4146
4146
|
NetworkAuthenticationRequired: 511
|
|
4147
4147
|
};
|
|
4148
4148
|
Object.entries(HttpStatusCode).forEach(function (_ref21) {
|
|
4149
|
-
var _ref22 = _slicedToArray$
|
|
4149
|
+
var _ref22 = _slicedToArray$1(_ref21, 2),
|
|
4150
4150
|
key = _ref22[0],
|
|
4151
4151
|
value = _ref22[1];
|
|
4152
4152
|
HttpStatusCode[value] = key;
|
|
@@ -4221,369 +4221,404 @@ var contentful = (function (exports) {
|
|
|
4221
4221
|
var axios_1 = axios;
|
|
4222
4222
|
var axios$1 = /*@__PURE__*/getDefaultExportFromCjs(axios_1);
|
|
4223
4223
|
|
|
4224
|
-
var
|
|
4224
|
+
var toStringFunction = Function.prototype.toString;
|
|
4225
|
+
var create$1 = Object.create;
|
|
4226
|
+
var toStringObject = Object.prototype.toString;
|
|
4227
|
+
/**
|
|
4228
|
+
* @classdesc Fallback cache for when WeakMap is not natively supported
|
|
4229
|
+
*/
|
|
4230
|
+
var LegacyCache = /** @class */function () {
|
|
4231
|
+
function LegacyCache() {
|
|
4232
|
+
this._keys = [];
|
|
4233
|
+
this._values = [];
|
|
4234
|
+
}
|
|
4235
|
+
LegacyCache.prototype.has = function (key) {
|
|
4236
|
+
return !!~this._keys.indexOf(key);
|
|
4237
|
+
};
|
|
4238
|
+
LegacyCache.prototype.get = function (key) {
|
|
4239
|
+
return this._values[this._keys.indexOf(key)];
|
|
4240
|
+
};
|
|
4241
|
+
LegacyCache.prototype.set = function (key, value) {
|
|
4242
|
+
this._keys.push(key);
|
|
4243
|
+
this._values.push(value);
|
|
4244
|
+
};
|
|
4245
|
+
return LegacyCache;
|
|
4246
|
+
}();
|
|
4247
|
+
function createCacheLegacy() {
|
|
4248
|
+
return new LegacyCache();
|
|
4249
|
+
}
|
|
4250
|
+
function createCacheModern() {
|
|
4251
|
+
return new WeakMap();
|
|
4252
|
+
}
|
|
4253
|
+
/**
|
|
4254
|
+
* Get a new cache object to prevent circular references.
|
|
4255
|
+
*/
|
|
4256
|
+
var createCache = typeof WeakMap !== 'undefined' ? createCacheModern : createCacheLegacy;
|
|
4257
|
+
/**
|
|
4258
|
+
* Get an empty version of the object with the same prototype it has.
|
|
4259
|
+
*/
|
|
4260
|
+
function getCleanClone(prototype) {
|
|
4261
|
+
if (!prototype) {
|
|
4262
|
+
return create$1(null);
|
|
4263
|
+
}
|
|
4264
|
+
var Constructor = prototype.constructor;
|
|
4265
|
+
if (Constructor === Object) {
|
|
4266
|
+
return prototype === Object.prototype ? {} : create$1(prototype);
|
|
4267
|
+
}
|
|
4268
|
+
if (Constructor && ~toStringFunction.call(Constructor).indexOf('[native code]')) {
|
|
4269
|
+
try {
|
|
4270
|
+
return new Constructor();
|
|
4271
|
+
} catch (_a) {}
|
|
4272
|
+
}
|
|
4273
|
+
return create$1(prototype);
|
|
4274
|
+
}
|
|
4275
|
+
function getRegExpFlagsLegacy(regExp) {
|
|
4276
|
+
var flags = '';
|
|
4277
|
+
if (regExp.global) {
|
|
4278
|
+
flags += 'g';
|
|
4279
|
+
}
|
|
4280
|
+
if (regExp.ignoreCase) {
|
|
4281
|
+
flags += 'i';
|
|
4282
|
+
}
|
|
4283
|
+
if (regExp.multiline) {
|
|
4284
|
+
flags += 'm';
|
|
4285
|
+
}
|
|
4286
|
+
if (regExp.unicode) {
|
|
4287
|
+
flags += 'u';
|
|
4288
|
+
}
|
|
4289
|
+
if (regExp.sticky) {
|
|
4290
|
+
flags += 'y';
|
|
4291
|
+
}
|
|
4292
|
+
return flags;
|
|
4293
|
+
}
|
|
4294
|
+
function getRegExpFlagsModern(regExp) {
|
|
4295
|
+
return regExp.flags;
|
|
4296
|
+
}
|
|
4297
|
+
/**
|
|
4298
|
+
* Get the flags to apply to the copied regexp.
|
|
4299
|
+
*/
|
|
4300
|
+
var getRegExpFlags = /test/g.flags === 'g' ? getRegExpFlagsModern : getRegExpFlagsLegacy;
|
|
4301
|
+
function getTagLegacy(value) {
|
|
4302
|
+
var type = toStringObject.call(value);
|
|
4303
|
+
return type.substring(8, type.length - 1);
|
|
4304
|
+
}
|
|
4305
|
+
function getTagModern(value) {
|
|
4306
|
+
return value[Symbol.toStringTag] || getTagLegacy(value);
|
|
4307
|
+
}
|
|
4308
|
+
/**
|
|
4309
|
+
* Get the tag of the value passed, so that the correct copier can be used.
|
|
4310
|
+
*/
|
|
4311
|
+
var getTag = typeof Symbol !== 'undefined' ? getTagModern : getTagLegacy;
|
|
4312
|
+
var defineProperty = Object.defineProperty,
|
|
4313
|
+
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor,
|
|
4314
|
+
getOwnPropertyNames = Object.getOwnPropertyNames,
|
|
4315
|
+
getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
4316
|
+
var _a = Object.prototype,
|
|
4317
|
+
hasOwnProperty$2 = _a.hasOwnProperty,
|
|
4318
|
+
propertyIsEnumerable = _a.propertyIsEnumerable;
|
|
4319
|
+
var SUPPORTS_SYMBOL = typeof getOwnPropertySymbols === 'function';
|
|
4320
|
+
function getStrictPropertiesModern(object) {
|
|
4321
|
+
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
4322
|
+
}
|
|
4323
|
+
/**
|
|
4324
|
+
* Get the properites used when copying objects strictly. This includes both keys and symbols.
|
|
4325
|
+
*/
|
|
4326
|
+
var getStrictProperties = SUPPORTS_SYMBOL ? getStrictPropertiesModern : getOwnPropertyNames;
|
|
4327
|
+
/**
|
|
4328
|
+
* Striclty copy all properties contained on the object.
|
|
4329
|
+
*/
|
|
4330
|
+
function copyOwnPropertiesStrict(value, clone, state) {
|
|
4331
|
+
var properties = getStrictProperties(value);
|
|
4332
|
+
for (var index = 0, length_1 = properties.length, property = void 0, descriptor = void 0; index < length_1; ++index) {
|
|
4333
|
+
property = properties[index];
|
|
4334
|
+
if (property === 'callee' || property === 'caller') {
|
|
4335
|
+
continue;
|
|
4336
|
+
}
|
|
4337
|
+
descriptor = getOwnPropertyDescriptor(value, property);
|
|
4338
|
+
if (!descriptor) {
|
|
4339
|
+
// In extra edge cases where the property descriptor cannot be retrived, fall back to
|
|
4340
|
+
// the loose assignment.
|
|
4341
|
+
clone[property] = state.copier(value[property], state);
|
|
4342
|
+
continue;
|
|
4343
|
+
}
|
|
4344
|
+
// Only clone the value if actually a value, not a getter / setter.
|
|
4345
|
+
if (!descriptor.get && !descriptor.set) {
|
|
4346
|
+
descriptor.value = state.copier(descriptor.value, state);
|
|
4347
|
+
}
|
|
4348
|
+
try {
|
|
4349
|
+
defineProperty(clone, property, descriptor);
|
|
4350
|
+
} catch (error) {
|
|
4351
|
+
// Tee above can fail on node in edge cases, so fall back to the loose assignment.
|
|
4352
|
+
clone[property] = descriptor.value;
|
|
4353
|
+
}
|
|
4354
|
+
}
|
|
4355
|
+
return clone;
|
|
4356
|
+
}
|
|
4357
|
+
/**
|
|
4358
|
+
* Deeply copy the indexed values in the array.
|
|
4359
|
+
*/
|
|
4360
|
+
function copyArrayLoose(array, state) {
|
|
4361
|
+
var clone = new state.Constructor();
|
|
4362
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4363
|
+
state.cache.set(array, clone);
|
|
4364
|
+
for (var index = 0, length_2 = array.length; index < length_2; ++index) {
|
|
4365
|
+
clone[index] = state.copier(array[index], state);
|
|
4366
|
+
}
|
|
4367
|
+
return clone;
|
|
4368
|
+
}
|
|
4369
|
+
/**
|
|
4370
|
+
* Deeply copy the indexed values in the array, as well as any custom properties.
|
|
4371
|
+
*/
|
|
4372
|
+
function copyArrayStrict(array, state) {
|
|
4373
|
+
var clone = new state.Constructor();
|
|
4374
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4375
|
+
state.cache.set(array, clone);
|
|
4376
|
+
return copyOwnPropertiesStrict(array, clone, state);
|
|
4377
|
+
}
|
|
4378
|
+
/**
|
|
4379
|
+
* Copy the contents of the ArrayBuffer.
|
|
4380
|
+
*/
|
|
4381
|
+
function copyArrayBuffer(arrayBuffer, _state) {
|
|
4382
|
+
return arrayBuffer.slice(0);
|
|
4383
|
+
}
|
|
4384
|
+
/**
|
|
4385
|
+
* Create a new Blob with the contents of the original.
|
|
4386
|
+
*/
|
|
4387
|
+
function copyBlob(blob, _state) {
|
|
4388
|
+
return blob.slice(0, blob.size, blob.type);
|
|
4389
|
+
}
|
|
4390
|
+
/**
|
|
4391
|
+
* Create a new DataView with the contents of the original.
|
|
4392
|
+
*/
|
|
4393
|
+
function copyDataView(dataView, state) {
|
|
4394
|
+
return new state.Constructor(copyArrayBuffer(dataView.buffer));
|
|
4395
|
+
}
|
|
4396
|
+
/**
|
|
4397
|
+
* Create a new Date based on the time of the original.
|
|
4398
|
+
*/
|
|
4399
|
+
function copyDate(date, state) {
|
|
4400
|
+
return new state.Constructor(date.getTime());
|
|
4401
|
+
}
|
|
4402
|
+
/**
|
|
4403
|
+
* Deeply copy the keys and values of the original.
|
|
4404
|
+
*/
|
|
4405
|
+
function copyMapLoose(map, state) {
|
|
4406
|
+
var clone = new state.Constructor();
|
|
4407
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4408
|
+
state.cache.set(map, clone);
|
|
4409
|
+
map.forEach(function (value, key) {
|
|
4410
|
+
clone.set(key, state.copier(value, state));
|
|
4411
|
+
});
|
|
4412
|
+
return clone;
|
|
4413
|
+
}
|
|
4414
|
+
/**
|
|
4415
|
+
* Deeply copy the keys and values of the original, as well as any custom properties.
|
|
4416
|
+
*/
|
|
4417
|
+
function copyMapStrict(map, state) {
|
|
4418
|
+
return copyOwnPropertiesStrict(map, copyMapLoose(map, state), state);
|
|
4419
|
+
}
|
|
4420
|
+
function copyObjectLooseLegacy(object, state) {
|
|
4421
|
+
var clone = getCleanClone(state.prototype);
|
|
4422
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4423
|
+
state.cache.set(object, clone);
|
|
4424
|
+
for (var key in object) {
|
|
4425
|
+
if (hasOwnProperty$2.call(object, key)) {
|
|
4426
|
+
clone[key] = state.copier(object[key], state);
|
|
4427
|
+
}
|
|
4428
|
+
}
|
|
4429
|
+
return clone;
|
|
4430
|
+
}
|
|
4431
|
+
function copyObjectLooseModern(object, state) {
|
|
4432
|
+
var clone = getCleanClone(state.prototype);
|
|
4433
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4434
|
+
state.cache.set(object, clone);
|
|
4435
|
+
for (var key in object) {
|
|
4436
|
+
if (hasOwnProperty$2.call(object, key)) {
|
|
4437
|
+
clone[key] = state.copier(object[key], state);
|
|
4438
|
+
}
|
|
4439
|
+
}
|
|
4440
|
+
var symbols = getOwnPropertySymbols(object);
|
|
4441
|
+
for (var index = 0, length_3 = symbols.length, symbol = void 0; index < length_3; ++index) {
|
|
4442
|
+
symbol = symbols[index];
|
|
4443
|
+
if (propertyIsEnumerable.call(object, symbol)) {
|
|
4444
|
+
clone[symbol] = state.copier(object[symbol], state);
|
|
4445
|
+
}
|
|
4446
|
+
}
|
|
4447
|
+
return clone;
|
|
4448
|
+
}
|
|
4449
|
+
/**
|
|
4450
|
+
* Deeply copy the properties (keys and symbols) and values of the original.
|
|
4451
|
+
*/
|
|
4452
|
+
var copyObjectLoose = SUPPORTS_SYMBOL ? copyObjectLooseModern : copyObjectLooseLegacy;
|
|
4453
|
+
/**
|
|
4454
|
+
* Deeply copy the properties (keys and symbols) and values of the original, as well
|
|
4455
|
+
* as any hidden or non-enumerable properties.
|
|
4456
|
+
*/
|
|
4457
|
+
function copyObjectStrict(object, state) {
|
|
4458
|
+
var clone = getCleanClone(state.prototype);
|
|
4459
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4460
|
+
state.cache.set(object, clone);
|
|
4461
|
+
return copyOwnPropertiesStrict(object, clone, state);
|
|
4462
|
+
}
|
|
4463
|
+
/**
|
|
4464
|
+
* Create a new primitive wrapper from the value of the original.
|
|
4465
|
+
*/
|
|
4466
|
+
function copyPrimitiveWrapper(primitiveObject, state) {
|
|
4467
|
+
return new state.Constructor(primitiveObject.valueOf());
|
|
4468
|
+
}
|
|
4469
|
+
/**
|
|
4470
|
+
* Create a new RegExp based on the value and flags of the original.
|
|
4471
|
+
*/
|
|
4472
|
+
function copyRegExp(regExp, state) {
|
|
4473
|
+
var clone = new state.Constructor(regExp.source, getRegExpFlags(regExp));
|
|
4474
|
+
clone.lastIndex = regExp.lastIndex;
|
|
4475
|
+
return clone;
|
|
4476
|
+
}
|
|
4477
|
+
/**
|
|
4478
|
+
* Return the original value (an identity function).
|
|
4479
|
+
*
|
|
4480
|
+
* @note
|
|
4481
|
+
* THis is used for objects that cannot be copied, such as WeakMap.
|
|
4482
|
+
*/
|
|
4483
|
+
function copySelf(value, _state) {
|
|
4484
|
+
return value;
|
|
4485
|
+
}
|
|
4486
|
+
/**
|
|
4487
|
+
* Deeply copy the values of the original.
|
|
4488
|
+
*/
|
|
4489
|
+
function copySetLoose(set, state) {
|
|
4490
|
+
var clone = new state.Constructor();
|
|
4491
|
+
// set in the cache immediately to be able to reuse the object recursively
|
|
4492
|
+
state.cache.set(set, clone);
|
|
4493
|
+
set.forEach(function (value) {
|
|
4494
|
+
clone.add(state.copier(value, state));
|
|
4495
|
+
});
|
|
4496
|
+
return clone;
|
|
4497
|
+
}
|
|
4498
|
+
/**
|
|
4499
|
+
* Deeply copy the values of the original, as well as any custom properties.
|
|
4500
|
+
*/
|
|
4501
|
+
function copySetStrict(set, state) {
|
|
4502
|
+
return copyOwnPropertiesStrict(set, copySetLoose(set, state), state);
|
|
4503
|
+
}
|
|
4504
|
+
var isArray$6 = Array.isArray;
|
|
4505
|
+
var assign$1 = Object.assign;
|
|
4506
|
+
var getPrototypeOf = Object.getPrototypeOf || function (obj) {
|
|
4507
|
+
return obj.__proto__;
|
|
4508
|
+
};
|
|
4509
|
+
var DEFAULT_LOOSE_OPTIONS = {
|
|
4510
|
+
array: copyArrayLoose,
|
|
4511
|
+
arrayBuffer: copyArrayBuffer,
|
|
4512
|
+
blob: copyBlob,
|
|
4513
|
+
dataView: copyDataView,
|
|
4514
|
+
date: copyDate,
|
|
4515
|
+
error: copySelf,
|
|
4516
|
+
map: copyMapLoose,
|
|
4517
|
+
object: copyObjectLoose,
|
|
4518
|
+
regExp: copyRegExp,
|
|
4519
|
+
set: copySetLoose
|
|
4520
|
+
};
|
|
4521
|
+
var DEFAULT_STRICT_OPTIONS = assign$1({}, DEFAULT_LOOSE_OPTIONS, {
|
|
4522
|
+
array: copyArrayStrict,
|
|
4523
|
+
map: copyMapStrict,
|
|
4524
|
+
object: copyObjectStrict,
|
|
4525
|
+
set: copySetStrict
|
|
4526
|
+
});
|
|
4527
|
+
/**
|
|
4528
|
+
* Get the copiers used for each specific object tag.
|
|
4529
|
+
*/
|
|
4530
|
+
function getTagSpecificCopiers(options) {
|
|
4531
|
+
return {
|
|
4532
|
+
Arguments: options.object,
|
|
4533
|
+
Array: options.array,
|
|
4534
|
+
ArrayBuffer: options.arrayBuffer,
|
|
4535
|
+
Blob: options.blob,
|
|
4536
|
+
Boolean: copyPrimitiveWrapper,
|
|
4537
|
+
DataView: options.dataView,
|
|
4538
|
+
Date: options.date,
|
|
4539
|
+
Error: options.error,
|
|
4540
|
+
Float32Array: options.arrayBuffer,
|
|
4541
|
+
Float64Array: options.arrayBuffer,
|
|
4542
|
+
Int8Array: options.arrayBuffer,
|
|
4543
|
+
Int16Array: options.arrayBuffer,
|
|
4544
|
+
Int32Array: options.arrayBuffer,
|
|
4545
|
+
Map: options.map,
|
|
4546
|
+
Number: copyPrimitiveWrapper,
|
|
4547
|
+
Object: options.object,
|
|
4548
|
+
Promise: copySelf,
|
|
4549
|
+
RegExp: options.regExp,
|
|
4550
|
+
Set: options.set,
|
|
4551
|
+
String: copyPrimitiveWrapper,
|
|
4552
|
+
WeakMap: copySelf,
|
|
4553
|
+
WeakSet: copySelf,
|
|
4554
|
+
Uint8Array: options.arrayBuffer,
|
|
4555
|
+
Uint8ClampedArray: options.arrayBuffer,
|
|
4556
|
+
Uint16Array: options.arrayBuffer,
|
|
4557
|
+
Uint32Array: options.arrayBuffer,
|
|
4558
|
+
Uint64Array: options.arrayBuffer
|
|
4559
|
+
};
|
|
4560
|
+
}
|
|
4561
|
+
/**
|
|
4562
|
+
* Create a custom copier based on the object-specific copy methods passed.
|
|
4563
|
+
*/
|
|
4564
|
+
function createCopier(options) {
|
|
4565
|
+
var normalizedOptions = assign$1({}, DEFAULT_LOOSE_OPTIONS, options);
|
|
4566
|
+
var tagSpecificCopiers = getTagSpecificCopiers(normalizedOptions);
|
|
4567
|
+
var array = tagSpecificCopiers.Array,
|
|
4568
|
+
object = tagSpecificCopiers.Object;
|
|
4569
|
+
function copier(value, state) {
|
|
4570
|
+
state.prototype = state.Constructor = undefined;
|
|
4571
|
+
if (!value || _typeof$2(value) !== 'object') {
|
|
4572
|
+
return value;
|
|
4573
|
+
}
|
|
4574
|
+
if (state.cache.has(value)) {
|
|
4575
|
+
return state.cache.get(value);
|
|
4576
|
+
}
|
|
4577
|
+
state.prototype = getPrototypeOf(value);
|
|
4578
|
+
state.Constructor = state.prototype && state.prototype.constructor;
|
|
4579
|
+
// plain objects
|
|
4580
|
+
if (!state.Constructor || state.Constructor === Object) {
|
|
4581
|
+
return object(value, state);
|
|
4582
|
+
}
|
|
4583
|
+
// arrays
|
|
4584
|
+
if (isArray$6(value)) {
|
|
4585
|
+
return array(value, state);
|
|
4586
|
+
}
|
|
4587
|
+
var tagSpecificCopier = tagSpecificCopiers[getTag(value)];
|
|
4588
|
+
if (tagSpecificCopier) {
|
|
4589
|
+
return tagSpecificCopier(value, state);
|
|
4590
|
+
}
|
|
4591
|
+
return typeof value.then === 'function' ? value : object(value, state);
|
|
4592
|
+
}
|
|
4593
|
+
return function copy(value) {
|
|
4594
|
+
return copier(value, {
|
|
4595
|
+
Constructor: undefined,
|
|
4596
|
+
cache: createCache(),
|
|
4597
|
+
copier: copier,
|
|
4598
|
+
prototype: undefined
|
|
4599
|
+
});
|
|
4600
|
+
};
|
|
4601
|
+
}
|
|
4602
|
+
/**
|
|
4603
|
+
* Create a custom copier based on the object-specific copy methods passed, defaulting to the
|
|
4604
|
+
* same internals as `copyStrict`.
|
|
4605
|
+
*/
|
|
4606
|
+
function createStrictCopier(options) {
|
|
4607
|
+
return createCopier(assign$1({}, DEFAULT_STRICT_OPTIONS, options));
|
|
4608
|
+
}
|
|
4609
|
+
/**
|
|
4610
|
+
* Copy an value deeply as much as possible, where strict recreation of object properties
|
|
4611
|
+
* are maintained. All properties (including non-enumerable ones) are copied with their
|
|
4612
|
+
* original property descriptors on both objects and arrays.
|
|
4613
|
+
*/
|
|
4614
|
+
createStrictCopier({});
|
|
4615
|
+
/**
|
|
4616
|
+
* Copy an value deeply as much as possible.
|
|
4617
|
+
*/
|
|
4618
|
+
var index = createCopier({});
|
|
4225
4619
|
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
module.exports = factory() ;
|
|
4229
|
-
})(this, function () {
|
|
4230
|
-
|
|
4231
|
-
var toStringFunction = Function.prototype.toString;
|
|
4232
|
-
var create = Object.create,
|
|
4233
|
-
defineProperty = Object.defineProperty,
|
|
4234
|
-
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor,
|
|
4235
|
-
getOwnPropertyNames = Object.getOwnPropertyNames,
|
|
4236
|
-
getOwnPropertySymbols = Object.getOwnPropertySymbols,
|
|
4237
|
-
getPrototypeOf$1 = Object.getPrototypeOf;
|
|
4238
|
-
var _a = Object.prototype,
|
|
4239
|
-
hasOwnProperty = _a.hasOwnProperty,
|
|
4240
|
-
propertyIsEnumerable = _a.propertyIsEnumerable;
|
|
4241
|
-
var SYMBOL_PROPERTIES = typeof getOwnPropertySymbols === 'function';
|
|
4242
|
-
var WEAK_MAP = typeof WeakMap === 'function';
|
|
4243
|
-
/**
|
|
4244
|
-
* @function createCache
|
|
4245
|
-
*
|
|
4246
|
-
* @description
|
|
4247
|
-
* get a new cache object to prevent circular references
|
|
4248
|
-
*
|
|
4249
|
-
* @returns the new cache object
|
|
4250
|
-
*/
|
|
4251
|
-
var createCache = function () {
|
|
4252
|
-
if (WEAK_MAP) {
|
|
4253
|
-
return function () {
|
|
4254
|
-
return new WeakMap();
|
|
4255
|
-
};
|
|
4256
|
-
}
|
|
4257
|
-
var Cache = /** @class */function () {
|
|
4258
|
-
function Cache() {
|
|
4259
|
-
this._keys = [];
|
|
4260
|
-
this._values = [];
|
|
4261
|
-
}
|
|
4262
|
-
Cache.prototype.has = function (key) {
|
|
4263
|
-
return !!~this._keys.indexOf(key);
|
|
4264
|
-
};
|
|
4265
|
-
Cache.prototype.get = function (key) {
|
|
4266
|
-
return this._values[this._keys.indexOf(key)];
|
|
4267
|
-
};
|
|
4268
|
-
Cache.prototype.set = function (key, value) {
|
|
4269
|
-
this._keys.push(key);
|
|
4270
|
-
this._values.push(value);
|
|
4271
|
-
};
|
|
4272
|
-
return Cache;
|
|
4273
|
-
}();
|
|
4274
|
-
return function () {
|
|
4275
|
-
return new Cache();
|
|
4276
|
-
};
|
|
4277
|
-
}();
|
|
4278
|
-
/**
|
|
4279
|
-
* @function getCleanClone
|
|
4280
|
-
*
|
|
4281
|
-
* @description
|
|
4282
|
-
* get an empty version of the object with the same prototype it has
|
|
4283
|
-
*
|
|
4284
|
-
* @param object the object to build a clean clone from
|
|
4285
|
-
* @param realm the realm the object resides in
|
|
4286
|
-
* @returns the empty cloned object
|
|
4287
|
-
*/
|
|
4288
|
-
var getCleanClone = function getCleanClone(object, realm) {
|
|
4289
|
-
var prototype = object.__proto__ || getPrototypeOf$1(object);
|
|
4290
|
-
if (!prototype) {
|
|
4291
|
-
return create(null);
|
|
4292
|
-
}
|
|
4293
|
-
var Constructor = prototype.constructor;
|
|
4294
|
-
if (Constructor === realm.Object) {
|
|
4295
|
-
return prototype === realm.Object.prototype ? {} : create(prototype);
|
|
4296
|
-
}
|
|
4297
|
-
if (~toStringFunction.call(Constructor).indexOf('[native code]')) {
|
|
4298
|
-
try {
|
|
4299
|
-
return new Constructor();
|
|
4300
|
-
} catch (_a) {}
|
|
4301
|
-
}
|
|
4302
|
-
return create(prototype);
|
|
4303
|
-
};
|
|
4304
|
-
/**
|
|
4305
|
-
* @function getObjectCloneLoose
|
|
4306
|
-
*
|
|
4307
|
-
* @description
|
|
4308
|
-
* get a copy of the object based on loose rules, meaning all enumerable keys
|
|
4309
|
-
* and symbols are copied, but property descriptors are not considered
|
|
4310
|
-
*
|
|
4311
|
-
* @param object the object to clone
|
|
4312
|
-
* @param realm the realm the object resides in
|
|
4313
|
-
* @param handleCopy the function that handles copying the object
|
|
4314
|
-
* @returns the copied object
|
|
4315
|
-
*/
|
|
4316
|
-
var getObjectCloneLoose = function getObjectCloneLoose(object, realm, handleCopy, cache) {
|
|
4317
|
-
var clone = getCleanClone(object, realm);
|
|
4318
|
-
// set in the cache immediately to be able to reuse the object recursively
|
|
4319
|
-
cache.set(object, clone);
|
|
4320
|
-
for (var key in object) {
|
|
4321
|
-
if (hasOwnProperty.call(object, key)) {
|
|
4322
|
-
clone[key] = handleCopy(object[key], cache);
|
|
4323
|
-
}
|
|
4324
|
-
}
|
|
4325
|
-
if (SYMBOL_PROPERTIES) {
|
|
4326
|
-
var symbols = getOwnPropertySymbols(object);
|
|
4327
|
-
for (var index = 0, length_1 = symbols.length, symbol = void 0; index < length_1; ++index) {
|
|
4328
|
-
symbol = symbols[index];
|
|
4329
|
-
if (propertyIsEnumerable.call(object, symbol)) {
|
|
4330
|
-
clone[symbol] = handleCopy(object[symbol], cache);
|
|
4331
|
-
}
|
|
4332
|
-
}
|
|
4333
|
-
}
|
|
4334
|
-
return clone;
|
|
4335
|
-
};
|
|
4336
|
-
/**
|
|
4337
|
-
* @function getObjectCloneStrict
|
|
4338
|
-
*
|
|
4339
|
-
* @description
|
|
4340
|
-
* get a copy of the object based on strict rules, meaning all keys and symbols
|
|
4341
|
-
* are copied based on the original property descriptors
|
|
4342
|
-
*
|
|
4343
|
-
* @param object the object to clone
|
|
4344
|
-
* @param realm the realm the object resides in
|
|
4345
|
-
* @param handleCopy the function that handles copying the object
|
|
4346
|
-
* @returns the copied object
|
|
4347
|
-
*/
|
|
4348
|
-
var getObjectCloneStrict = function getObjectCloneStrict(object, realm, handleCopy, cache) {
|
|
4349
|
-
var clone = getCleanClone(object, realm);
|
|
4350
|
-
// set in the cache immediately to be able to reuse the object recursively
|
|
4351
|
-
cache.set(object, clone);
|
|
4352
|
-
var properties = SYMBOL_PROPERTIES ? getOwnPropertyNames(object).concat(getOwnPropertySymbols(object)) : getOwnPropertyNames(object);
|
|
4353
|
-
for (var index = 0, length_2 = properties.length, property = void 0, descriptor = void 0; index < length_2; ++index) {
|
|
4354
|
-
property = properties[index];
|
|
4355
|
-
if (property !== 'callee' && property !== 'caller') {
|
|
4356
|
-
descriptor = getOwnPropertyDescriptor(object, property);
|
|
4357
|
-
if (descriptor) {
|
|
4358
|
-
// Only clone the value if actually a value, not a getter / setter.
|
|
4359
|
-
if (!descriptor.get && !descriptor.set) {
|
|
4360
|
-
descriptor.value = handleCopy(object[property], cache);
|
|
4361
|
-
}
|
|
4362
|
-
try {
|
|
4363
|
-
defineProperty(clone, property, descriptor);
|
|
4364
|
-
} catch (error) {
|
|
4365
|
-
// Tee above can fail on node in edge cases, so fall back to the loose assignment.
|
|
4366
|
-
clone[property] = descriptor.value;
|
|
4367
|
-
}
|
|
4368
|
-
} else {
|
|
4369
|
-
// In extra edge cases where the property descriptor cannot be retrived, fall back to
|
|
4370
|
-
// the loose assignment.
|
|
4371
|
-
clone[property] = handleCopy(object[property], cache);
|
|
4372
|
-
}
|
|
4373
|
-
}
|
|
4374
|
-
}
|
|
4375
|
-
return clone;
|
|
4376
|
-
};
|
|
4377
|
-
/**
|
|
4378
|
-
* @function getRegExpFlags
|
|
4379
|
-
*
|
|
4380
|
-
* @description
|
|
4381
|
-
* get the flags to apply to the copied regexp
|
|
4382
|
-
*
|
|
4383
|
-
* @param regExp the regexp to get the flags of
|
|
4384
|
-
* @returns the flags for the regexp
|
|
4385
|
-
*/
|
|
4386
|
-
var getRegExpFlags = function getRegExpFlags(regExp) {
|
|
4387
|
-
var flags = '';
|
|
4388
|
-
if (regExp.global) {
|
|
4389
|
-
flags += 'g';
|
|
4390
|
-
}
|
|
4391
|
-
if (regExp.ignoreCase) {
|
|
4392
|
-
flags += 'i';
|
|
4393
|
-
}
|
|
4394
|
-
if (regExp.multiline) {
|
|
4395
|
-
flags += 'm';
|
|
4396
|
-
}
|
|
4397
|
-
if (regExp.unicode) {
|
|
4398
|
-
flags += 'u';
|
|
4399
|
-
}
|
|
4400
|
-
if (regExp.sticky) {
|
|
4401
|
-
flags += 'y';
|
|
4402
|
-
}
|
|
4403
|
-
return flags;
|
|
4404
|
-
};
|
|
4405
|
-
|
|
4406
|
-
// utils
|
|
4407
|
-
var isArray = Array.isArray;
|
|
4408
|
-
var getPrototypeOf = Object.getPrototypeOf;
|
|
4409
|
-
var GLOBAL_THIS = function () {
|
|
4410
|
-
if (typeof globalThis !== 'undefined') {
|
|
4411
|
-
return globalThis;
|
|
4412
|
-
}
|
|
4413
|
-
if (typeof self !== 'undefined') {
|
|
4414
|
-
return self;
|
|
4415
|
-
}
|
|
4416
|
-
if (typeof window !== 'undefined') {
|
|
4417
|
-
return window;
|
|
4418
|
-
}
|
|
4419
|
-
if (typeof global !== 'undefined') {
|
|
4420
|
-
return global;
|
|
4421
|
-
}
|
|
4422
|
-
if (console && console.error) {
|
|
4423
|
-
console.error('Unable to locate global object, returning "this".');
|
|
4424
|
-
}
|
|
4425
|
-
return this;
|
|
4426
|
-
}();
|
|
4427
|
-
/**
|
|
4428
|
-
* @function copy
|
|
4429
|
-
*
|
|
4430
|
-
* @description
|
|
4431
|
-
* copy an value deeply as much as possible
|
|
4432
|
-
*
|
|
4433
|
-
* If `strict` is applied, then all properties (including non-enumerable ones)
|
|
4434
|
-
* are copied with their original property descriptors on both objects and arrays.
|
|
4435
|
-
*
|
|
4436
|
-
* The value is compared to the global constructors in the `realm` provided,
|
|
4437
|
-
* and the native constructor is always used to ensure that extensions of native
|
|
4438
|
-
* objects (allows in ES2015+) are maintained.
|
|
4439
|
-
*
|
|
4440
|
-
* @param value the value to copy
|
|
4441
|
-
* @param [options] the options for copying with
|
|
4442
|
-
* @param [options.isStrict] should the copy be strict
|
|
4443
|
-
* @param [options.realm] the realm (this) value the value is copied from
|
|
4444
|
-
* @returns the copied value
|
|
4445
|
-
*/
|
|
4446
|
-
function copy(value, options) {
|
|
4447
|
-
// manually coalesced instead of default parameters for performance
|
|
4448
|
-
var isStrict = !!(options && options.isStrict);
|
|
4449
|
-
var realm = options && options.realm || GLOBAL_THIS;
|
|
4450
|
-
var getObjectClone = isStrict ? getObjectCloneStrict : getObjectCloneLoose;
|
|
4451
|
-
/**
|
|
4452
|
-
* @function handleCopy
|
|
4453
|
-
*
|
|
4454
|
-
* @description
|
|
4455
|
-
* copy the value recursively based on its type
|
|
4456
|
-
*
|
|
4457
|
-
* @param value the value to copy
|
|
4458
|
-
* @returns the copied value
|
|
4459
|
-
*/
|
|
4460
|
-
var _handleCopy = function handleCopy(value, cache) {
|
|
4461
|
-
if (!value || _typeof$3(value) !== 'object') {
|
|
4462
|
-
return value;
|
|
4463
|
-
}
|
|
4464
|
-
if (cache.has(value)) {
|
|
4465
|
-
return cache.get(value);
|
|
4466
|
-
}
|
|
4467
|
-
var prototype = value.__proto__ || getPrototypeOf(value);
|
|
4468
|
-
var Constructor = prototype && prototype.constructor;
|
|
4469
|
-
// plain objects
|
|
4470
|
-
if (!Constructor || Constructor === realm.Object) {
|
|
4471
|
-
return getObjectClone(value, realm, _handleCopy, cache);
|
|
4472
|
-
}
|
|
4473
|
-
var clone;
|
|
4474
|
-
// arrays
|
|
4475
|
-
if (isArray(value)) {
|
|
4476
|
-
// if strict, include non-standard properties
|
|
4477
|
-
if (isStrict) {
|
|
4478
|
-
return getObjectCloneStrict(value, realm, _handleCopy, cache);
|
|
4479
|
-
}
|
|
4480
|
-
clone = new Constructor();
|
|
4481
|
-
cache.set(value, clone);
|
|
4482
|
-
for (var index = 0, length_1 = value.length; index < length_1; ++index) {
|
|
4483
|
-
clone[index] = _handleCopy(value[index], cache);
|
|
4484
|
-
}
|
|
4485
|
-
return clone;
|
|
4486
|
-
}
|
|
4487
|
-
// dates
|
|
4488
|
-
if (value instanceof realm.Date) {
|
|
4489
|
-
return new Constructor(value.getTime());
|
|
4490
|
-
}
|
|
4491
|
-
// regexps
|
|
4492
|
-
if (value instanceof realm.RegExp) {
|
|
4493
|
-
clone = new Constructor(value.source, value.flags || getRegExpFlags(value));
|
|
4494
|
-
clone.lastIndex = value.lastIndex;
|
|
4495
|
-
return clone;
|
|
4496
|
-
}
|
|
4497
|
-
// maps
|
|
4498
|
-
if (realm.Map && value instanceof realm.Map) {
|
|
4499
|
-
clone = new Constructor();
|
|
4500
|
-
cache.set(value, clone);
|
|
4501
|
-
value.forEach(function (value, key) {
|
|
4502
|
-
clone.set(key, _handleCopy(value, cache));
|
|
4503
|
-
});
|
|
4504
|
-
return clone;
|
|
4505
|
-
}
|
|
4506
|
-
// sets
|
|
4507
|
-
if (realm.Set && value instanceof realm.Set) {
|
|
4508
|
-
clone = new Constructor();
|
|
4509
|
-
cache.set(value, clone);
|
|
4510
|
-
value.forEach(function (value) {
|
|
4511
|
-
clone.add(_handleCopy(value, cache));
|
|
4512
|
-
});
|
|
4513
|
-
return clone;
|
|
4514
|
-
}
|
|
4515
|
-
// blobs
|
|
4516
|
-
if (realm.Blob && value instanceof realm.Blob) {
|
|
4517
|
-
return value.slice(0, value.size, value.type);
|
|
4518
|
-
}
|
|
4519
|
-
// buffers (node-only)
|
|
4520
|
-
if (realm.Buffer && realm.Buffer.isBuffer(value)) {
|
|
4521
|
-
clone = realm.Buffer.allocUnsafe ? realm.Buffer.allocUnsafe(value.length) : new Constructor(value.length);
|
|
4522
|
-
cache.set(value, clone);
|
|
4523
|
-
value.copy(clone);
|
|
4524
|
-
return clone;
|
|
4525
|
-
}
|
|
4526
|
-
// arraybuffers / dataviews
|
|
4527
|
-
if (realm.ArrayBuffer) {
|
|
4528
|
-
// dataviews
|
|
4529
|
-
if (realm.ArrayBuffer.isView(value)) {
|
|
4530
|
-
clone = new Constructor(value.buffer.slice(0));
|
|
4531
|
-
cache.set(value, clone);
|
|
4532
|
-
return clone;
|
|
4533
|
-
}
|
|
4534
|
-
// arraybuffers
|
|
4535
|
-
if (value instanceof realm.ArrayBuffer) {
|
|
4536
|
-
clone = value.slice(0);
|
|
4537
|
-
cache.set(value, clone);
|
|
4538
|
-
return clone;
|
|
4539
|
-
}
|
|
4540
|
-
}
|
|
4541
|
-
// if the value cannot / should not be cloned, don't
|
|
4542
|
-
if (
|
|
4543
|
-
// promise-like
|
|
4544
|
-
typeof value.then === 'function' ||
|
|
4545
|
-
// errors
|
|
4546
|
-
value instanceof Error ||
|
|
4547
|
-
// weakmaps
|
|
4548
|
-
realm.WeakMap && value instanceof realm.WeakMap ||
|
|
4549
|
-
// weaksets
|
|
4550
|
-
realm.WeakSet && value instanceof realm.WeakSet) {
|
|
4551
|
-
return value;
|
|
4552
|
-
}
|
|
4553
|
-
// assume anything left is a custom constructor
|
|
4554
|
-
return getObjectClone(value, realm, _handleCopy, cache);
|
|
4555
|
-
};
|
|
4556
|
-
return _handleCopy(value, createCache());
|
|
4557
|
-
}
|
|
4558
|
-
// Adding reference to allow usage in CommonJS libraries compiled using TSC, which
|
|
4559
|
-
// expects there to be a default property on the exported value. See
|
|
4560
|
-
// [#37](https://github.com/planttheidea/fast-copy/issues/37) for details.
|
|
4561
|
-
copy.default = copy;
|
|
4562
|
-
/**
|
|
4563
|
-
* @function strictCopy
|
|
4564
|
-
*
|
|
4565
|
-
* @description
|
|
4566
|
-
* copy the value with `strict` option pre-applied
|
|
4567
|
-
*
|
|
4568
|
-
* @param value the value to copy
|
|
4569
|
-
* @param [options] the options for copying with
|
|
4570
|
-
* @param [options.realm] the realm (this) value the value is copied from
|
|
4571
|
-
* @returns the copied value
|
|
4572
|
-
*/
|
|
4573
|
-
copy.strict = function strictCopy(value, options) {
|
|
4574
|
-
return copy(value, {
|
|
4575
|
-
isStrict: true,
|
|
4576
|
-
realm: options ? options.realm : void 0
|
|
4577
|
-
});
|
|
4578
|
-
};
|
|
4579
|
-
return copy;
|
|
4580
|
-
});
|
|
4581
|
-
})(fastCopy$1);
|
|
4582
|
-
var fastCopyExports$1 = fastCopy$1.exports;
|
|
4583
|
-
var copy$1 = /*@__PURE__*/getDefaultExportFromCjs(fastCopyExports$1);
|
|
4584
|
-
|
|
4585
|
-
/** @type {import('.')} */
|
|
4586
|
-
var esErrors = Error;
|
|
4620
|
+
/** @type {import('.')} */
|
|
4621
|
+
var esErrors = Error;
|
|
4587
4622
|
|
|
4588
4623
|
/** @type {import('./eval')} */
|
|
4589
4624
|
var _eval = EvalError;
|
|
@@ -4608,7 +4643,7 @@ var contentful = (function (exports) {
|
|
|
4608
4643
|
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') {
|
|
4609
4644
|
return false;
|
|
4610
4645
|
}
|
|
4611
|
-
if (_typeof$
|
|
4646
|
+
if (_typeof$2(Symbol.iterator) === 'symbol') {
|
|
4612
4647
|
return true;
|
|
4613
4648
|
}
|
|
4614
4649
|
var obj = {};
|
|
@@ -4668,10 +4703,10 @@ var contentful = (function (exports) {
|
|
|
4668
4703
|
if (typeof Symbol !== 'function') {
|
|
4669
4704
|
return false;
|
|
4670
4705
|
}
|
|
4671
|
-
if (_typeof$
|
|
4706
|
+
if (_typeof$2(origSymbol('foo')) !== 'symbol') {
|
|
4672
4707
|
return false;
|
|
4673
4708
|
}
|
|
4674
|
-
if (_typeof$
|
|
4709
|
+
if (_typeof$2(Symbol('bar')) !== 'symbol') {
|
|
4675
4710
|
return false;
|
|
4676
4711
|
}
|
|
4677
4712
|
return hasSymbolSham();
|
|
@@ -4852,7 +4887,7 @@ var contentful = (function (exports) {
|
|
|
4852
4887
|
'%isFinite%': isFinite,
|
|
4853
4888
|
'%isNaN%': isNaN,
|
|
4854
4889
|
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
|
|
4855
|
-
'%JSON%': (typeof JSON === "undefined" ? "undefined" : _typeof$
|
|
4890
|
+
'%JSON%': (typeof JSON === "undefined" ? "undefined" : _typeof$2(JSON)) === 'object' ? JSON : undefined$1,
|
|
4856
4891
|
'%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
|
|
4857
4892
|
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
|
|
4858
4893
|
'%Math%': Math,
|
|
@@ -5134,10 +5169,10 @@ var contentful = (function (exports) {
|
|
|
5134
5169
|
|
|
5135
5170
|
/** @type {import('.')} */
|
|
5136
5171
|
var defineDataProperty = function defineDataProperty(obj, property, value) {
|
|
5137
|
-
if (!obj || _typeof$
|
|
5172
|
+
if (!obj || _typeof$2(obj) !== 'object' && typeof obj !== 'function') {
|
|
5138
5173
|
throw new $TypeError$2('`obj` must be an object or a function`');
|
|
5139
5174
|
}
|
|
5140
|
-
if (typeof property !== 'string' && _typeof$
|
|
5175
|
+
if (typeof property !== 'string' && _typeof$2(property) !== 'symbol') {
|
|
5141
5176
|
throw new $TypeError$2('`property` must be a string or a symbol`');
|
|
5142
5177
|
}
|
|
5143
5178
|
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
|
@@ -5311,10 +5346,10 @@ var contentful = (function (exports) {
|
|
|
5311
5346
|
var $floor = Math.floor;
|
|
5312
5347
|
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
|
|
5313
5348
|
var gOPS = Object.getOwnPropertySymbols;
|
|
5314
|
-
var symToString = typeof Symbol === 'function' && _typeof$
|
|
5315
|
-
var hasShammedSymbols = typeof Symbol === 'function' && _typeof$
|
|
5349
|
+
var symToString = typeof Symbol === 'function' && _typeof$2(Symbol.iterator) === 'symbol' ? Symbol.prototype.toString : null;
|
|
5350
|
+
var hasShammedSymbols = typeof Symbol === 'function' && _typeof$2(Symbol.iterator) === 'object';
|
|
5316
5351
|
// ie, `has-tostringtag/shams
|
|
5317
|
-
var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (_typeof$
|
|
5352
|
+
var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (_typeof$2(Symbol.toStringTag) === hasShammedSymbols ? 'object' : 'symbol') ? Symbol.toStringTag : null;
|
|
5318
5353
|
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
5319
5354
|
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype // eslint-disable-line no-proto
|
|
5320
5355
|
? function (O) {
|
|
@@ -5384,8 +5419,8 @@ var contentful = (function (exports) {
|
|
|
5384
5419
|
if (typeof depth === 'undefined') {
|
|
5385
5420
|
depth = 0;
|
|
5386
5421
|
}
|
|
5387
|
-
if (depth >= maxDepth && maxDepth > 0 && _typeof$
|
|
5388
|
-
return isArray$
|
|
5422
|
+
if (depth >= maxDepth && maxDepth > 0 && _typeof$2(obj) === 'object') {
|
|
5423
|
+
return isArray$5(obj) ? '[Array]' : '[Object]';
|
|
5389
5424
|
}
|
|
5390
5425
|
var indent = getIndent(opts, depth);
|
|
5391
5426
|
if (typeof seen === 'undefined') {
|
|
@@ -5417,7 +5452,7 @@ var contentful = (function (exports) {
|
|
|
5417
5452
|
}
|
|
5418
5453
|
if (isSymbol(obj)) {
|
|
5419
5454
|
var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
|
|
5420
|
-
return _typeof$
|
|
5455
|
+
return _typeof$2(obj) === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
|
|
5421
5456
|
}
|
|
5422
5457
|
if (isElement(obj)) {
|
|
5423
5458
|
var s = '<' + $toLowerCase.call(String(obj.nodeName));
|
|
@@ -5432,7 +5467,7 @@ var contentful = (function (exports) {
|
|
|
5432
5467
|
s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
|
|
5433
5468
|
return s;
|
|
5434
5469
|
}
|
|
5435
|
-
if (isArray$
|
|
5470
|
+
if (isArray$5(obj)) {
|
|
5436
5471
|
if (obj.length === 0) {
|
|
5437
5472
|
return '[]';
|
|
5438
5473
|
}
|
|
@@ -5452,7 +5487,7 @@ var contentful = (function (exports) {
|
|
|
5452
5487
|
}
|
|
5453
5488
|
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
|
|
5454
5489
|
}
|
|
5455
|
-
if (_typeof$
|
|
5490
|
+
if (_typeof$2(obj) === 'object' && customInspect) {
|
|
5456
5491
|
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
|
|
5457
5492
|
return utilInspect(obj, {
|
|
5458
5493
|
depth: maxDepth - depth
|
|
@@ -5532,37 +5567,37 @@ var contentful = (function (exports) {
|
|
|
5532
5567
|
function quote(s) {
|
|
5533
5568
|
return $replace.call(String(s), /"/g, '"');
|
|
5534
5569
|
}
|
|
5535
|
-
function isArray$
|
|
5536
|
-
return toStr(obj) === '[object Array]' && (!toStringTag || !(_typeof$
|
|
5570
|
+
function isArray$5(obj) {
|
|
5571
|
+
return toStr(obj) === '[object Array]' && (!toStringTag || !(_typeof$2(obj) === 'object' && toStringTag in obj));
|
|
5537
5572
|
}
|
|
5538
5573
|
function isDate(obj) {
|
|
5539
|
-
return toStr(obj) === '[object Date]' && (!toStringTag || !(_typeof$
|
|
5574
|
+
return toStr(obj) === '[object Date]' && (!toStringTag || !(_typeof$2(obj) === 'object' && toStringTag in obj));
|
|
5540
5575
|
}
|
|
5541
5576
|
function isRegExp$1(obj) {
|
|
5542
|
-
return toStr(obj) === '[object RegExp]' && (!toStringTag || !(_typeof$
|
|
5577
|
+
return toStr(obj) === '[object RegExp]' && (!toStringTag || !(_typeof$2(obj) === 'object' && toStringTag in obj));
|
|
5543
5578
|
}
|
|
5544
5579
|
function isError(obj) {
|
|
5545
|
-
return toStr(obj) === '[object Error]' && (!toStringTag || !(_typeof$
|
|
5580
|
+
return toStr(obj) === '[object Error]' && (!toStringTag || !(_typeof$2(obj) === 'object' && toStringTag in obj));
|
|
5546
5581
|
}
|
|
5547
5582
|
function isString$2(obj) {
|
|
5548
|
-
return toStr(obj) === '[object String]' && (!toStringTag || !(_typeof$
|
|
5583
|
+
return toStr(obj) === '[object String]' && (!toStringTag || !(_typeof$2(obj) === 'object' && toStringTag in obj));
|
|
5549
5584
|
}
|
|
5550
5585
|
function isNumber(obj) {
|
|
5551
|
-
return toStr(obj) === '[object Number]' && (!toStringTag || !(_typeof$
|
|
5586
|
+
return toStr(obj) === '[object Number]' && (!toStringTag || !(_typeof$2(obj) === 'object' && toStringTag in obj));
|
|
5552
5587
|
}
|
|
5553
5588
|
function isBoolean(obj) {
|
|
5554
|
-
return toStr(obj) === '[object Boolean]' && (!toStringTag || !(_typeof$
|
|
5589
|
+
return toStr(obj) === '[object Boolean]' && (!toStringTag || !(_typeof$2(obj) === 'object' && toStringTag in obj));
|
|
5555
5590
|
}
|
|
5556
5591
|
|
|
5557
5592
|
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
5558
5593
|
function isSymbol(obj) {
|
|
5559
5594
|
if (hasShammedSymbols) {
|
|
5560
|
-
return obj && _typeof$
|
|
5595
|
+
return obj && _typeof$2(obj) === 'object' && obj instanceof Symbol;
|
|
5561
5596
|
}
|
|
5562
|
-
if (_typeof$
|
|
5597
|
+
if (_typeof$2(obj) === 'symbol') {
|
|
5563
5598
|
return true;
|
|
5564
5599
|
}
|
|
5565
|
-
if (!obj || _typeof$
|
|
5600
|
+
if (!obj || _typeof$2(obj) !== 'object' || !symToString) {
|
|
5566
5601
|
return false;
|
|
5567
5602
|
}
|
|
5568
5603
|
try {
|
|
@@ -5572,7 +5607,7 @@ var contentful = (function (exports) {
|
|
|
5572
5607
|
return false;
|
|
5573
5608
|
}
|
|
5574
5609
|
function isBigInt(obj) {
|
|
5575
|
-
if (!obj || _typeof$
|
|
5610
|
+
if (!obj || _typeof$2(obj) !== 'object' || !bigIntValueOf) {
|
|
5576
5611
|
return false;
|
|
5577
5612
|
}
|
|
5578
5613
|
try {
|
|
@@ -5612,7 +5647,7 @@ var contentful = (function (exports) {
|
|
|
5612
5647
|
return -1;
|
|
5613
5648
|
}
|
|
5614
5649
|
function isMap(x) {
|
|
5615
|
-
if (!mapSize || !x || _typeof$
|
|
5650
|
+
if (!mapSize || !x || _typeof$2(x) !== 'object') {
|
|
5616
5651
|
return false;
|
|
5617
5652
|
}
|
|
5618
5653
|
try {
|
|
@@ -5627,7 +5662,7 @@ var contentful = (function (exports) {
|
|
|
5627
5662
|
return false;
|
|
5628
5663
|
}
|
|
5629
5664
|
function isWeakMap(x) {
|
|
5630
|
-
if (!weakMapHas || !x || _typeof$
|
|
5665
|
+
if (!weakMapHas || !x || _typeof$2(x) !== 'object') {
|
|
5631
5666
|
return false;
|
|
5632
5667
|
}
|
|
5633
5668
|
try {
|
|
@@ -5642,7 +5677,7 @@ var contentful = (function (exports) {
|
|
|
5642
5677
|
return false;
|
|
5643
5678
|
}
|
|
5644
5679
|
function isWeakRef(x) {
|
|
5645
|
-
if (!weakRefDeref || !x || _typeof$
|
|
5680
|
+
if (!weakRefDeref || !x || _typeof$2(x) !== 'object') {
|
|
5646
5681
|
return false;
|
|
5647
5682
|
}
|
|
5648
5683
|
try {
|
|
@@ -5652,7 +5687,7 @@ var contentful = (function (exports) {
|
|
|
5652
5687
|
return false;
|
|
5653
5688
|
}
|
|
5654
5689
|
function isSet(x) {
|
|
5655
|
-
if (!setSize || !x || _typeof$
|
|
5690
|
+
if (!setSize || !x || _typeof$2(x) !== 'object') {
|
|
5656
5691
|
return false;
|
|
5657
5692
|
}
|
|
5658
5693
|
try {
|
|
@@ -5667,7 +5702,7 @@ var contentful = (function (exports) {
|
|
|
5667
5702
|
return false;
|
|
5668
5703
|
}
|
|
5669
5704
|
function isWeakSet(x) {
|
|
5670
|
-
if (!weakSetHas || !x || _typeof$
|
|
5705
|
+
if (!weakSetHas || !x || _typeof$2(x) !== 'object') {
|
|
5671
5706
|
return false;
|
|
5672
5707
|
}
|
|
5673
5708
|
try {
|
|
@@ -5682,7 +5717,7 @@ var contentful = (function (exports) {
|
|
|
5682
5717
|
return false;
|
|
5683
5718
|
}
|
|
5684
5719
|
function isElement(x) {
|
|
5685
|
-
if (!x || _typeof$
|
|
5720
|
+
if (!x || _typeof$2(x) !== 'object') {
|
|
5686
5721
|
return false;
|
|
5687
5722
|
}
|
|
5688
5723
|
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
|
|
@@ -5754,7 +5789,7 @@ var contentful = (function (exports) {
|
|
|
5754
5789
|
return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
|
|
5755
5790
|
}
|
|
5756
5791
|
function arrObjKeys(obj, inspect) {
|
|
5757
|
-
var isArr = isArray$
|
|
5792
|
+
var isArr = isArray$5(obj);
|
|
5758
5793
|
var xs = [];
|
|
5759
5794
|
if (isArr) {
|
|
5760
5795
|
xs.length = obj.length;
|
|
@@ -5875,7 +5910,7 @@ var contentful = (function (exports) {
|
|
|
5875
5910
|
},
|
|
5876
5911
|
get: function get(key) {
|
|
5877
5912
|
// eslint-disable-line consistent-return
|
|
5878
|
-
if ($WeakMap && key && (_typeof$
|
|
5913
|
+
if ($WeakMap && key && (_typeof$2(key) === 'object' || typeof key === 'function')) {
|
|
5879
5914
|
if ($wm) {
|
|
5880
5915
|
return $weakMapGet($wm, key);
|
|
5881
5916
|
}
|
|
@@ -5891,7 +5926,7 @@ var contentful = (function (exports) {
|
|
|
5891
5926
|
}
|
|
5892
5927
|
},
|
|
5893
5928
|
has: function has(key) {
|
|
5894
|
-
if ($WeakMap && key && (_typeof$
|
|
5929
|
+
if ($WeakMap && key && (_typeof$2(key) === 'object' || typeof key === 'function')) {
|
|
5895
5930
|
if ($wm) {
|
|
5896
5931
|
return $weakMapHas($wm, key);
|
|
5897
5932
|
}
|
|
@@ -5908,7 +5943,7 @@ var contentful = (function (exports) {
|
|
|
5908
5943
|
return false;
|
|
5909
5944
|
},
|
|
5910
5945
|
set: function set(key, value) {
|
|
5911
|
-
if ($WeakMap && key && (_typeof$
|
|
5946
|
+
if ($WeakMap && key && (_typeof$2(key) === 'object' || typeof key === 'function')) {
|
|
5912
5947
|
if (!$wm) {
|
|
5913
5948
|
$wm = new $WeakMap();
|
|
5914
5949
|
}
|
|
@@ -5955,7 +5990,7 @@ var contentful = (function (exports) {
|
|
|
5955
5990
|
|
|
5956
5991
|
var formats$2 = formats$3;
|
|
5957
5992
|
var has$2 = Object.prototype.hasOwnProperty;
|
|
5958
|
-
var isArray$
|
|
5993
|
+
var isArray$4 = Array.isArray;
|
|
5959
5994
|
var hexTable = function () {
|
|
5960
5995
|
var array = [];
|
|
5961
5996
|
for (var i = 0; i < 256; ++i) {
|
|
@@ -5967,7 +6002,7 @@ var contentful = (function (exports) {
|
|
|
5967
6002
|
while (queue.length > 1) {
|
|
5968
6003
|
var item = queue.pop();
|
|
5969
6004
|
var obj = item.obj[item.prop];
|
|
5970
|
-
if (isArray$
|
|
6005
|
+
if (isArray$4(obj)) {
|
|
5971
6006
|
var compacted = [];
|
|
5972
6007
|
for (var j = 0; j < obj.length; ++j) {
|
|
5973
6008
|
if (typeof obj[j] !== 'undefined') {
|
|
@@ -5992,10 +6027,10 @@ var contentful = (function (exports) {
|
|
|
5992
6027
|
if (!source) {
|
|
5993
6028
|
return target;
|
|
5994
6029
|
}
|
|
5995
|
-
if (_typeof$
|
|
5996
|
-
if (isArray$
|
|
6030
|
+
if (_typeof$2(source) !== 'object') {
|
|
6031
|
+
if (isArray$4(target)) {
|
|
5997
6032
|
target.push(source);
|
|
5998
|
-
} else if (target && _typeof$
|
|
6033
|
+
} else if (target && _typeof$2(target) === 'object') {
|
|
5999
6034
|
if (options && (options.plainObjects || options.allowPrototypes) || !has$2.call(Object.prototype, source)) {
|
|
6000
6035
|
target[source] = true;
|
|
6001
6036
|
}
|
|
@@ -6004,18 +6039,18 @@ var contentful = (function (exports) {
|
|
|
6004
6039
|
}
|
|
6005
6040
|
return target;
|
|
6006
6041
|
}
|
|
6007
|
-
if (!target || _typeof$
|
|
6042
|
+
if (!target || _typeof$2(target) !== 'object') {
|
|
6008
6043
|
return [target].concat(source);
|
|
6009
6044
|
}
|
|
6010
6045
|
var mergeTarget = target;
|
|
6011
|
-
if (isArray$
|
|
6046
|
+
if (isArray$4(target) && !isArray$4(source)) {
|
|
6012
6047
|
mergeTarget = arrayToObject(target, options);
|
|
6013
6048
|
}
|
|
6014
|
-
if (isArray$
|
|
6049
|
+
if (isArray$4(target) && isArray$4(source)) {
|
|
6015
6050
|
source.forEach(function (item, i) {
|
|
6016
6051
|
if (has$2.call(target, i)) {
|
|
6017
6052
|
var targetItem = target[i];
|
|
6018
|
-
if (targetItem && _typeof$
|
|
6053
|
+
if (targetItem && _typeof$2(targetItem) === 'object' && item && _typeof$2(item) === 'object') {
|
|
6019
6054
|
target[i] = merge(targetItem, item, options);
|
|
6020
6055
|
} else {
|
|
6021
6056
|
target.push(item);
|
|
@@ -6066,7 +6101,7 @@ var contentful = (function (exports) {
|
|
|
6066
6101
|
return str;
|
|
6067
6102
|
}
|
|
6068
6103
|
var string = str;
|
|
6069
|
-
if (_typeof$
|
|
6104
|
+
if (_typeof$2(str) === 'symbol') {
|
|
6070
6105
|
string = Symbol.prototype.toString.call(str);
|
|
6071
6106
|
} else if (typeof str !== 'string') {
|
|
6072
6107
|
string = String(str);
|
|
@@ -6129,7 +6164,7 @@ var contentful = (function (exports) {
|
|
|
6129
6164
|
for (var j = 0; j < keys.length; ++j) {
|
|
6130
6165
|
var key = keys[j];
|
|
6131
6166
|
var val = obj[key];
|
|
6132
|
-
if (_typeof$
|
|
6167
|
+
if (_typeof$2(val) === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
6133
6168
|
queue.push({
|
|
6134
6169
|
obj: obj,
|
|
6135
6170
|
prop: key
|
|
@@ -6145,7 +6180,7 @@ var contentful = (function (exports) {
|
|
|
6145
6180
|
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
6146
6181
|
};
|
|
6147
6182
|
var isBuffer = function isBuffer(obj) {
|
|
6148
|
-
if (!obj || _typeof$
|
|
6183
|
+
if (!obj || _typeof$2(obj) !== 'object') {
|
|
6149
6184
|
return false;
|
|
6150
6185
|
}
|
|
6151
6186
|
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
@@ -6154,7 +6189,7 @@ var contentful = (function (exports) {
|
|
|
6154
6189
|
return [].concat(a, b);
|
|
6155
6190
|
};
|
|
6156
6191
|
var maybeMap = function maybeMap(val, fn) {
|
|
6157
|
-
if (isArray$
|
|
6192
|
+
if (isArray$4(val)) {
|
|
6158
6193
|
var mapped = [];
|
|
6159
6194
|
for (var i = 0; i < val.length; i += 1) {
|
|
6160
6195
|
mapped.push(fn(val[i]));
|
|
@@ -6192,10 +6227,10 @@ var contentful = (function (exports) {
|
|
|
6192
6227
|
return prefix;
|
|
6193
6228
|
}
|
|
6194
6229
|
};
|
|
6195
|
-
var isArray$
|
|
6230
|
+
var isArray$3 = Array.isArray;
|
|
6196
6231
|
var push = Array.prototype.push;
|
|
6197
6232
|
var pushToArray = function pushToArray(arr, valueOrArray) {
|
|
6198
|
-
push.apply(arr, isArray$
|
|
6233
|
+
push.apply(arr, isArray$3(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
6199
6234
|
};
|
|
6200
6235
|
var toISO = Date.prototype.toISOString;
|
|
6201
6236
|
var defaultFormat = formats$1['default'];
|
|
@@ -6222,7 +6257,7 @@ var contentful = (function (exports) {
|
|
|
6222
6257
|
strictNullHandling: false
|
|
6223
6258
|
};
|
|
6224
6259
|
var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
|
6225
|
-
return typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean' || _typeof$
|
|
6260
|
+
return typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean' || _typeof$2(v) === 'symbol' || typeof v === 'bigint';
|
|
6226
6261
|
};
|
|
6227
6262
|
var sentinel = {};
|
|
6228
6263
|
var stringify$2 = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) {
|
|
@@ -6249,7 +6284,7 @@ var contentful = (function (exports) {
|
|
|
6249
6284
|
obj = filter(prefix, obj);
|
|
6250
6285
|
} else if (obj instanceof Date) {
|
|
6251
6286
|
obj = serializeDate(obj);
|
|
6252
|
-
} else if (generateArrayPrefix === 'comma' && isArray$
|
|
6287
|
+
} else if (generateArrayPrefix === 'comma' && isArray$3(obj)) {
|
|
6253
6288
|
obj = utils$1.maybeMap(obj, function (value) {
|
|
6254
6289
|
if (value instanceof Date) {
|
|
6255
6290
|
return serializeDate(value);
|
|
@@ -6275,7 +6310,7 @@ var contentful = (function (exports) {
|
|
|
6275
6310
|
return values;
|
|
6276
6311
|
}
|
|
6277
6312
|
var objKeys;
|
|
6278
|
-
if (generateArrayPrefix === 'comma' && isArray$
|
|
6313
|
+
if (generateArrayPrefix === 'comma' && isArray$3(obj)) {
|
|
6279
6314
|
// we need to join elements in
|
|
6280
6315
|
if (encodeValuesOnly && encoder) {
|
|
6281
6316
|
obj = utils$1.maybeMap(obj, encoder);
|
|
@@ -6283,29 +6318,29 @@ var contentful = (function (exports) {
|
|
|
6283
6318
|
objKeys = [{
|
|
6284
6319
|
value: obj.length > 0 ? obj.join(',') || null : void undefined
|
|
6285
6320
|
}];
|
|
6286
|
-
} else if (isArray$
|
|
6321
|
+
} else if (isArray$3(filter)) {
|
|
6287
6322
|
objKeys = filter;
|
|
6288
6323
|
} else {
|
|
6289
6324
|
var keys = Object.keys(obj);
|
|
6290
6325
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
6291
6326
|
}
|
|
6292
6327
|
var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix;
|
|
6293
|
-
var adjustedPrefix = commaRoundTrip && isArray$
|
|
6294
|
-
if (allowEmptyArrays && isArray$
|
|
6328
|
+
var adjustedPrefix = commaRoundTrip && isArray$3(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
|
|
6329
|
+
if (allowEmptyArrays && isArray$3(obj) && obj.length === 0) {
|
|
6295
6330
|
return adjustedPrefix + '[]';
|
|
6296
6331
|
}
|
|
6297
6332
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
6298
6333
|
var key = objKeys[j];
|
|
6299
|
-
var value = _typeof$
|
|
6334
|
+
var value = _typeof$2(key) === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
|
|
6300
6335
|
if (skipNulls && value === null) {
|
|
6301
6336
|
continue;
|
|
6302
6337
|
}
|
|
6303
6338
|
var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key;
|
|
6304
|
-
var keyPrefix = isArray$
|
|
6339
|
+
var keyPrefix = isArray$3(obj) ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
|
|
6305
6340
|
sideChannel.set(object, step);
|
|
6306
6341
|
var valueSideChannel = getSideChannel();
|
|
6307
6342
|
valueSideChannel.set(sentinel, sideChannel);
|
|
6308
|
-
pushToArray(values, stringify(value, keyPrefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$
|
|
6343
|
+
pushToArray(values, stringify(value, keyPrefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$3(obj) ? null : encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel));
|
|
6309
6344
|
}
|
|
6310
6345
|
return values;
|
|
6311
6346
|
};
|
|
@@ -6335,7 +6370,7 @@ var contentful = (function (exports) {
|
|
|
6335
6370
|
}
|
|
6336
6371
|
var formatter = formats$1.formatters[format];
|
|
6337
6372
|
var filter = defaults$1.filter;
|
|
6338
|
-
if (typeof opts.filter === 'function' || isArray$
|
|
6373
|
+
if (typeof opts.filter === 'function' || isArray$3(opts.filter)) {
|
|
6339
6374
|
filter = opts.filter;
|
|
6340
6375
|
}
|
|
6341
6376
|
var arrayFormat;
|
|
@@ -6380,12 +6415,12 @@ var contentful = (function (exports) {
|
|
|
6380
6415
|
if (typeof options.filter === 'function') {
|
|
6381
6416
|
filter = options.filter;
|
|
6382
6417
|
obj = filter('', obj);
|
|
6383
|
-
} else if (isArray$
|
|
6418
|
+
} else if (isArray$3(options.filter)) {
|
|
6384
6419
|
filter = options.filter;
|
|
6385
6420
|
objKeys = filter;
|
|
6386
6421
|
}
|
|
6387
6422
|
var keys = [];
|
|
6388
|
-
if (_typeof$
|
|
6423
|
+
if (_typeof$2(obj) !== 'object' || obj === null) {
|
|
6389
6424
|
return '';
|
|
6390
6425
|
}
|
|
6391
6426
|
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
@@ -6420,7 +6455,7 @@ var contentful = (function (exports) {
|
|
|
6420
6455
|
|
|
6421
6456
|
var utils = utils$2;
|
|
6422
6457
|
var has = Object.prototype.hasOwnProperty;
|
|
6423
|
-
var isArray$
|
|
6458
|
+
var isArray$2 = Array.isArray;
|
|
6424
6459
|
var defaults = {
|
|
6425
6460
|
allowDots: false,
|
|
6426
6461
|
allowEmptyArrays: false,
|
|
@@ -6510,7 +6545,7 @@ var contentful = (function (exports) {
|
|
|
6510
6545
|
val = interpretNumericEntities(val);
|
|
6511
6546
|
}
|
|
6512
6547
|
if (part.indexOf('[]=') > -1) {
|
|
6513
|
-
val = isArray$
|
|
6548
|
+
val = isArray$2(val) ? [val] : val;
|
|
6514
6549
|
}
|
|
6515
6550
|
var existing = has.call(obj, key);
|
|
6516
6551
|
if (existing && options.duplicates === 'combine') {
|
|
@@ -6680,27 +6715,453 @@ var contentful = (function (exports) {
|
|
|
6680
6715
|
};
|
|
6681
6716
|
var qs = /*@__PURE__*/getDefaultExportFromCjs(lib);
|
|
6682
6717
|
|
|
6683
|
-
|
|
6684
|
-
|
|
6718
|
+
function asyncToken(instance, getToken) {
|
|
6719
|
+
instance.interceptors.request.use(function (config) {
|
|
6720
|
+
return getToken().then(function (accessToken) {
|
|
6721
|
+
config.headers.set('Authorization', "Bearer ".concat(accessToken));
|
|
6722
|
+
return config;
|
|
6723
|
+
});
|
|
6724
|
+
});
|
|
6725
|
+
}
|
|
6685
6726
|
|
|
6686
|
-
|
|
6727
|
+
var browser = {exports: {}};
|
|
6728
|
+
|
|
6729
|
+
// shim for using process in browser
|
|
6730
|
+
var process$1 = browser.exports = {};
|
|
6731
|
+
|
|
6732
|
+
// cached from whatever global is present so that test runners that stub it
|
|
6733
|
+
// don't break things. But we need to wrap it in a try catch in case it is
|
|
6734
|
+
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
|
6735
|
+
// function because try/catches deoptimize in certain engines.
|
|
6736
|
+
|
|
6737
|
+
var cachedSetTimeout;
|
|
6738
|
+
var cachedClearTimeout;
|
|
6739
|
+
function defaultSetTimout() {
|
|
6740
|
+
throw new Error('setTimeout has not been defined');
|
|
6741
|
+
}
|
|
6742
|
+
function defaultClearTimeout() {
|
|
6743
|
+
throw new Error('clearTimeout has not been defined');
|
|
6744
|
+
}
|
|
6745
|
+
(function () {
|
|
6746
|
+
try {
|
|
6747
|
+
if (typeof setTimeout === 'function') {
|
|
6748
|
+
cachedSetTimeout = setTimeout;
|
|
6749
|
+
} else {
|
|
6750
|
+
cachedSetTimeout = defaultSetTimout;
|
|
6751
|
+
}
|
|
6752
|
+
} catch (e) {
|
|
6753
|
+
cachedSetTimeout = defaultSetTimout;
|
|
6754
|
+
}
|
|
6755
|
+
try {
|
|
6756
|
+
if (typeof clearTimeout === 'function') {
|
|
6757
|
+
cachedClearTimeout = clearTimeout;
|
|
6758
|
+
} else {
|
|
6759
|
+
cachedClearTimeout = defaultClearTimeout;
|
|
6760
|
+
}
|
|
6761
|
+
} catch (e) {
|
|
6762
|
+
cachedClearTimeout = defaultClearTimeout;
|
|
6763
|
+
}
|
|
6764
|
+
})();
|
|
6765
|
+
function runTimeout(fun) {
|
|
6766
|
+
if (cachedSetTimeout === setTimeout) {
|
|
6767
|
+
//normal enviroments in sane situations
|
|
6768
|
+
return setTimeout(fun, 0);
|
|
6769
|
+
}
|
|
6770
|
+
// if setTimeout wasn't available but was latter defined
|
|
6771
|
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
6772
|
+
cachedSetTimeout = setTimeout;
|
|
6773
|
+
return setTimeout(fun, 0);
|
|
6774
|
+
}
|
|
6775
|
+
try {
|
|
6776
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
6777
|
+
return cachedSetTimeout(fun, 0);
|
|
6778
|
+
} catch (e) {
|
|
6779
|
+
try {
|
|
6780
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
6781
|
+
return cachedSetTimeout.call(null, fun, 0);
|
|
6782
|
+
} catch (e) {
|
|
6783
|
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
6784
|
+
return cachedSetTimeout.call(this, fun, 0);
|
|
6785
|
+
}
|
|
6786
|
+
}
|
|
6787
|
+
}
|
|
6788
|
+
function runClearTimeout(marker) {
|
|
6789
|
+
if (cachedClearTimeout === clearTimeout) {
|
|
6790
|
+
//normal enviroments in sane situations
|
|
6791
|
+
return clearTimeout(marker);
|
|
6792
|
+
}
|
|
6793
|
+
// if clearTimeout wasn't available but was latter defined
|
|
6794
|
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
6795
|
+
cachedClearTimeout = clearTimeout;
|
|
6796
|
+
return clearTimeout(marker);
|
|
6797
|
+
}
|
|
6798
|
+
try {
|
|
6799
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
6800
|
+
return cachedClearTimeout(marker);
|
|
6801
|
+
} catch (e) {
|
|
6802
|
+
try {
|
|
6803
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
6804
|
+
return cachedClearTimeout.call(null, marker);
|
|
6805
|
+
} catch (e) {
|
|
6806
|
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
6807
|
+
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
6808
|
+
return cachedClearTimeout.call(this, marker);
|
|
6809
|
+
}
|
|
6810
|
+
}
|
|
6811
|
+
}
|
|
6812
|
+
var queue = [];
|
|
6813
|
+
var draining = false;
|
|
6814
|
+
var currentQueue;
|
|
6815
|
+
var queueIndex = -1;
|
|
6816
|
+
function cleanUpNextTick() {
|
|
6817
|
+
if (!draining || !currentQueue) {
|
|
6818
|
+
return;
|
|
6819
|
+
}
|
|
6820
|
+
draining = false;
|
|
6821
|
+
if (currentQueue.length) {
|
|
6822
|
+
queue = currentQueue.concat(queue);
|
|
6823
|
+
} else {
|
|
6824
|
+
queueIndex = -1;
|
|
6825
|
+
}
|
|
6826
|
+
if (queue.length) {
|
|
6827
|
+
drainQueue();
|
|
6828
|
+
}
|
|
6829
|
+
}
|
|
6830
|
+
function drainQueue() {
|
|
6831
|
+
if (draining) {
|
|
6832
|
+
return;
|
|
6833
|
+
}
|
|
6834
|
+
var timeout = runTimeout(cleanUpNextTick);
|
|
6835
|
+
draining = true;
|
|
6836
|
+
var len = queue.length;
|
|
6837
|
+
while (len) {
|
|
6838
|
+
currentQueue = queue;
|
|
6839
|
+
queue = [];
|
|
6840
|
+
while (++queueIndex < len) {
|
|
6841
|
+
if (currentQueue) {
|
|
6842
|
+
currentQueue[queueIndex].run();
|
|
6843
|
+
}
|
|
6844
|
+
}
|
|
6845
|
+
queueIndex = -1;
|
|
6846
|
+
len = queue.length;
|
|
6847
|
+
}
|
|
6848
|
+
currentQueue = null;
|
|
6849
|
+
draining = false;
|
|
6850
|
+
runClearTimeout(timeout);
|
|
6851
|
+
}
|
|
6852
|
+
process$1.nextTick = function (fun) {
|
|
6853
|
+
var args = new Array(arguments.length - 1);
|
|
6854
|
+
if (arguments.length > 1) {
|
|
6855
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
6856
|
+
args[i - 1] = arguments[i];
|
|
6857
|
+
}
|
|
6858
|
+
}
|
|
6859
|
+
queue.push(new Item(fun, args));
|
|
6860
|
+
if (queue.length === 1 && !draining) {
|
|
6861
|
+
runTimeout(drainQueue);
|
|
6862
|
+
}
|
|
6863
|
+
};
|
|
6864
|
+
|
|
6865
|
+
// v8 likes predictible objects
|
|
6866
|
+
function Item(fun, array) {
|
|
6867
|
+
this.fun = fun;
|
|
6868
|
+
this.array = array;
|
|
6869
|
+
}
|
|
6870
|
+
Item.prototype.run = function () {
|
|
6871
|
+
this.fun.apply(null, this.array);
|
|
6872
|
+
};
|
|
6873
|
+
process$1.title = 'browser';
|
|
6874
|
+
process$1.browser = true;
|
|
6875
|
+
process$1.env = {};
|
|
6876
|
+
process$1.argv = [];
|
|
6877
|
+
process$1.version = ''; // empty string to avoid regexp issues
|
|
6878
|
+
process$1.versions = {};
|
|
6879
|
+
function noop$1() {}
|
|
6880
|
+
process$1.on = noop$1;
|
|
6881
|
+
process$1.addListener = noop$1;
|
|
6882
|
+
process$1.once = noop$1;
|
|
6883
|
+
process$1.off = noop$1;
|
|
6884
|
+
process$1.removeListener = noop$1;
|
|
6885
|
+
process$1.removeAllListeners = noop$1;
|
|
6886
|
+
process$1.emit = noop$1;
|
|
6887
|
+
process$1.prependListener = noop$1;
|
|
6888
|
+
process$1.prependOnceListener = noop$1;
|
|
6889
|
+
process$1.listeners = function (name) {
|
|
6890
|
+
return [];
|
|
6891
|
+
};
|
|
6892
|
+
process$1.binding = function (name) {
|
|
6893
|
+
throw new Error('process.binding is not supported');
|
|
6894
|
+
};
|
|
6895
|
+
process$1.cwd = function () {
|
|
6896
|
+
return '/';
|
|
6897
|
+
};
|
|
6898
|
+
process$1.chdir = function (dir) {
|
|
6899
|
+
throw new Error('process.chdir is not supported');
|
|
6900
|
+
};
|
|
6901
|
+
process$1.umask = function () {
|
|
6902
|
+
return 0;
|
|
6903
|
+
};
|
|
6904
|
+
var browserExports = browser.exports;
|
|
6905
|
+
var process$2 = /*@__PURE__*/getDefaultExportFromCjs(browserExports);
|
|
6906
|
+
|
|
6907
|
+
function isNode() {
|
|
6908
|
+
/**
|
|
6909
|
+
* Polyfills of 'process' might set process.browser === true
|
|
6910
|
+
*
|
|
6911
|
+
* See:
|
|
6912
|
+
* https://github.com/webpack/node-libs-browser/blob/master/mock/process.js#L8
|
|
6913
|
+
* https://github.com/defunctzombie/node-process/blob/master/browser.js#L156
|
|
6914
|
+
**/
|
|
6915
|
+
return typeof process$2 !== 'undefined' && !process$2.browser;
|
|
6916
|
+
}
|
|
6917
|
+
function isReactNative() {
|
|
6918
|
+
return typeof window !== 'undefined' && 'navigator' in window && 'product' in window.navigator && window.navigator.product === 'ReactNative';
|
|
6919
|
+
}
|
|
6920
|
+
function getNodeVersion() {
|
|
6921
|
+
return process$2.versions && process$2.versions.node ? "v".concat(process$2.versions.node) : process$2.version;
|
|
6922
|
+
}
|
|
6923
|
+
function getWindow() {
|
|
6924
|
+
return window;
|
|
6925
|
+
}
|
|
6926
|
+
function noop() {
|
|
6927
|
+
return undefined;
|
|
6928
|
+
}
|
|
6929
|
+
|
|
6930
|
+
var delay = function delay(ms) {
|
|
6931
|
+
return new Promise(function (resolve) {
|
|
6932
|
+
setTimeout(resolve, ms);
|
|
6933
|
+
});
|
|
6934
|
+
};
|
|
6935
|
+
var defaultWait = function defaultWait(attempts) {
|
|
6936
|
+
return Math.pow(Math.SQRT2, attempts);
|
|
6937
|
+
};
|
|
6938
|
+
function rateLimit(instance) {
|
|
6939
|
+
var maxRetry = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
|
|
6940
|
+
var _instance$defaults = instance.defaults,
|
|
6941
|
+
_instance$defaults$re = _instance$defaults.responseLogger,
|
|
6942
|
+
responseLogger = _instance$defaults$re === void 0 ? noop : _instance$defaults$re,
|
|
6943
|
+
_instance$defaults$re2 = _instance$defaults.requestLogger,
|
|
6944
|
+
requestLogger = _instance$defaults$re2 === void 0 ? noop : _instance$defaults$re2;
|
|
6945
|
+
instance.interceptors.request.use(function (config) {
|
|
6946
|
+
requestLogger(config);
|
|
6947
|
+
return config;
|
|
6948
|
+
}, function (error) {
|
|
6949
|
+
requestLogger(error);
|
|
6950
|
+
return Promise.reject(error);
|
|
6951
|
+
});
|
|
6952
|
+
instance.interceptors.response.use(function (response) {
|
|
6953
|
+
// we don't need to do anything here
|
|
6954
|
+
responseLogger(response);
|
|
6955
|
+
return response;
|
|
6956
|
+
}, /*#__PURE__*/function () {
|
|
6957
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(error) {
|
|
6958
|
+
var response, config, doneAttempts, retryErrorType, wait;
|
|
6959
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
6960
|
+
while (1) switch (_context.prev = _context.next) {
|
|
6961
|
+
case 0:
|
|
6962
|
+
response = error.response;
|
|
6963
|
+
config = error.config;
|
|
6964
|
+
responseLogger(error);
|
|
6965
|
+
// Do not retry if it is disabled or no request config exists (not an axios error)
|
|
6966
|
+
if (!(!config || !instance.defaults.retryOnError)) {
|
|
6967
|
+
_context.next = 5;
|
|
6968
|
+
break;
|
|
6969
|
+
}
|
|
6970
|
+
return _context.abrupt("return", Promise.reject(error));
|
|
6971
|
+
case 5:
|
|
6972
|
+
// Retried already for max attempts
|
|
6973
|
+
doneAttempts = config.attempts || 1;
|
|
6974
|
+
if (!(doneAttempts > maxRetry)) {
|
|
6975
|
+
_context.next = 9;
|
|
6976
|
+
break;
|
|
6977
|
+
}
|
|
6978
|
+
error.attempts = config.attempts;
|
|
6979
|
+
return _context.abrupt("return", Promise.reject(error));
|
|
6980
|
+
case 9:
|
|
6981
|
+
retryErrorType = null;
|
|
6982
|
+
wait = defaultWait(doneAttempts); // Errors without response did not receive anything from the server
|
|
6983
|
+
if (!response) {
|
|
6984
|
+
retryErrorType = 'Connection';
|
|
6985
|
+
} else if (response.status >= 500 && response.status < 600) {
|
|
6986
|
+
// 5** errors are server related
|
|
6987
|
+
retryErrorType = "Server ".concat(response.status);
|
|
6988
|
+
} else if (response.status === 429) {
|
|
6989
|
+
// 429 errors are exceeded rate limit exceptions
|
|
6990
|
+
retryErrorType = 'Rate limit';
|
|
6991
|
+
// all headers are lowercased by axios https://github.com/mzabriskie/axios/issues/413
|
|
6992
|
+
if (response.headers && error.response.headers['x-contentful-ratelimit-reset']) {
|
|
6993
|
+
wait = response.headers['x-contentful-ratelimit-reset'];
|
|
6994
|
+
}
|
|
6995
|
+
}
|
|
6996
|
+
if (!retryErrorType) {
|
|
6997
|
+
_context.next = 19;
|
|
6998
|
+
break;
|
|
6999
|
+
}
|
|
7000
|
+
// convert to ms and add jitter
|
|
7001
|
+
wait = Math.floor(wait * 1000 + Math.random() * 200 + 500);
|
|
7002
|
+
instance.defaults.logHandler('warning', "".concat(retryErrorType, " error occurred. Waiting for ").concat(wait, " ms before retrying..."));
|
|
7003
|
+
// increase attempts counter
|
|
7004
|
+
config.attempts = doneAttempts + 1;
|
|
7005
|
+
/* Somehow between the interceptor and retrying the request the httpAgent/httpsAgent gets transformed from an Agent-like object
|
|
7006
|
+
to a regular object, causing failures on retries after rate limits. Removing these properties here fixes the error, but retry
|
|
7007
|
+
requests still use the original http/httpsAgent property */
|
|
7008
|
+
delete config.httpAgent;
|
|
7009
|
+
delete config.httpsAgent;
|
|
7010
|
+
return _context.abrupt("return", delay(wait).then(function () {
|
|
7011
|
+
return instance(config);
|
|
7012
|
+
}));
|
|
7013
|
+
case 19:
|
|
7014
|
+
return _context.abrupt("return", Promise.reject(error));
|
|
7015
|
+
case 20:
|
|
7016
|
+
case "end":
|
|
7017
|
+
return _context.stop();
|
|
7018
|
+
}
|
|
7019
|
+
}, _callee);
|
|
7020
|
+
}));
|
|
7021
|
+
return function (_x) {
|
|
7022
|
+
return _ref.apply(this, arguments);
|
|
7023
|
+
};
|
|
7024
|
+
}());
|
|
7025
|
+
}
|
|
7026
|
+
|
|
7027
|
+
function _setPrototypeOf(t, e) {
|
|
7028
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
7029
|
+
return t.__proto__ = e, t;
|
|
7030
|
+
}, _setPrototypeOf(t, e);
|
|
7031
|
+
}
|
|
7032
|
+
|
|
7033
|
+
function _inherits(t, e) {
|
|
7034
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
7035
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
7036
|
+
constructor: {
|
|
7037
|
+
value: t,
|
|
7038
|
+
writable: !0,
|
|
7039
|
+
configurable: !0
|
|
7040
|
+
}
|
|
7041
|
+
}), Object.defineProperty(t, "prototype", {
|
|
7042
|
+
writable: !1
|
|
7043
|
+
}), e && _setPrototypeOf(t, e);
|
|
7044
|
+
}
|
|
7045
|
+
|
|
7046
|
+
var freeGlobal$1 = (typeof global === "undefined" ? "undefined" : _typeof$2(global)) == 'object' && global && global.Object === Object && global;
|
|
7047
|
+
var _freeGlobal = freeGlobal$1;
|
|
7048
|
+
|
|
7049
|
+
var freeGlobal = _freeGlobal;
|
|
7050
|
+
|
|
7051
|
+
/** Detect free variable `self`. */
|
|
7052
|
+
var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof$2(self)) == 'object' && self && self.Object === Object && self;
|
|
7053
|
+
|
|
7054
|
+
/** Used as a reference to the global object. */
|
|
7055
|
+
var root$1 = freeGlobal || freeSelf || Function('return this')();
|
|
7056
|
+
var _root = root$1;
|
|
7057
|
+
|
|
7058
|
+
var root = _root;
|
|
7059
|
+
|
|
7060
|
+
/** Built-in value references. */
|
|
7061
|
+
var _Symbol2 = root.Symbol;
|
|
7062
|
+
var _Symbol$2 = _Symbol2;
|
|
7063
|
+
|
|
7064
|
+
var _Symbol$1 = _Symbol$2;
|
|
7065
|
+
|
|
7066
|
+
/** Used for built-in method references. */
|
|
7067
|
+
var objectProto$2 = Object.prototype;
|
|
7068
|
+
|
|
7069
|
+
/** Used to check objects for own properties. */
|
|
7070
|
+
var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
|
|
7071
|
+
|
|
7072
|
+
/**
|
|
7073
|
+
* Used to resolve the
|
|
7074
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
7075
|
+
* of values.
|
|
7076
|
+
*/
|
|
7077
|
+
var nativeObjectToString$1 = objectProto$2.toString;
|
|
7078
|
+
|
|
7079
|
+
/** Built-in value references. */
|
|
7080
|
+
var symToStringTag$1 = _Symbol$1 ? _Symbol$1.toStringTag : undefined;
|
|
7081
|
+
|
|
7082
|
+
/**
|
|
7083
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
7084
|
+
*
|
|
7085
|
+
* @private
|
|
7086
|
+
* @param {*} value The value to query.
|
|
7087
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
7088
|
+
*/
|
|
7089
|
+
function getRawTag$1(value) {
|
|
7090
|
+
var isOwn = hasOwnProperty$1.call(value, symToStringTag$1),
|
|
7091
|
+
tag = value[symToStringTag$1];
|
|
7092
|
+
try {
|
|
7093
|
+
value[symToStringTag$1] = undefined;
|
|
7094
|
+
var unmasked = true;
|
|
7095
|
+
} catch (e) {}
|
|
7096
|
+
var result = nativeObjectToString$1.call(value);
|
|
7097
|
+
if (unmasked) {
|
|
7098
|
+
if (isOwn) {
|
|
7099
|
+
value[symToStringTag$1] = tag;
|
|
7100
|
+
} else {
|
|
7101
|
+
delete value[symToStringTag$1];
|
|
7102
|
+
}
|
|
7103
|
+
}
|
|
7104
|
+
return result;
|
|
7105
|
+
}
|
|
7106
|
+
var _getRawTag = getRawTag$1;
|
|
7107
|
+
|
|
7108
|
+
/** Used for built-in method references. */
|
|
6687
7109
|
var objectProto$1 = Object.prototype;
|
|
6688
7110
|
|
|
6689
7111
|
/**
|
|
6690
|
-
* Used to resolve the
|
|
7112
|
+
* Used to resolve the
|
|
7113
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
6691
7114
|
* of values.
|
|
6692
7115
|
*/
|
|
6693
|
-
var
|
|
7116
|
+
var nativeObjectToString = objectProto$1.toString;
|
|
7117
|
+
|
|
7118
|
+
/**
|
|
7119
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
7120
|
+
*
|
|
7121
|
+
* @private
|
|
7122
|
+
* @param {*} value The value to convert.
|
|
7123
|
+
* @returns {string} Returns the converted string.
|
|
7124
|
+
*/
|
|
7125
|
+
function objectToString$1(value) {
|
|
7126
|
+
return nativeObjectToString.call(value);
|
|
7127
|
+
}
|
|
7128
|
+
var _objectToString = objectToString$1;
|
|
7129
|
+
|
|
7130
|
+
var _Symbol = _Symbol$2,
|
|
7131
|
+
getRawTag = _getRawTag,
|
|
7132
|
+
objectToString = _objectToString;
|
|
7133
|
+
|
|
7134
|
+
/** `Object#toString` result references. */
|
|
7135
|
+
var nullTag = '[object Null]',
|
|
7136
|
+
undefinedTag = '[object Undefined]';
|
|
7137
|
+
|
|
7138
|
+
/** Built-in value references. */
|
|
7139
|
+
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
|
7140
|
+
|
|
7141
|
+
/**
|
|
7142
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
7143
|
+
*
|
|
7144
|
+
* @private
|
|
7145
|
+
* @param {*} value The value to query.
|
|
7146
|
+
* @returns {string} Returns the `toStringTag`.
|
|
7147
|
+
*/
|
|
7148
|
+
function baseGetTag$2(value) {
|
|
7149
|
+
if (value == null) {
|
|
7150
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
7151
|
+
}
|
|
7152
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
7153
|
+
}
|
|
7154
|
+
var _baseGetTag = baseGetTag$2;
|
|
6694
7155
|
|
|
6695
7156
|
/**
|
|
6696
7157
|
* Checks if `value` is classified as an `Array` object.
|
|
6697
7158
|
*
|
|
6698
7159
|
* @static
|
|
6699
7160
|
* @memberOf _
|
|
6700
|
-
* @
|
|
7161
|
+
* @since 0.1.0
|
|
6701
7162
|
* @category Lang
|
|
6702
7163
|
* @param {*} value The value to check.
|
|
6703
|
-
* @returns {boolean} Returns `true` if `value` is
|
|
7164
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
6704
7165
|
* @example
|
|
6705
7166
|
*
|
|
6706
7167
|
* _.isArray([1, 2, 3]);
|
|
@@ -6715,56 +7176,43 @@ var contentful = (function (exports) {
|
|
|
6715
7176
|
* _.isArray(_.noop);
|
|
6716
7177
|
* // => false
|
|
6717
7178
|
*/
|
|
6718
|
-
var isArray = Array.isArray;
|
|
7179
|
+
var isArray$1 = Array.isArray;
|
|
7180
|
+
var isArray_1 = isArray$1;
|
|
7181
|
+
|
|
7182
|
+
function isObjectLike$2(value) {
|
|
7183
|
+
return value != null && _typeof$2(value) == 'object';
|
|
7184
|
+
}
|
|
7185
|
+
var isObjectLike_1 = isObjectLike$2;
|
|
7186
|
+
|
|
7187
|
+
var baseGetTag$1 = _baseGetTag,
|
|
7188
|
+
isArray = isArray_1,
|
|
7189
|
+
isObjectLike$1 = isObjectLike_1;
|
|
7190
|
+
|
|
7191
|
+
/** `Object#toString` result references. */
|
|
7192
|
+
var stringTag = '[object String]';
|
|
6719
7193
|
|
|
6720
7194
|
/**
|
|
6721
|
-
* Checks if `value` is
|
|
6722
|
-
* and has a `typeof` result of "object".
|
|
7195
|
+
* Checks if `value` is classified as a `String` primitive or object.
|
|
6723
7196
|
*
|
|
6724
7197
|
* @static
|
|
7198
|
+
* @since 0.1.0
|
|
6725
7199
|
* @memberOf _
|
|
6726
7200
|
* @category Lang
|
|
6727
7201
|
* @param {*} value The value to check.
|
|
6728
|
-
* @returns {boolean} Returns `true` if `value` is
|
|
7202
|
+
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
|
|
6729
7203
|
* @example
|
|
6730
7204
|
*
|
|
6731
|
-
* _.
|
|
6732
|
-
* // => true
|
|
6733
|
-
*
|
|
6734
|
-
* _.isObjectLike([1, 2, 3]);
|
|
6735
|
-
* // => true
|
|
6736
|
-
*
|
|
6737
|
-
* _.isObjectLike(_.noop);
|
|
6738
|
-
* // => false
|
|
6739
|
-
*
|
|
6740
|
-
* _.isObjectLike(null);
|
|
6741
|
-
* // => false
|
|
6742
|
-
*/
|
|
6743
|
-
function isObjectLike$1(value) {
|
|
6744
|
-
return !!value && _typeof$3(value) == 'object';
|
|
6745
|
-
}
|
|
6746
|
-
|
|
6747
|
-
/**
|
|
6748
|
-
* Checks if `value` is classified as a `String` primitive or object.
|
|
6749
|
-
*
|
|
6750
|
-
* @static
|
|
6751
|
-
* @memberOf _
|
|
6752
|
-
* @category Lang
|
|
6753
|
-
* @param {*} value The value to check.
|
|
6754
|
-
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
6755
|
-
* @example
|
|
6756
|
-
*
|
|
6757
|
-
* _.isString('abc');
|
|
7205
|
+
* _.isString('abc');
|
|
6758
7206
|
* // => true
|
|
6759
7207
|
*
|
|
6760
7208
|
* _.isString(1);
|
|
6761
7209
|
* // => false
|
|
6762
7210
|
*/
|
|
6763
7211
|
function isString(value) {
|
|
6764
|
-
return typeof value == 'string' || !isArray(value) && isObjectLike$1(value) &&
|
|
7212
|
+
return typeof value == 'string' || !isArray(value) && isObjectLike$1(value) && baseGetTag$1(value) == stringTag;
|
|
6765
7213
|
}
|
|
6766
|
-
var
|
|
6767
|
-
var isString$1 = /*@__PURE__*/getDefaultExportFromCjs(
|
|
7214
|
+
var isString_1 = isString;
|
|
7215
|
+
var isString$1 = /*@__PURE__*/getDefaultExportFromCjs(isString_1);
|
|
6768
7216
|
|
|
6769
7217
|
function _assertThisInitialized(e) {
|
|
6770
7218
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -6772,7 +7220,7 @@ var contentful = (function (exports) {
|
|
|
6772
7220
|
}
|
|
6773
7221
|
|
|
6774
7222
|
function _possibleConstructorReturn(t, e) {
|
|
6775
|
-
if (e && ("object" == _typeof$
|
|
7223
|
+
if (e && ("object" == _typeof$2(e) || "function" == typeof e)) return e;
|
|
6776
7224
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
6777
7225
|
return _assertThisInitialized(t);
|
|
6778
7226
|
}
|
|
@@ -6783,25 +7231,6 @@ var contentful = (function (exports) {
|
|
|
6783
7231
|
}, _getPrototypeOf(t);
|
|
6784
7232
|
}
|
|
6785
7233
|
|
|
6786
|
-
function _setPrototypeOf$1(t, e) {
|
|
6787
|
-
return _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
6788
|
-
return t.__proto__ = e, t;
|
|
6789
|
-
}, _setPrototypeOf$1(t, e);
|
|
6790
|
-
}
|
|
6791
|
-
|
|
6792
|
-
function _inherits$1(t, e) {
|
|
6793
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
6794
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
6795
|
-
constructor: {
|
|
6796
|
-
value: t,
|
|
6797
|
-
writable: !0,
|
|
6798
|
-
configurable: !0
|
|
6799
|
-
}
|
|
6800
|
-
}), Object.defineProperty(t, "prototype", {
|
|
6801
|
-
writable: !1
|
|
6802
|
-
}), e && _setPrototypeOf$1(t, e);
|
|
6803
|
-
}
|
|
6804
|
-
|
|
6805
7234
|
function _isNativeFunction(t) {
|
|
6806
7235
|
try {
|
|
6807
7236
|
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
@@ -6824,7 +7253,7 @@ var contentful = (function (exports) {
|
|
|
6824
7253
|
var o = [null];
|
|
6825
7254
|
o.push.apply(o, e);
|
|
6826
7255
|
var p = new (t.bind.apply(t, o))();
|
|
6827
|
-
return r && _setPrototypeOf
|
|
7256
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
6828
7257
|
}
|
|
6829
7258
|
|
|
6830
7259
|
function _wrapNativeSuper(t) {
|
|
@@ -6846,12 +7275,10 @@ var contentful = (function (exports) {
|
|
|
6846
7275
|
writable: !0,
|
|
6847
7276
|
configurable: !0
|
|
6848
7277
|
}
|
|
6849
|
-
}), _setPrototypeOf
|
|
7278
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
6850
7279
|
}, _wrapNativeSuper(t);
|
|
6851
7280
|
}
|
|
6852
7281
|
|
|
6853
|
-
var pThrottle$2 = {exports: {}};
|
|
6854
|
-
|
|
6855
7282
|
function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
6856
7283
|
function _unsupportedIterableToArray$2(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$2(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; } }
|
|
6857
7284
|
function _arrayLikeToArray$2(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -6865,13 +7292,13 @@ var contentful = (function (exports) {
|
|
|
6865
7292
|
_this.name = 'AbortError';
|
|
6866
7293
|
return _this;
|
|
6867
7294
|
}
|
|
6868
|
-
_inherits
|
|
7295
|
+
_inherits(AbortError, _Error);
|
|
6869
7296
|
return _createClass(AbortError);
|
|
6870
7297
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
6871
|
-
|
|
7298
|
+
function pThrottle(_ref) {
|
|
6872
7299
|
var limit = _ref.limit,
|
|
6873
7300
|
interval = _ref.interval,
|
|
6874
|
-
|
|
7301
|
+
onDelay = _ref.onDelay;
|
|
6875
7302
|
if (!Number.isFinite(limit)) {
|
|
6876
7303
|
throw new TypeError('Expected `limit` to be a finite number');
|
|
6877
7304
|
}
|
|
@@ -6884,881 +7311,81 @@ var contentful = (function (exports) {
|
|
|
6884
7311
|
function windowedDelay() {
|
|
6885
7312
|
var now = Date.now();
|
|
6886
7313
|
if (now - currentTick > interval) {
|
|
6887
|
-
activeCount = 1;
|
|
6888
|
-
currentTick = now;
|
|
6889
|
-
return 0;
|
|
6890
|
-
}
|
|
6891
|
-
if (activeCount < limit) {
|
|
6892
|
-
activeCount++;
|
|
6893
|
-
} else {
|
|
6894
|
-
currentTick += interval;
|
|
6895
|
-
activeCount = 1;
|
|
6896
|
-
}
|
|
6897
|
-
return currentTick - now;
|
|
6898
|
-
}
|
|
6899
|
-
var strictTicks = [];
|
|
6900
|
-
function strictDelay() {
|
|
6901
|
-
var now = Date.now();
|
|
6902
|
-
if (strictTicks.length < limit) {
|
|
6903
|
-
strictTicks.push(now);
|
|
6904
|
-
return 0;
|
|
6905
|
-
}
|
|
6906
|
-
var earliestTime = strictTicks.shift() + interval;
|
|
6907
|
-
if (now >= earliestTime) {
|
|
6908
|
-
strictTicks.push(now);
|
|
6909
|
-
return 0;
|
|
6910
|
-
}
|
|
6911
|
-
strictTicks.push(earliestTime);
|
|
6912
|
-
return earliestTime - now;
|
|
6913
|
-
}
|
|
6914
|
-
var getDelay = strict ? strictDelay : windowedDelay;
|
|
6915
|
-
return function (function_) {
|
|
6916
|
-
var _throttled = function throttled() {
|
|
6917
|
-
var _this2 = this;
|
|
6918
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
6919
|
-
args[_key] = arguments[_key];
|
|
6920
|
-
}
|
|
6921
|
-
if (!_throttled.isEnabled) {
|
|
6922
|
-
return _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee() {
|
|
6923
|
-
return _regeneratorRuntime$1.wrap(function _callee$(_context) {
|
|
6924
|
-
while (1) switch (_context.prev = _context.next) {
|
|
6925
|
-
case 0:
|
|
6926
|
-
return _context.abrupt("return", function_.apply(_this2, args));
|
|
6927
|
-
case 1:
|
|
6928
|
-
case "end":
|
|
6929
|
-
return _context.stop();
|
|
6930
|
-
}
|
|
6931
|
-
}, _callee);
|
|
6932
|
-
}))();
|
|
6933
|
-
}
|
|
6934
|
-
var timeout;
|
|
6935
|
-
return new Promise(function (resolve, reject) {
|
|
6936
|
-
var execute = function execute() {
|
|
6937
|
-
resolve(function_.apply(_this2, args));
|
|
6938
|
-
queue.delete(timeout);
|
|
6939
|
-
};
|
|
6940
|
-
timeout = setTimeout(execute, getDelay());
|
|
6941
|
-
queue.set(timeout, reject);
|
|
6942
|
-
});
|
|
6943
|
-
};
|
|
6944
|
-
_throttled.abort = function () {
|
|
6945
|
-
var _iterator = _createForOfIteratorHelper$2(queue.keys()),
|
|
6946
|
-
_step;
|
|
6947
|
-
try {
|
|
6948
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6949
|
-
var timeout = _step.value;
|
|
6950
|
-
clearTimeout(timeout);
|
|
6951
|
-
queue.get(timeout)(new AbortError());
|
|
6952
|
-
}
|
|
6953
|
-
} catch (err) {
|
|
6954
|
-
_iterator.e(err);
|
|
6955
|
-
} finally {
|
|
6956
|
-
_iterator.f();
|
|
6957
|
-
}
|
|
6958
|
-
queue.clear();
|
|
6959
|
-
strictTicks.splice(0, strictTicks.length);
|
|
6960
|
-
};
|
|
6961
|
-
_throttled.isEnabled = true;
|
|
6962
|
-
return _throttled;
|
|
6963
|
-
};
|
|
6964
|
-
};
|
|
6965
|
-
pThrottle$2.exports = pThrottle;
|
|
6966
|
-
pThrottle$2.exports.AbortError = AbortError;
|
|
6967
|
-
var pThrottleExports = pThrottle$2.exports;
|
|
6968
|
-
var pThrottle$1 = /*@__PURE__*/getDefaultExportFromCjs(pThrottleExports);
|
|
6969
|
-
|
|
6970
|
-
/** `Object#toString` result references. */
|
|
6971
|
-
var objectTag = '[object Object]';
|
|
6972
|
-
|
|
6973
|
-
/**
|
|
6974
|
-
* Checks if `value` is a host object in IE < 9.
|
|
6975
|
-
*
|
|
6976
|
-
* @private
|
|
6977
|
-
* @param {*} value The value to check.
|
|
6978
|
-
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
|
6979
|
-
*/
|
|
6980
|
-
function isHostObject(value) {
|
|
6981
|
-
// Many host objects are `Object` objects that can coerce to strings
|
|
6982
|
-
// despite having improperly defined `toString` methods.
|
|
6983
|
-
var result = false;
|
|
6984
|
-
if (value != null && typeof value.toString != 'function') {
|
|
6985
|
-
try {
|
|
6986
|
-
result = !!(value + '');
|
|
6987
|
-
} catch (e) {}
|
|
6988
|
-
}
|
|
6989
|
-
return result;
|
|
6990
|
-
}
|
|
6991
|
-
|
|
6992
|
-
/**
|
|
6993
|
-
* Creates a unary function that invokes `func` with its argument transformed.
|
|
6994
|
-
*
|
|
6995
|
-
* @private
|
|
6996
|
-
* @param {Function} func The function to wrap.
|
|
6997
|
-
* @param {Function} transform The argument transform.
|
|
6998
|
-
* @returns {Function} Returns the new function.
|
|
6999
|
-
*/
|
|
7000
|
-
function overArg(func, transform) {
|
|
7001
|
-
return function (arg) {
|
|
7002
|
-
return func(transform(arg));
|
|
7003
|
-
};
|
|
7004
|
-
}
|
|
7005
|
-
|
|
7006
|
-
/** Used for built-in method references. */
|
|
7007
|
-
var funcProto = Function.prototype,
|
|
7008
|
-
objectProto = Object.prototype;
|
|
7009
|
-
|
|
7010
|
-
/** Used to resolve the decompiled source of functions. */
|
|
7011
|
-
var funcToString = funcProto.toString;
|
|
7012
|
-
|
|
7013
|
-
/** Used to check objects for own properties. */
|
|
7014
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
7015
|
-
|
|
7016
|
-
/** Used to infer the `Object` constructor. */
|
|
7017
|
-
var objectCtorString = funcToString.call(Object);
|
|
7018
|
-
|
|
7019
|
-
/**
|
|
7020
|
-
* Used to resolve the
|
|
7021
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
7022
|
-
* of values.
|
|
7023
|
-
*/
|
|
7024
|
-
var objectToString = objectProto.toString;
|
|
7025
|
-
|
|
7026
|
-
/** Built-in value references. */
|
|
7027
|
-
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
7028
|
-
|
|
7029
|
-
/**
|
|
7030
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
7031
|
-
* and has a `typeof` result of "object".
|
|
7032
|
-
*
|
|
7033
|
-
* @static
|
|
7034
|
-
* @memberOf _
|
|
7035
|
-
* @since 4.0.0
|
|
7036
|
-
* @category Lang
|
|
7037
|
-
* @param {*} value The value to check.
|
|
7038
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
7039
|
-
* @example
|
|
7040
|
-
*
|
|
7041
|
-
* _.isObjectLike({});
|
|
7042
|
-
* // => true
|
|
7043
|
-
*
|
|
7044
|
-
* _.isObjectLike([1, 2, 3]);
|
|
7045
|
-
* // => true
|
|
7046
|
-
*
|
|
7047
|
-
* _.isObjectLike(_.noop);
|
|
7048
|
-
* // => false
|
|
7049
|
-
*
|
|
7050
|
-
* _.isObjectLike(null);
|
|
7051
|
-
* // => false
|
|
7052
|
-
*/
|
|
7053
|
-
function isObjectLike(value) {
|
|
7054
|
-
return !!value && _typeof$3(value) == 'object';
|
|
7055
|
-
}
|
|
7056
|
-
|
|
7057
|
-
/**
|
|
7058
|
-
* Checks if `value` is a plain object, that is, an object created by the
|
|
7059
|
-
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
7060
|
-
*
|
|
7061
|
-
* @static
|
|
7062
|
-
* @memberOf _
|
|
7063
|
-
* @since 0.8.0
|
|
7064
|
-
* @category Lang
|
|
7065
|
-
* @param {*} value The value to check.
|
|
7066
|
-
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
7067
|
-
* @example
|
|
7068
|
-
*
|
|
7069
|
-
* function Foo() {
|
|
7070
|
-
* this.a = 1;
|
|
7071
|
-
* }
|
|
7072
|
-
*
|
|
7073
|
-
* _.isPlainObject(new Foo);
|
|
7074
|
-
* // => false
|
|
7075
|
-
*
|
|
7076
|
-
* _.isPlainObject([1, 2, 3]);
|
|
7077
|
-
* // => false
|
|
7078
|
-
*
|
|
7079
|
-
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
7080
|
-
* // => true
|
|
7081
|
-
*
|
|
7082
|
-
* _.isPlainObject(Object.create(null));
|
|
7083
|
-
* // => true
|
|
7084
|
-
*/
|
|
7085
|
-
function isPlainObject(value) {
|
|
7086
|
-
if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) {
|
|
7087
|
-
return false;
|
|
7088
|
-
}
|
|
7089
|
-
var proto = getPrototype(value);
|
|
7090
|
-
if (proto === null) {
|
|
7091
|
-
return true;
|
|
7092
|
-
}
|
|
7093
|
-
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
7094
|
-
return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
7095
|
-
}
|
|
7096
|
-
var lodash_isplainobject = isPlainObject;
|
|
7097
|
-
var isPlainObject$1 = /*@__PURE__*/getDefaultExportFromCjs(lodash_isplainobject);
|
|
7098
|
-
|
|
7099
|
-
function _arrayLikeToArray$1(r, a) {
|
|
7100
|
-
(null == a || a > r.length) && (a = r.length);
|
|
7101
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
7102
|
-
return n;
|
|
7103
|
-
}
|
|
7104
|
-
function _arrayWithHoles(r) {
|
|
7105
|
-
if (Array.isArray(r)) return r;
|
|
7106
|
-
}
|
|
7107
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
7108
|
-
try {
|
|
7109
|
-
var i = n[a](c),
|
|
7110
|
-
u = i.value;
|
|
7111
|
-
} catch (n) {
|
|
7112
|
-
return void e(n);
|
|
7113
|
-
}
|
|
7114
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
7115
|
-
}
|
|
7116
|
-
function _asyncToGenerator(n) {
|
|
7117
|
-
return function () {
|
|
7118
|
-
var t = this,
|
|
7119
|
-
e = arguments;
|
|
7120
|
-
return new Promise(function (r, o) {
|
|
7121
|
-
var a = n.apply(t, e);
|
|
7122
|
-
function _next(n) {
|
|
7123
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
7124
|
-
}
|
|
7125
|
-
function _throw(n) {
|
|
7126
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
7127
|
-
}
|
|
7128
|
-
_next(void 0);
|
|
7129
|
-
});
|
|
7130
|
-
};
|
|
7131
|
-
}
|
|
7132
|
-
function _createForOfIteratorHelper$1(r, e) {
|
|
7133
|
-
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
7134
|
-
if (!t) {
|
|
7135
|
-
if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e) {
|
|
7136
|
-
t && (r = t);
|
|
7137
|
-
var _n = 0,
|
|
7138
|
-
F = function F() {};
|
|
7139
|
-
return {
|
|
7140
|
-
s: F,
|
|
7141
|
-
n: function n() {
|
|
7142
|
-
return _n >= r.length ? {
|
|
7143
|
-
done: !0
|
|
7144
|
-
} : {
|
|
7145
|
-
done: !1,
|
|
7146
|
-
value: r[_n++]
|
|
7147
|
-
};
|
|
7148
|
-
},
|
|
7149
|
-
e: function e(r) {
|
|
7150
|
-
throw r;
|
|
7151
|
-
},
|
|
7152
|
-
f: F
|
|
7153
|
-
};
|
|
7154
|
-
}
|
|
7155
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
7156
|
-
}
|
|
7157
|
-
var o,
|
|
7158
|
-
a = !0,
|
|
7159
|
-
u = !1;
|
|
7160
|
-
return {
|
|
7161
|
-
s: function s() {
|
|
7162
|
-
t = t.call(r);
|
|
7163
|
-
},
|
|
7164
|
-
n: function n() {
|
|
7165
|
-
var r = t.next();
|
|
7166
|
-
return a = r.done, r;
|
|
7167
|
-
},
|
|
7168
|
-
e: function e(r) {
|
|
7169
|
-
u = !0, o = r;
|
|
7170
|
-
},
|
|
7171
|
-
f: function f() {
|
|
7172
|
-
try {
|
|
7173
|
-
a || null == t.return || t.return();
|
|
7174
|
-
} finally {
|
|
7175
|
-
if (u) throw o;
|
|
7176
|
-
}
|
|
7177
|
-
}
|
|
7178
|
-
};
|
|
7179
|
-
}
|
|
7180
|
-
function _defineProperty(e, r, t) {
|
|
7181
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
7182
|
-
value: t,
|
|
7183
|
-
enumerable: !0,
|
|
7184
|
-
configurable: !0,
|
|
7185
|
-
writable: !0
|
|
7186
|
-
}) : e[r] = t, e;
|
|
7187
|
-
}
|
|
7188
|
-
function _inherits(t, e) {
|
|
7189
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
7190
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
7191
|
-
constructor: {
|
|
7192
|
-
value: t,
|
|
7193
|
-
writable: !0,
|
|
7194
|
-
configurable: !0
|
|
7195
|
-
}
|
|
7196
|
-
}), Object.defineProperty(t, "prototype", {
|
|
7197
|
-
writable: !1
|
|
7198
|
-
}), e && _setPrototypeOf(t, e);
|
|
7199
|
-
}
|
|
7200
|
-
function _iterableToArrayLimit(r, l) {
|
|
7201
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
7202
|
-
if (null != t) {
|
|
7203
|
-
var e,
|
|
7204
|
-
n,
|
|
7205
|
-
i,
|
|
7206
|
-
u,
|
|
7207
|
-
a = [],
|
|
7208
|
-
f = !0,
|
|
7209
|
-
o = !1;
|
|
7210
|
-
try {
|
|
7211
|
-
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
7212
|
-
} catch (r) {
|
|
7213
|
-
o = !0, n = r;
|
|
7214
|
-
} finally {
|
|
7215
|
-
try {
|
|
7216
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
7217
|
-
} finally {
|
|
7218
|
-
if (o) throw n;
|
|
7219
|
-
}
|
|
7220
|
-
}
|
|
7221
|
-
return a;
|
|
7222
|
-
}
|
|
7223
|
-
}
|
|
7224
|
-
function _nonIterableRest() {
|
|
7225
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
7226
|
-
}
|
|
7227
|
-
function ownKeys(e, r) {
|
|
7228
|
-
var t = Object.keys(e);
|
|
7229
|
-
if (Object.getOwnPropertySymbols) {
|
|
7230
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
7231
|
-
r && (o = o.filter(function (r) {
|
|
7232
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
7233
|
-
})), t.push.apply(t, o);
|
|
7234
|
-
}
|
|
7235
|
-
return t;
|
|
7236
|
-
}
|
|
7237
|
-
function _objectSpread2(e) {
|
|
7238
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
7239
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
7240
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
7241
|
-
_defineProperty(e, r, t[r]);
|
|
7242
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
7243
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
7244
|
-
});
|
|
7245
|
-
}
|
|
7246
|
-
return e;
|
|
7247
|
-
}
|
|
7248
|
-
function _regeneratorRuntime() {
|
|
7249
|
-
_regeneratorRuntime = function _regeneratorRuntime() {
|
|
7250
|
-
return e;
|
|
7251
|
-
};
|
|
7252
|
-
var t,
|
|
7253
|
-
e = {},
|
|
7254
|
-
r = Object.prototype,
|
|
7255
|
-
n = r.hasOwnProperty,
|
|
7256
|
-
o = Object.defineProperty || function (t, e, r) {
|
|
7257
|
-
t[e] = r.value;
|
|
7258
|
-
},
|
|
7259
|
-
i = "function" == typeof Symbol ? Symbol : {},
|
|
7260
|
-
a = i.iterator || "@@iterator",
|
|
7261
|
-
c = i.asyncIterator || "@@asyncIterator",
|
|
7262
|
-
u = i.toStringTag || "@@toStringTag";
|
|
7263
|
-
function define(t, e, r) {
|
|
7264
|
-
return Object.defineProperty(t, e, {
|
|
7265
|
-
value: r,
|
|
7266
|
-
enumerable: !0,
|
|
7267
|
-
configurable: !0,
|
|
7268
|
-
writable: !0
|
|
7269
|
-
}), t[e];
|
|
7270
|
-
}
|
|
7271
|
-
try {
|
|
7272
|
-
define({}, "");
|
|
7273
|
-
} catch (t) {
|
|
7274
|
-
define = function define(t, e, r) {
|
|
7275
|
-
return t[e] = r;
|
|
7276
|
-
};
|
|
7277
|
-
}
|
|
7278
|
-
function wrap(t, e, r, n) {
|
|
7279
|
-
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
7280
|
-
a = Object.create(i.prototype),
|
|
7281
|
-
c = new Context(n || []);
|
|
7282
|
-
return o(a, "_invoke", {
|
|
7283
|
-
value: makeInvokeMethod(t, r, c)
|
|
7284
|
-
}), a;
|
|
7285
|
-
}
|
|
7286
|
-
function tryCatch(t, e, r) {
|
|
7287
|
-
try {
|
|
7288
|
-
return {
|
|
7289
|
-
type: "normal",
|
|
7290
|
-
arg: t.call(e, r)
|
|
7291
|
-
};
|
|
7292
|
-
} catch (t) {
|
|
7293
|
-
return {
|
|
7294
|
-
type: "throw",
|
|
7295
|
-
arg: t
|
|
7296
|
-
};
|
|
7297
|
-
}
|
|
7298
|
-
}
|
|
7299
|
-
e.wrap = wrap;
|
|
7300
|
-
var h = "suspendedStart",
|
|
7301
|
-
l = "suspendedYield",
|
|
7302
|
-
f = "executing",
|
|
7303
|
-
s = "completed",
|
|
7304
|
-
y = {};
|
|
7305
|
-
function Generator() {}
|
|
7306
|
-
function GeneratorFunction() {}
|
|
7307
|
-
function GeneratorFunctionPrototype() {}
|
|
7308
|
-
var p = {};
|
|
7309
|
-
define(p, a, function () {
|
|
7310
|
-
return this;
|
|
7311
|
-
});
|
|
7312
|
-
var d = Object.getPrototypeOf,
|
|
7313
|
-
v = d && d(d(values([])));
|
|
7314
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
7315
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
7316
|
-
function defineIteratorMethods(t) {
|
|
7317
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
7318
|
-
define(t, e, function (t) {
|
|
7319
|
-
return this._invoke(e, t);
|
|
7320
|
-
});
|
|
7321
|
-
});
|
|
7322
|
-
}
|
|
7323
|
-
function AsyncIterator(t, e) {
|
|
7324
|
-
function invoke(r, o, i, a) {
|
|
7325
|
-
var c = tryCatch(t[r], t, o);
|
|
7326
|
-
if ("throw" !== c.type) {
|
|
7327
|
-
var u = c.arg,
|
|
7328
|
-
h = u.value;
|
|
7329
|
-
return h && "object" == _typeof$3(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
7330
|
-
invoke("next", t, i, a);
|
|
7331
|
-
}, function (t) {
|
|
7332
|
-
invoke("throw", t, i, a);
|
|
7333
|
-
}) : e.resolve(h).then(function (t) {
|
|
7334
|
-
u.value = t, i(u);
|
|
7335
|
-
}, function (t) {
|
|
7336
|
-
return invoke("throw", t, i, a);
|
|
7337
|
-
});
|
|
7338
|
-
}
|
|
7339
|
-
a(c.arg);
|
|
7340
|
-
}
|
|
7341
|
-
var r;
|
|
7342
|
-
o(this, "_invoke", {
|
|
7343
|
-
value: function value(t, n) {
|
|
7344
|
-
function callInvokeWithMethodAndArg() {
|
|
7345
|
-
return new e(function (e, r) {
|
|
7346
|
-
invoke(t, n, e, r);
|
|
7347
|
-
});
|
|
7348
|
-
}
|
|
7349
|
-
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
7350
|
-
}
|
|
7351
|
-
});
|
|
7352
|
-
}
|
|
7353
|
-
function makeInvokeMethod(e, r, n) {
|
|
7354
|
-
var o = h;
|
|
7355
|
-
return function (i, a) {
|
|
7356
|
-
if (o === f) throw Error("Generator is already running");
|
|
7357
|
-
if (o === s) {
|
|
7358
|
-
if ("throw" === i) throw a;
|
|
7359
|
-
return {
|
|
7360
|
-
value: t,
|
|
7361
|
-
done: !0
|
|
7362
|
-
};
|
|
7363
|
-
}
|
|
7364
|
-
for (n.method = i, n.arg = a;;) {
|
|
7365
|
-
var c = n.delegate;
|
|
7366
|
-
if (c) {
|
|
7367
|
-
var u = maybeInvokeDelegate(c, n);
|
|
7368
|
-
if (u) {
|
|
7369
|
-
if (u === y) continue;
|
|
7370
|
-
return u;
|
|
7371
|
-
}
|
|
7372
|
-
}
|
|
7373
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
7374
|
-
if (o === h) throw o = s, n.arg;
|
|
7375
|
-
n.dispatchException(n.arg);
|
|
7376
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
7377
|
-
o = f;
|
|
7378
|
-
var p = tryCatch(e, r, n);
|
|
7379
|
-
if ("normal" === p.type) {
|
|
7380
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
7381
|
-
return {
|
|
7382
|
-
value: p.arg,
|
|
7383
|
-
done: n.done
|
|
7384
|
-
};
|
|
7385
|
-
}
|
|
7386
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
7387
|
-
}
|
|
7388
|
-
};
|
|
7389
|
-
}
|
|
7390
|
-
function maybeInvokeDelegate(e, r) {
|
|
7391
|
-
var n = r.method,
|
|
7392
|
-
o = e.iterator[n];
|
|
7393
|
-
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
7394
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
7395
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
7396
|
-
var a = i.arg;
|
|
7397
|
-
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
7398
|
-
}
|
|
7399
|
-
function pushTryEntry(t) {
|
|
7400
|
-
var e = {
|
|
7401
|
-
tryLoc: t[0]
|
|
7402
|
-
};
|
|
7403
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
7404
|
-
}
|
|
7405
|
-
function resetTryEntry(t) {
|
|
7406
|
-
var e = t.completion || {};
|
|
7407
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
7408
|
-
}
|
|
7409
|
-
function Context(t) {
|
|
7410
|
-
this.tryEntries = [{
|
|
7411
|
-
tryLoc: "root"
|
|
7412
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
7413
|
-
}
|
|
7414
|
-
function values(e) {
|
|
7415
|
-
if (e || "" === e) {
|
|
7416
|
-
var r = e[a];
|
|
7417
|
-
if (r) return r.call(e);
|
|
7418
|
-
if ("function" == typeof e.next) return e;
|
|
7419
|
-
if (!isNaN(e.length)) {
|
|
7420
|
-
var o = -1,
|
|
7421
|
-
i = function next() {
|
|
7422
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
7423
|
-
return next.value = t, next.done = !0, next;
|
|
7424
|
-
};
|
|
7425
|
-
return i.next = i;
|
|
7426
|
-
}
|
|
7427
|
-
}
|
|
7428
|
-
throw new TypeError(_typeof$3(e) + " is not iterable");
|
|
7429
|
-
}
|
|
7430
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
7431
|
-
value: GeneratorFunctionPrototype,
|
|
7432
|
-
configurable: !0
|
|
7433
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
7434
|
-
value: GeneratorFunction,
|
|
7435
|
-
configurable: !0
|
|
7436
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
7437
|
-
var e = "function" == typeof t && t.constructor;
|
|
7438
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
7439
|
-
}, e.mark = function (t) {
|
|
7440
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
7441
|
-
}, e.awrap = function (t) {
|
|
7442
|
-
return {
|
|
7443
|
-
__await: t
|
|
7444
|
-
};
|
|
7445
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
7446
|
-
return this;
|
|
7447
|
-
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
7448
|
-
void 0 === i && (i = Promise);
|
|
7449
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
7450
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
7451
|
-
return t.done ? t.value : a.next();
|
|
7452
|
-
});
|
|
7453
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
7454
|
-
return this;
|
|
7455
|
-
}), define(g, "toString", function () {
|
|
7456
|
-
return "[object Generator]";
|
|
7457
|
-
}), e.keys = function (t) {
|
|
7458
|
-
var e = Object(t),
|
|
7459
|
-
r = [];
|
|
7460
|
-
for (var n in e) r.push(n);
|
|
7461
|
-
return r.reverse(), function next() {
|
|
7462
|
-
for (; r.length;) {
|
|
7463
|
-
var t = r.pop();
|
|
7464
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
7465
|
-
}
|
|
7466
|
-
return next.done = !0, next;
|
|
7467
|
-
};
|
|
7468
|
-
}, e.values = values, Context.prototype = {
|
|
7469
|
-
constructor: Context,
|
|
7470
|
-
reset: function reset(e) {
|
|
7471
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
7472
|
-
},
|
|
7473
|
-
stop: function stop() {
|
|
7474
|
-
this.done = !0;
|
|
7475
|
-
var t = this.tryEntries[0].completion;
|
|
7476
|
-
if ("throw" === t.type) throw t.arg;
|
|
7477
|
-
return this.rval;
|
|
7478
|
-
},
|
|
7479
|
-
dispatchException: function dispatchException(e) {
|
|
7480
|
-
if (this.done) throw e;
|
|
7481
|
-
var r = this;
|
|
7482
|
-
function handle(n, o) {
|
|
7483
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
7484
|
-
}
|
|
7485
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
7486
|
-
var i = this.tryEntries[o],
|
|
7487
|
-
a = i.completion;
|
|
7488
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
7489
|
-
if (i.tryLoc <= this.prev) {
|
|
7490
|
-
var c = n.call(i, "catchLoc"),
|
|
7491
|
-
u = n.call(i, "finallyLoc");
|
|
7492
|
-
if (c && u) {
|
|
7493
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
7494
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
7495
|
-
} else if (c) {
|
|
7496
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
7497
|
-
} else {
|
|
7498
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
7499
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
7500
|
-
}
|
|
7501
|
-
}
|
|
7502
|
-
}
|
|
7503
|
-
},
|
|
7504
|
-
abrupt: function abrupt(t, e) {
|
|
7505
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
7506
|
-
var o = this.tryEntries[r];
|
|
7507
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
7508
|
-
var i = o;
|
|
7509
|
-
break;
|
|
7510
|
-
}
|
|
7511
|
-
}
|
|
7512
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
7513
|
-
var a = i ? i.completion : {};
|
|
7514
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
7515
|
-
},
|
|
7516
|
-
complete: function complete(t, e) {
|
|
7517
|
-
if ("throw" === t.type) throw t.arg;
|
|
7518
|
-
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
7519
|
-
},
|
|
7520
|
-
finish: function finish(t) {
|
|
7521
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
7522
|
-
var r = this.tryEntries[e];
|
|
7523
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
7524
|
-
}
|
|
7525
|
-
},
|
|
7526
|
-
catch: function _catch(t) {
|
|
7527
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
7528
|
-
var r = this.tryEntries[e];
|
|
7529
|
-
if (r.tryLoc === t) {
|
|
7530
|
-
var n = r.completion;
|
|
7531
|
-
if ("throw" === n.type) {
|
|
7532
|
-
var o = n.arg;
|
|
7533
|
-
resetTryEntry(r);
|
|
7534
|
-
}
|
|
7535
|
-
return o;
|
|
7536
|
-
}
|
|
7537
|
-
}
|
|
7538
|
-
throw Error("illegal catch attempt");
|
|
7539
|
-
},
|
|
7540
|
-
delegateYield: function delegateYield(e, r, n) {
|
|
7541
|
-
return this.delegate = {
|
|
7542
|
-
iterator: values(e),
|
|
7543
|
-
resultName: r,
|
|
7544
|
-
nextLoc: n
|
|
7545
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
7546
|
-
}
|
|
7547
|
-
}, e;
|
|
7548
|
-
}
|
|
7549
|
-
function _setPrototypeOf(t, e) {
|
|
7550
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
7551
|
-
return t.__proto__ = e, t;
|
|
7552
|
-
}, _setPrototypeOf(t, e);
|
|
7553
|
-
}
|
|
7554
|
-
function _slicedToArray$1(r, e) {
|
|
7555
|
-
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest();
|
|
7556
|
-
}
|
|
7557
|
-
function _toPrimitive(t, r) {
|
|
7558
|
-
if ("object" != _typeof$3(t) || !t) return t;
|
|
7559
|
-
var e = t[Symbol.toPrimitive];
|
|
7560
|
-
if (void 0 !== e) {
|
|
7561
|
-
var i = e.call(t, r || "default");
|
|
7562
|
-
if ("object" != _typeof$3(i)) return i;
|
|
7563
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
7564
|
-
}
|
|
7565
|
-
return ("string" === r ? String : Number)(t);
|
|
7566
|
-
}
|
|
7567
|
-
function _toPropertyKey(t) {
|
|
7568
|
-
var i = _toPrimitive(t, "string");
|
|
7569
|
-
return "symbol" == _typeof$3(i) ? i : i + "";
|
|
7570
|
-
}
|
|
7571
|
-
function _typeof$1(o) {
|
|
7572
|
-
"@babel/helpers - typeof";
|
|
7573
|
-
|
|
7574
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
7575
|
-
return typeof o;
|
|
7576
|
-
} : function (o) {
|
|
7577
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
7578
|
-
}, _typeof$1(o);
|
|
7579
|
-
}
|
|
7580
|
-
function _unsupportedIterableToArray$1(r, a) {
|
|
7581
|
-
if (r) {
|
|
7582
|
-
if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
|
|
7583
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
7584
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
|
|
7585
|
-
}
|
|
7586
|
-
}
|
|
7587
|
-
function _wrapRegExp() {
|
|
7588
|
-
_wrapRegExp = function _wrapRegExp(e, r) {
|
|
7589
|
-
return new BabelRegExp(e, void 0, r);
|
|
7590
|
-
};
|
|
7591
|
-
var e = RegExp.prototype,
|
|
7592
|
-
r = new WeakMap();
|
|
7593
|
-
function BabelRegExp(e, t, p) {
|
|
7594
|
-
var o = RegExp(e, t);
|
|
7595
|
-
return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype);
|
|
7596
|
-
}
|
|
7597
|
-
function buildGroups(e, t) {
|
|
7598
|
-
var p = r.get(t);
|
|
7599
|
-
return Object.keys(p).reduce(function (r, t) {
|
|
7600
|
-
var o = p[t];
|
|
7601
|
-
if ("number" == typeof o) r[t] = e[o];else {
|
|
7602
|
-
for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++;
|
|
7603
|
-
r[t] = e[o[i]];
|
|
7604
|
-
}
|
|
7605
|
-
return r;
|
|
7606
|
-
}, Object.create(null));
|
|
7607
|
-
}
|
|
7608
|
-
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) {
|
|
7609
|
-
var t = e.exec.call(this, r);
|
|
7610
|
-
if (t) {
|
|
7611
|
-
t.groups = buildGroups(t, this);
|
|
7612
|
-
var p = t.indices;
|
|
7613
|
-
p && (p.groups = buildGroups(p, this));
|
|
7614
|
-
}
|
|
7615
|
-
return t;
|
|
7616
|
-
}, BabelRegExp.prototype[Symbol.replace] = function (t, p) {
|
|
7617
|
-
if ("string" == typeof p) {
|
|
7618
|
-
var o = r.get(this);
|
|
7619
|
-
return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) {
|
|
7620
|
-
var t = o[r];
|
|
7621
|
-
return "$" + (Array.isArray(t) ? t.join("$") : t);
|
|
7622
|
-
}));
|
|
7314
|
+
activeCount = 1;
|
|
7315
|
+
currentTick = now;
|
|
7316
|
+
return 0;
|
|
7623
7317
|
}
|
|
7624
|
-
if (
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
});
|
|
7318
|
+
if (activeCount < limit) {
|
|
7319
|
+
activeCount++;
|
|
7320
|
+
} else {
|
|
7321
|
+
currentTick += interval;
|
|
7322
|
+
activeCount = 1;
|
|
7630
7323
|
}
|
|
7631
|
-
return
|
|
7632
|
-
}
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
**/
|
|
7650
|
-
return typeof process !== 'undefined' && !process.browser;
|
|
7651
|
-
}
|
|
7652
|
-
function isReactNative() {
|
|
7653
|
-
return typeof window !== 'undefined' && 'navigator' in window && 'product' in window.navigator && window.navigator.product === 'ReactNative';
|
|
7654
|
-
}
|
|
7655
|
-
function getNodeVersion() {
|
|
7656
|
-
return process.versions && process.versions.node ? "v".concat(process.versions.node) : process.version;
|
|
7657
|
-
}
|
|
7658
|
-
function getWindow() {
|
|
7659
|
-
return window;
|
|
7660
|
-
}
|
|
7661
|
-
function noop() {
|
|
7662
|
-
return undefined;
|
|
7663
|
-
}
|
|
7664
|
-
var delay = function delay(ms) {
|
|
7665
|
-
return new Promise(function (resolve) {
|
|
7666
|
-
setTimeout(resolve, ms);
|
|
7667
|
-
});
|
|
7668
|
-
};
|
|
7669
|
-
var defaultWait = function defaultWait(attempts) {
|
|
7670
|
-
return Math.pow(Math.SQRT2, attempts);
|
|
7671
|
-
};
|
|
7672
|
-
function rateLimit(instance) {
|
|
7673
|
-
var maxRetry = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
|
|
7674
|
-
var _instance$defaults = instance.defaults,
|
|
7675
|
-
_instance$defaults$re = _instance$defaults.responseLogger,
|
|
7676
|
-
responseLogger = _instance$defaults$re === void 0 ? noop : _instance$defaults$re,
|
|
7677
|
-
_instance$defaults$re2 = _instance$defaults.requestLogger,
|
|
7678
|
-
requestLogger = _instance$defaults$re2 === void 0 ? noop : _instance$defaults$re2;
|
|
7679
|
-
instance.interceptors.request.use(function (config) {
|
|
7680
|
-
requestLogger(config);
|
|
7681
|
-
return config;
|
|
7682
|
-
}, function (error) {
|
|
7683
|
-
requestLogger(error);
|
|
7684
|
-
return Promise.reject(error);
|
|
7685
|
-
});
|
|
7686
|
-
instance.interceptors.response.use(function (response) {
|
|
7687
|
-
// we don't need to do anything here
|
|
7688
|
-
responseLogger(response);
|
|
7689
|
-
return response;
|
|
7690
|
-
}, /*#__PURE__*/function () {
|
|
7691
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(error) {
|
|
7692
|
-
var response, config, doneAttempts, retryErrorType, wait;
|
|
7693
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7694
|
-
while (1) switch (_context.prev = _context.next) {
|
|
7695
|
-
case 0:
|
|
7696
|
-
response = error.response;
|
|
7697
|
-
config = error.config;
|
|
7698
|
-
responseLogger(error);
|
|
7699
|
-
// Do not retry if it is disabled or no request config exists (not an axios error)
|
|
7700
|
-
if (!(!config || !instance.defaults.retryOnError)) {
|
|
7701
|
-
_context.next = 5;
|
|
7702
|
-
break;
|
|
7703
|
-
}
|
|
7704
|
-
return _context.abrupt("return", Promise.reject(error));
|
|
7705
|
-
case 5:
|
|
7706
|
-
// Retried already for max attempts
|
|
7707
|
-
doneAttempts = config.attempts || 1;
|
|
7708
|
-
if (!(doneAttempts > maxRetry)) {
|
|
7709
|
-
_context.next = 9;
|
|
7710
|
-
break;
|
|
7711
|
-
}
|
|
7712
|
-
error.attempts = config.attempts;
|
|
7713
|
-
return _context.abrupt("return", Promise.reject(error));
|
|
7714
|
-
case 9:
|
|
7715
|
-
retryErrorType = null;
|
|
7716
|
-
wait = defaultWait(doneAttempts); // Errors without response did not receive anything from the server
|
|
7717
|
-
if (!response) {
|
|
7718
|
-
retryErrorType = 'Connection';
|
|
7719
|
-
} else if (response.status >= 500 && response.status < 600) {
|
|
7720
|
-
// 5** errors are server related
|
|
7721
|
-
retryErrorType = "Server ".concat(response.status);
|
|
7722
|
-
} else if (response.status === 429) {
|
|
7723
|
-
// 429 errors are exceeded rate limit exceptions
|
|
7724
|
-
retryErrorType = 'Rate limit';
|
|
7725
|
-
// all headers are lowercased by axios https://github.com/mzabriskie/axios/issues/413
|
|
7726
|
-
if (response.headers && error.response.headers['x-contentful-ratelimit-reset']) {
|
|
7727
|
-
wait = response.headers['x-contentful-ratelimit-reset'];
|
|
7728
|
-
}
|
|
7729
|
-
}
|
|
7730
|
-
if (!retryErrorType) {
|
|
7731
|
-
_context.next = 19;
|
|
7732
|
-
break;
|
|
7324
|
+
return currentTick - now;
|
|
7325
|
+
}
|
|
7326
|
+
var getDelay = windowedDelay;
|
|
7327
|
+
return function (function_) {
|
|
7328
|
+
var _throttled = function throttled() {
|
|
7329
|
+
var _this2 = this;
|
|
7330
|
+
for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
7331
|
+
arguments_[_key] = arguments[_key];
|
|
7332
|
+
}
|
|
7333
|
+
if (!_throttled.isEnabled) {
|
|
7334
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
7335
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7336
|
+
while (1) switch (_context.prev = _context.next) {
|
|
7337
|
+
case 0:
|
|
7338
|
+
return _context.abrupt("return", function_.apply(_this2, arguments_));
|
|
7339
|
+
case 1:
|
|
7340
|
+
case "end":
|
|
7341
|
+
return _context.stop();
|
|
7733
7342
|
}
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
return _context.abrupt("return", Promise.reject(error));
|
|
7751
|
-
case 20:
|
|
7752
|
-
case "end":
|
|
7753
|
-
return _context.stop();
|
|
7343
|
+
}, _callee);
|
|
7344
|
+
}))();
|
|
7345
|
+
}
|
|
7346
|
+
var timeoutId;
|
|
7347
|
+
return new Promise(function (resolve, reject) {
|
|
7348
|
+
var execute = function execute() {
|
|
7349
|
+
resolve(function_.apply(_this2, arguments_));
|
|
7350
|
+
queue.delete(timeoutId);
|
|
7351
|
+
};
|
|
7352
|
+
var delay = getDelay();
|
|
7353
|
+
if (delay > 0) {
|
|
7354
|
+
timeoutId = setTimeout(execute, delay);
|
|
7355
|
+
queue.set(timeoutId, reject);
|
|
7356
|
+
onDelay === null || onDelay === void 0 || onDelay.apply(void 0, arguments_);
|
|
7357
|
+
} else {
|
|
7358
|
+
execute();
|
|
7754
7359
|
}
|
|
7755
|
-
}
|
|
7756
|
-
}));
|
|
7757
|
-
return function (_x) {
|
|
7758
|
-
return _ref.apply(this, arguments);
|
|
7360
|
+
});
|
|
7759
7361
|
};
|
|
7760
|
-
|
|
7362
|
+
_throttled.abort = function () {
|
|
7363
|
+
var _iterator = _createForOfIteratorHelper$2(queue.keys()),
|
|
7364
|
+
_step;
|
|
7365
|
+
try {
|
|
7366
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
7367
|
+
var timeout = _step.value;
|
|
7368
|
+
clearTimeout(timeout);
|
|
7369
|
+
queue.get(timeout)(new AbortError());
|
|
7370
|
+
}
|
|
7371
|
+
} catch (err) {
|
|
7372
|
+
_iterator.e(err);
|
|
7373
|
+
} finally {
|
|
7374
|
+
_iterator.f();
|
|
7375
|
+
}
|
|
7376
|
+
queue.clear();
|
|
7377
|
+
};
|
|
7378
|
+
_throttled.isEnabled = true;
|
|
7379
|
+
Object.defineProperty(_throttled, 'queueSize', {
|
|
7380
|
+
get: function get() {
|
|
7381
|
+
return queue.size;
|
|
7382
|
+
}
|
|
7383
|
+
});
|
|
7384
|
+
return _throttled;
|
|
7385
|
+
};
|
|
7761
7386
|
}
|
|
7387
|
+
|
|
7388
|
+
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { var t = o[r]; return "$" + (Array.isArray(t) ? t.join("$") : t); })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != _typeof$2(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
|
|
7762
7389
|
var PERCENTAGE_REGEX = /*#__PURE__*/_wrapRegExp(/(\d+)(%)/, {
|
|
7763
7390
|
value: 1
|
|
7764
7391
|
});
|
|
@@ -7777,13 +7404,13 @@ var contentful = (function (exports) {
|
|
|
7777
7404
|
}
|
|
7778
7405
|
function createThrottle(limit, logger) {
|
|
7779
7406
|
logger('info', "Throttle request to ".concat(limit, "/s"));
|
|
7780
|
-
return pThrottle
|
|
7407
|
+
return pThrottle({
|
|
7781
7408
|
limit: limit,
|
|
7782
7409
|
interval: 1000,
|
|
7783
7410
|
strict: false
|
|
7784
7411
|
});
|
|
7785
7412
|
}
|
|
7786
|
-
var rateLimitThrottle = function
|
|
7413
|
+
var rateLimitThrottle = (function (axiosInstance) {
|
|
7787
7414
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'auto';
|
|
7788
7415
|
var _axiosInstance$defaul = axiosInstance.defaults.logHandler,
|
|
7789
7416
|
logHandler = _axiosInstance$defaul === void 0 ? noop : _axiosInstance$defaul;
|
|
@@ -7825,12 +7452,20 @@ var contentful = (function (exports) {
|
|
|
7825
7452
|
axiosInstance.interceptors.request.eject(requestInterceptorId);
|
|
7826
7453
|
axiosInstance.interceptors.response.eject(responseInterceptorId);
|
|
7827
7454
|
};
|
|
7828
|
-
};
|
|
7455
|
+
});
|
|
7829
7456
|
|
|
7457
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7458
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7830
7459
|
// Matches 'sub.host:port' or 'host:port' and extracts hostname and port
|
|
7831
7460
|
// Also enforces toplevel domain specified, no spaces and no protocol
|
|
7832
7461
|
var HOST_REGEX = /^(?!\w+:\/\/)([^\s:]+\.?[^\s:]+)(?::(\d+))?(?!:)$/;
|
|
7833
|
-
|
|
7462
|
+
function copyHttpClientParams(options) {
|
|
7463
|
+
var copiedOptions = index(options);
|
|
7464
|
+
// httpAgent and httpsAgent cannot be copied because they can contain private fields
|
|
7465
|
+
copiedOptions.httpAgent = options.httpAgent;
|
|
7466
|
+
copiedOptions.httpsAgent = options.httpsAgent;
|
|
7467
|
+
return copiedOptions;
|
|
7468
|
+
}
|
|
7834
7469
|
/**
|
|
7835
7470
|
* Create pre-configured axios instance
|
|
7836
7471
|
* @private
|
|
@@ -7866,13 +7501,12 @@ var contentful = (function (exports) {
|
|
|
7866
7501
|
// 1GB
|
|
7867
7502
|
maxBodyLength: 1073741824 // 1GB
|
|
7868
7503
|
};
|
|
7869
|
-
var config =
|
|
7504
|
+
var config = _objectSpread(_objectSpread({}, defaultConfig), options);
|
|
7870
7505
|
if (!config.accessToken) {
|
|
7871
7506
|
var missingAccessTokenError = new TypeError('Expected parameter accessToken');
|
|
7872
7507
|
config.logHandler('error', missingAccessTokenError);
|
|
7873
7508
|
throw missingAccessTokenError;
|
|
7874
7509
|
}
|
|
7875
|
-
|
|
7876
7510
|
// Construct axios baseURL option
|
|
7877
7511
|
var protocol = config.insecure ? 'http' : 'https';
|
|
7878
7512
|
var space = config.space ? "".concat(config.space, "/") : '';
|
|
@@ -7888,7 +7522,6 @@ var contentful = (function (exports) {
|
|
|
7888
7522
|
hostname = parsed[0];
|
|
7889
7523
|
}
|
|
7890
7524
|
}
|
|
7891
|
-
|
|
7892
7525
|
// Ensure that basePath does start but not end with a slash
|
|
7893
7526
|
if (config.basePath) {
|
|
7894
7527
|
config.basePath = "/".concat(config.basePath.split('/').filter(Boolean).join('/'));
|
|
@@ -7921,7 +7554,6 @@ var contentful = (function (exports) {
|
|
|
7921
7554
|
};
|
|
7922
7555
|
var instance = axios.create(axiosOptions);
|
|
7923
7556
|
instance.httpClientParams = options;
|
|
7924
|
-
|
|
7925
7557
|
/**
|
|
7926
7558
|
* Creates a new axios instance with the same default base parameters as the
|
|
7927
7559
|
* current one, and with any overrides passed to the newParams object
|
|
@@ -7933,14 +7565,12 @@ var contentful = (function (exports) {
|
|
|
7933
7565
|
* @return {AxiosInstance} Initialized axios instance
|
|
7934
7566
|
*/
|
|
7935
7567
|
instance.cloneWithNewParams = function (newParams) {
|
|
7936
|
-
return createHttpClient(axios,
|
|
7568
|
+
return createHttpClient(axios, _objectSpread(_objectSpread({}, copyHttpClientParams(options)), newParams));
|
|
7937
7569
|
};
|
|
7938
|
-
|
|
7939
7570
|
/**
|
|
7940
7571
|
* Apply interceptors.
|
|
7941
7572
|
* Please note that the order of interceptors is important
|
|
7942
7573
|
*/
|
|
7943
|
-
|
|
7944
7574
|
if (config.onBeforeRequest) {
|
|
7945
7575
|
instance.interceptors.request.use(config.onBeforeRequest);
|
|
7946
7576
|
}
|
|
@@ -7959,7 +7589,6 @@ var contentful = (function (exports) {
|
|
|
7959
7589
|
return instance;
|
|
7960
7590
|
}
|
|
7961
7591
|
|
|
7962
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7963
7592
|
/**
|
|
7964
7593
|
* Creates request parameters configuration by parsing an existing query object
|
|
7965
7594
|
* @private
|
|
@@ -7970,12 +7599,14 @@ var contentful = (function (exports) {
|
|
|
7970
7599
|
var query = _ref.query;
|
|
7971
7600
|
var config = {};
|
|
7972
7601
|
delete query.resolveLinks;
|
|
7973
|
-
config.params =
|
|
7602
|
+
config.params = index(query);
|
|
7974
7603
|
return config;
|
|
7975
7604
|
}
|
|
7976
7605
|
|
|
7606
|
+
function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
7607
|
+
function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
|
|
7608
|
+
function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7977
7609
|
// copied from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
|
|
7978
|
-
|
|
7979
7610
|
function deepFreeze(object) {
|
|
7980
7611
|
var propNames = Object.getOwnPropertyNames(object);
|
|
7981
7612
|
var _iterator = _createForOfIteratorHelper$1(propNames),
|
|
@@ -7984,7 +7615,7 @@ var contentful = (function (exports) {
|
|
|
7984
7615
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
7985
7616
|
var name = _step.value;
|
|
7986
7617
|
var value = object[name];
|
|
7987
|
-
if (value && _typeof$
|
|
7618
|
+
if (value && _typeof$2(value) === 'object') {
|
|
7988
7619
|
deepFreeze(value);
|
|
7989
7620
|
}
|
|
7990
7621
|
}
|
|
@@ -7999,6 +7630,7 @@ var contentful = (function (exports) {
|
|
|
7999
7630
|
deepFreeze(obj.sys || {});
|
|
8000
7631
|
return obj;
|
|
8001
7632
|
}
|
|
7633
|
+
|
|
8002
7634
|
function getBrowserOS() {
|
|
8003
7635
|
var win = getWindow();
|
|
8004
7636
|
if (!win) {
|
|
@@ -8024,8 +7656,8 @@ var contentful = (function (exports) {
|
|
|
8024
7656
|
return null;
|
|
8025
7657
|
}
|
|
8026
7658
|
function getNodeOS() {
|
|
8027
|
-
var platform = process.platform || 'linux';
|
|
8028
|
-
var version = process.version || '0.0.0';
|
|
7659
|
+
var platform = process$2.platform || 'linux';
|
|
7660
|
+
var version = process$2.version || '0.0.0';
|
|
8029
7661
|
var platformMap = {
|
|
8030
7662
|
android: 'Android',
|
|
8031
7663
|
aix: 'Linux',
|
|
@@ -8087,11 +7719,94 @@ var contentful = (function (exports) {
|
|
|
8087
7719
|
configurable: false,
|
|
8088
7720
|
writable: false,
|
|
8089
7721
|
value: function value() {
|
|
8090
|
-
return
|
|
7722
|
+
return index(this);
|
|
8091
7723
|
}
|
|
8092
7724
|
});
|
|
8093
7725
|
}
|
|
8094
7726
|
|
|
7727
|
+
/**
|
|
7728
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
|
7729
|
+
*
|
|
7730
|
+
* @private
|
|
7731
|
+
* @param {Function} func The function to wrap.
|
|
7732
|
+
* @param {Function} transform The argument transform.
|
|
7733
|
+
* @returns {Function} Returns the new function.
|
|
7734
|
+
*/
|
|
7735
|
+
function overArg$1(func, transform) {
|
|
7736
|
+
return function (arg) {
|
|
7737
|
+
return func(transform(arg));
|
|
7738
|
+
};
|
|
7739
|
+
}
|
|
7740
|
+
var _overArg = overArg$1;
|
|
7741
|
+
|
|
7742
|
+
var overArg = _overArg;
|
|
7743
|
+
|
|
7744
|
+
/** Built-in value references. */
|
|
7745
|
+
var getPrototype$1 = overArg(Object.getPrototypeOf, Object);
|
|
7746
|
+
var _getPrototype = getPrototype$1;
|
|
7747
|
+
|
|
7748
|
+
var baseGetTag = _baseGetTag,
|
|
7749
|
+
getPrototype = _getPrototype,
|
|
7750
|
+
isObjectLike = isObjectLike_1;
|
|
7751
|
+
|
|
7752
|
+
/** `Object#toString` result references. */
|
|
7753
|
+
var objectTag = '[object Object]';
|
|
7754
|
+
|
|
7755
|
+
/** Used for built-in method references. */
|
|
7756
|
+
var funcProto = Function.prototype,
|
|
7757
|
+
objectProto = Object.prototype;
|
|
7758
|
+
|
|
7759
|
+
/** Used to resolve the decompiled source of functions. */
|
|
7760
|
+
var funcToString = funcProto.toString;
|
|
7761
|
+
|
|
7762
|
+
/** Used to check objects for own properties. */
|
|
7763
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
7764
|
+
|
|
7765
|
+
/** Used to infer the `Object` constructor. */
|
|
7766
|
+
var objectCtorString = funcToString.call(Object);
|
|
7767
|
+
|
|
7768
|
+
/**
|
|
7769
|
+
* Checks if `value` is a plain object, that is, an object created by the
|
|
7770
|
+
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
7771
|
+
*
|
|
7772
|
+
* @static
|
|
7773
|
+
* @memberOf _
|
|
7774
|
+
* @since 0.8.0
|
|
7775
|
+
* @category Lang
|
|
7776
|
+
* @param {*} value The value to check.
|
|
7777
|
+
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
7778
|
+
* @example
|
|
7779
|
+
*
|
|
7780
|
+
* function Foo() {
|
|
7781
|
+
* this.a = 1;
|
|
7782
|
+
* }
|
|
7783
|
+
*
|
|
7784
|
+
* _.isPlainObject(new Foo);
|
|
7785
|
+
* // => false
|
|
7786
|
+
*
|
|
7787
|
+
* _.isPlainObject([1, 2, 3]);
|
|
7788
|
+
* // => false
|
|
7789
|
+
*
|
|
7790
|
+
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
7791
|
+
* // => true
|
|
7792
|
+
*
|
|
7793
|
+
* _.isPlainObject(Object.create(null));
|
|
7794
|
+
* // => true
|
|
7795
|
+
*/
|
|
7796
|
+
function isPlainObject(value) {
|
|
7797
|
+
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
7798
|
+
return false;
|
|
7799
|
+
}
|
|
7800
|
+
var proto = getPrototype(value);
|
|
7801
|
+
if (proto === null) {
|
|
7802
|
+
return true;
|
|
7803
|
+
}
|
|
7804
|
+
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
7805
|
+
return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
7806
|
+
}
|
|
7807
|
+
var isPlainObject_1 = isPlainObject;
|
|
7808
|
+
var isPlainObject$1 = /*@__PURE__*/getDefaultExportFromCjs(isPlainObject_1);
|
|
7809
|
+
|
|
8095
7810
|
/**
|
|
8096
7811
|
* Handles errors received from the server. Parses the error into a more useful
|
|
8097
7812
|
* format, places it in an exception and throws it.
|
|
@@ -8104,7 +7819,6 @@ var contentful = (function (exports) {
|
|
|
8104
7819
|
var config = errorResponse.config,
|
|
8105
7820
|
response = errorResponse.response;
|
|
8106
7821
|
var errorName;
|
|
8107
|
-
|
|
8108
7822
|
// Obscure the Management token
|
|
8109
7823
|
if (config && config.headers && config.headers['Authorization']) {
|
|
8110
7824
|
var token = "...".concat(config.headers['Authorization'].toString().substr(-5));
|
|
@@ -8128,7 +7842,7 @@ var contentful = (function (exports) {
|
|
|
8128
7842
|
payloadData: config.data
|
|
8129
7843
|
};
|
|
8130
7844
|
}
|
|
8131
|
-
if (data && _typeof$
|
|
7845
|
+
if (data && _typeof$2(data) === 'object') {
|
|
8132
7846
|
var _data$sys;
|
|
8133
7847
|
if ('requestId' in data) {
|
|
8134
7848
|
errorData.requestId = data.requestId || 'UNKNOWN';
|
|
@@ -8256,7 +7970,7 @@ var contentful = (function (exports) {
|
|
|
8256
7970
|
a.get = function (t, o) {
|
|
8257
7971
|
for (var n = Array.isArray(o) ? o : a.parse(o), r = 0; r < n.length; ++r) {
|
|
8258
7972
|
var s = n[r];
|
|
8259
|
-
if (!(_typeof$
|
|
7973
|
+
if (!(_typeof$2(t) == "object" && s in t)) throw new Error("Invalid reference token: " + s);
|
|
8260
7974
|
t = t[s];
|
|
8261
7975
|
}
|
|
8262
7976
|
return t;
|
|
@@ -8755,7 +8469,7 @@ var contentful = (function (exports) {
|
|
|
8755
8469
|
* @returns the copied value
|
|
8756
8470
|
*/
|
|
8757
8471
|
var _handleCopy = function handleCopy(value, cache) {
|
|
8758
|
-
if (!value || _typeof$
|
|
8472
|
+
if (!value || _typeof$2(value) !== 'object') {
|
|
8759
8473
|
return value;
|
|
8760
8474
|
}
|
|
8761
8475
|
if (cache.has(value)) {
|
|
@@ -8879,10 +8593,10 @@ var contentful = (function (exports) {
|
|
|
8879
8593
|
var fastCopyExports = fastCopy.exports;
|
|
8880
8594
|
var copy = /*@__PURE__*/getDefaultExportFromCjs(fastCopyExports);
|
|
8881
8595
|
|
|
8882
|
-
var _typeof = typeof Symbol === "function" && _typeof$
|
|
8883
|
-
return _typeof$
|
|
8596
|
+
var _typeof = typeof Symbol === "function" && _typeof$2(Symbol.iterator) === "symbol" ? function (obj) {
|
|
8597
|
+
return _typeof$2(obj);
|
|
8884
8598
|
} : function (obj) {
|
|
8885
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof$
|
|
8599
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof$2(obj);
|
|
8886
8600
|
};
|
|
8887
8601
|
var _slicedToArray = function () {
|
|
8888
8602
|
function sliceIterator(arr, i) {
|
|
@@ -9207,9 +8921,9 @@ var contentful = (function (exports) {
|
|
|
9207
8921
|
* @returns Entities mapped to an object for each entity type
|
|
9208
8922
|
*/
|
|
9209
8923
|
function _pagedSync() {
|
|
9210
|
-
_pagedSync = _asyncToGenerator
|
|
8924
|
+
_pagedSync = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(http, query, options) {
|
|
9211
8925
|
var defaultOptions, _Object$assign, withoutLinkResolution, withoutUnresolvableLinks, paginate, response, mappedResponseItems;
|
|
9212
|
-
return _regeneratorRuntime
|
|
8926
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
9213
8927
|
while (1) switch (_context.prev = _context.next) {
|
|
9214
8928
|
case 0:
|
|
9215
8929
|
if (!(!query || !query.initial && !query.nextSyncToken && !query.nextPageToken)) {
|
|
@@ -9318,9 +9032,9 @@ var contentful = (function (exports) {
|
|
|
9318
9032
|
* @private
|
|
9319
9033
|
*/
|
|
9320
9034
|
function _getSyncPage() {
|
|
9321
|
-
_getSyncPage = _asyncToGenerator
|
|
9035
|
+
_getSyncPage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(http, items, query, _ref) {
|
|
9322
9036
|
var paginate, requestQuery, response, data;
|
|
9323
|
-
return _regeneratorRuntime
|
|
9037
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
9324
9038
|
while (1) switch (_context2.prev = _context2.next) {
|
|
9325
9039
|
case 0:
|
|
9326
9040
|
paginate = _ref.paginate;
|
|
@@ -9454,14 +9168,14 @@ var contentful = (function (exports) {
|
|
|
9454
9168
|
_this.name = 'ValidationError';
|
|
9455
9169
|
return _this;
|
|
9456
9170
|
}
|
|
9457
|
-
_inherits
|
|
9171
|
+
_inherits(ValidationError, _Error);
|
|
9458
9172
|
return _createClass(ValidationError);
|
|
9459
9173
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
9460
9174
|
|
|
9461
9175
|
function validateTimestamp(name, timestamp, options) {
|
|
9462
9176
|
options = options || {};
|
|
9463
9177
|
if (typeof timestamp !== 'number') {
|
|
9464
|
-
throw new ValidationError(name, "only numeric values are allowed for timestamps, provided type was \"".concat(_typeof$
|
|
9178
|
+
throw new ValidationError(name, "only numeric values are allowed for timestamps, provided type was \"".concat(_typeof$2(timestamp), "\""));
|
|
9465
9179
|
}
|
|
9466
9180
|
if (options.maximum && timestamp > options.maximum) {
|
|
9467
9181
|
throw new ValidationError(name, "value (".concat(timestamp, ") cannot be further in the future than expected maximum (").concat(options.maximum, ")"));
|
|
@@ -9519,7 +9233,7 @@ var contentful = (function (exports) {
|
|
|
9519
9233
|
for (var key in query) {
|
|
9520
9234
|
var value = query[key];
|
|
9521
9235
|
// We don’t allow any objects as values for query parameters
|
|
9522
|
-
if (_typeof$
|
|
9236
|
+
if (_typeof$2(value) === 'object' && value !== null && !Array.isArray(value)) {
|
|
9523
9237
|
throw new Error("Objects are not supported as value for the \"".concat(key, "\" query parameter."));
|
|
9524
9238
|
}
|
|
9525
9239
|
}
|
|
@@ -9545,7 +9259,7 @@ var contentful = (function (exports) {
|
|
|
9545
9259
|
};
|
|
9546
9260
|
return _this;
|
|
9547
9261
|
}
|
|
9548
|
-
_inherits
|
|
9262
|
+
_inherits(NotFoundError, _Error);
|
|
9549
9263
|
return _createClass(NotFoundError);
|
|
9550
9264
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
9551
9265
|
function createContentfulApi(_ref, options) {
|
|
@@ -9595,9 +9309,9 @@ var contentful = (function (exports) {
|
|
|
9595
9309
|
return _get.apply(this, arguments);
|
|
9596
9310
|
}
|
|
9597
9311
|
function _get() {
|
|
9598
|
-
_get = _asyncToGenerator
|
|
9312
|
+
_get = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
|
9599
9313
|
var context, path, config, baseUrl, response;
|
|
9600
|
-
return _regeneratorRuntime
|
|
9314
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
9601
9315
|
while (1) switch (_context.prev = _context.next) {
|
|
9602
9316
|
case 0:
|
|
9603
9317
|
context = _ref2.context, path = _ref2.path, config = _ref2.config;
|
|
@@ -9624,9 +9338,9 @@ var contentful = (function (exports) {
|
|
|
9624
9338
|
return _post.apply(this, arguments);
|
|
9625
9339
|
}
|
|
9626
9340
|
function _post() {
|
|
9627
|
-
_post = _asyncToGenerator
|
|
9341
|
+
_post = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
9628
9342
|
var context, path, data, config, baseUrl, response;
|
|
9629
|
-
return _regeneratorRuntime
|
|
9343
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
9630
9344
|
while (1) switch (_context2.prev = _context2.next) {
|
|
9631
9345
|
case 0:
|
|
9632
9346
|
context = _ref3.context, path = _ref3.path, data = _ref3.data, config = _ref3.config;
|
|
@@ -9653,8 +9367,8 @@ var contentful = (function (exports) {
|
|
|
9653
9367
|
return _getSpace.apply(this, arguments);
|
|
9654
9368
|
}
|
|
9655
9369
|
function _getSpace() {
|
|
9656
|
-
_getSpace = _asyncToGenerator
|
|
9657
|
-
return _regeneratorRuntime
|
|
9370
|
+
_getSpace = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
9371
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
9658
9372
|
while (1) switch (_context3.prev = _context3.next) {
|
|
9659
9373
|
case 0:
|
|
9660
9374
|
return _context3.abrupt("return", get({
|
|
@@ -9673,8 +9387,8 @@ var contentful = (function (exports) {
|
|
|
9673
9387
|
return _getContentType.apply(this, arguments);
|
|
9674
9388
|
}
|
|
9675
9389
|
function _getContentType() {
|
|
9676
|
-
_getContentType = _asyncToGenerator
|
|
9677
|
-
return _regeneratorRuntime
|
|
9390
|
+
_getContentType = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(id) {
|
|
9391
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
9678
9392
|
while (1) switch (_context4.prev = _context4.next) {
|
|
9679
9393
|
case 0:
|
|
9680
9394
|
return _context4.abrupt("return", get({
|
|
@@ -9693,10 +9407,10 @@ var contentful = (function (exports) {
|
|
|
9693
9407
|
return _getContentTypes.apply(this, arguments);
|
|
9694
9408
|
}
|
|
9695
9409
|
function _getContentTypes() {
|
|
9696
|
-
_getContentTypes = _asyncToGenerator
|
|
9410
|
+
_getContentTypes = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
9697
9411
|
var query,
|
|
9698
9412
|
_args5 = arguments;
|
|
9699
|
-
return _regeneratorRuntime
|
|
9413
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
9700
9414
|
while (1) switch (_context5.prev = _context5.next) {
|
|
9701
9415
|
case 0:
|
|
9702
9416
|
query = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
|
@@ -9719,10 +9433,10 @@ var contentful = (function (exports) {
|
|
|
9719
9433
|
return _getEntry.apply(this, arguments);
|
|
9720
9434
|
}
|
|
9721
9435
|
function _getEntry() {
|
|
9722
|
-
_getEntry = _asyncToGenerator
|
|
9436
|
+
_getEntry = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
|
|
9723
9437
|
var query,
|
|
9724
9438
|
_args6 = arguments;
|
|
9725
|
-
return _regeneratorRuntime
|
|
9439
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
9726
9440
|
while (1) switch (_context6.prev = _context6.next) {
|
|
9727
9441
|
case 0:
|
|
9728
9442
|
query = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
|
@@ -9739,10 +9453,10 @@ var contentful = (function (exports) {
|
|
|
9739
9453
|
return _getEntries.apply(this, arguments);
|
|
9740
9454
|
}
|
|
9741
9455
|
function _getEntries() {
|
|
9742
|
-
_getEntries = _asyncToGenerator
|
|
9456
|
+
_getEntries = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
9743
9457
|
var query,
|
|
9744
9458
|
_args7 = arguments;
|
|
9745
|
-
return _regeneratorRuntime
|
|
9459
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
9746
9460
|
while (1) switch (_context7.prev = _context7.next) {
|
|
9747
9461
|
case 0:
|
|
9748
9462
|
query = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
|
|
@@ -9759,11 +9473,11 @@ var contentful = (function (exports) {
|
|
|
9759
9473
|
return _makeGetEntry.apply(this, arguments);
|
|
9760
9474
|
}
|
|
9761
9475
|
function _makeGetEntry() {
|
|
9762
|
-
_makeGetEntry = _asyncToGenerator
|
|
9476
|
+
_makeGetEntry = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(id, query) {
|
|
9763
9477
|
var options,
|
|
9764
9478
|
withAllLocales,
|
|
9765
9479
|
_args8 = arguments;
|
|
9766
|
-
return _regeneratorRuntime
|
|
9480
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
9767
9481
|
while (1) switch (_context8.prev = _context8.next) {
|
|
9768
9482
|
case 0:
|
|
9769
9483
|
options = _args8.length > 2 && _args8[2] !== undefined ? _args8[2] : {
|
|
@@ -9791,9 +9505,9 @@ var contentful = (function (exports) {
|
|
|
9791
9505
|
return _internalGetEntry.apply(this, arguments);
|
|
9792
9506
|
}
|
|
9793
9507
|
function _internalGetEntry() {
|
|
9794
|
-
_internalGetEntry = _asyncToGenerator
|
|
9508
|
+
_internalGetEntry = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(id, query, options) {
|
|
9795
9509
|
var response;
|
|
9796
|
-
return _regeneratorRuntime
|
|
9510
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
9797
9511
|
while (1) switch (_context9.prev = _context9.next) {
|
|
9798
9512
|
case 0:
|
|
9799
9513
|
if (id) {
|
|
@@ -9835,11 +9549,11 @@ var contentful = (function (exports) {
|
|
|
9835
9549
|
return _makeGetEntries.apply(this, arguments);
|
|
9836
9550
|
}
|
|
9837
9551
|
function _makeGetEntries() {
|
|
9838
|
-
_makeGetEntries = _asyncToGenerator
|
|
9552
|
+
_makeGetEntries = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(query) {
|
|
9839
9553
|
var options,
|
|
9840
9554
|
withAllLocales,
|
|
9841
9555
|
_args10 = arguments;
|
|
9842
|
-
return _regeneratorRuntime
|
|
9556
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
9843
9557
|
while (1) switch (_context10.prev = _context10.next) {
|
|
9844
9558
|
case 0:
|
|
9845
9559
|
options = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {
|
|
@@ -9867,9 +9581,9 @@ var contentful = (function (exports) {
|
|
|
9867
9581
|
return _internalGetEntries.apply(this, arguments);
|
|
9868
9582
|
}
|
|
9869
9583
|
function _internalGetEntries() {
|
|
9870
|
-
_internalGetEntries = _asyncToGenerator
|
|
9584
|
+
_internalGetEntries = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(query, options) {
|
|
9871
9585
|
var withoutLinkResolution, withoutUnresolvableLinks, entries;
|
|
9872
|
-
return _regeneratorRuntime
|
|
9586
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
9873
9587
|
while (1) switch (_context11.prev = _context11.next) {
|
|
9874
9588
|
case 0:
|
|
9875
9589
|
withoutLinkResolution = options.withoutLinkResolution, withoutUnresolvableLinks = options.withoutUnresolvableLinks;
|
|
@@ -9904,10 +9618,10 @@ var contentful = (function (exports) {
|
|
|
9904
9618
|
return _getAsset.apply(this, arguments);
|
|
9905
9619
|
}
|
|
9906
9620
|
function _getAsset() {
|
|
9907
|
-
_getAsset = _asyncToGenerator
|
|
9621
|
+
_getAsset = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(id) {
|
|
9908
9622
|
var query,
|
|
9909
9623
|
_args12 = arguments;
|
|
9910
|
-
return _regeneratorRuntime
|
|
9624
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
9911
9625
|
while (1) switch (_context12.prev = _context12.next) {
|
|
9912
9626
|
case 0:
|
|
9913
9627
|
query = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
|
|
@@ -9924,10 +9638,10 @@ var contentful = (function (exports) {
|
|
|
9924
9638
|
return _getAssets.apply(this, arguments);
|
|
9925
9639
|
}
|
|
9926
9640
|
function _getAssets() {
|
|
9927
|
-
_getAssets = _asyncToGenerator
|
|
9641
|
+
_getAssets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
9928
9642
|
var query,
|
|
9929
9643
|
_args13 = arguments;
|
|
9930
|
-
return _regeneratorRuntime
|
|
9644
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
9931
9645
|
while (1) switch (_context13.prev = _context13.next) {
|
|
9932
9646
|
case 0:
|
|
9933
9647
|
query = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
|
|
@@ -9944,12 +9658,12 @@ var contentful = (function (exports) {
|
|
|
9944
9658
|
return _makeGetAssets.apply(this, arguments);
|
|
9945
9659
|
}
|
|
9946
9660
|
function _makeGetAssets() {
|
|
9947
|
-
_makeGetAssets = _asyncToGenerator
|
|
9661
|
+
_makeGetAssets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(query) {
|
|
9948
9662
|
var options,
|
|
9949
9663
|
withAllLocales,
|
|
9950
9664
|
localeSpecificQuery,
|
|
9951
9665
|
_args14 = arguments;
|
|
9952
|
-
return _regeneratorRuntime
|
|
9666
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
9953
9667
|
while (1) switch (_context14.prev = _context14.next) {
|
|
9954
9668
|
case 0:
|
|
9955
9669
|
options = _args14.length > 1 && _args14[1] !== undefined ? _args14[1] : {
|
|
@@ -9976,8 +9690,8 @@ var contentful = (function (exports) {
|
|
|
9976
9690
|
return _internalGetAsset.apply(this, arguments);
|
|
9977
9691
|
}
|
|
9978
9692
|
function _internalGetAsset() {
|
|
9979
|
-
_internalGetAsset = _asyncToGenerator
|
|
9980
|
-
return _regeneratorRuntime
|
|
9693
|
+
_internalGetAsset = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(id, query) {
|
|
9694
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
9981
9695
|
while (1) switch (_context15.prev = _context15.next) {
|
|
9982
9696
|
case 0:
|
|
9983
9697
|
_context15.prev = 0;
|
|
@@ -10004,12 +9718,12 @@ var contentful = (function (exports) {
|
|
|
10004
9718
|
return _makeGetAsset.apply(this, arguments);
|
|
10005
9719
|
}
|
|
10006
9720
|
function _makeGetAsset() {
|
|
10007
|
-
_makeGetAsset = _asyncToGenerator
|
|
9721
|
+
_makeGetAsset = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(id, query) {
|
|
10008
9722
|
var options,
|
|
10009
9723
|
withAllLocales,
|
|
10010
9724
|
localeSpecificQuery,
|
|
10011
9725
|
_args16 = arguments;
|
|
10012
|
-
return _regeneratorRuntime
|
|
9726
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
10013
9727
|
while (1) switch (_context16.prev = _context16.next) {
|
|
10014
9728
|
case 0:
|
|
10015
9729
|
options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {
|
|
@@ -10036,8 +9750,8 @@ var contentful = (function (exports) {
|
|
|
10036
9750
|
return _internalGetAssets.apply(this, arguments);
|
|
10037
9751
|
}
|
|
10038
9752
|
function _internalGetAssets() {
|
|
10039
|
-
_internalGetAssets = _asyncToGenerator
|
|
10040
|
-
return _regeneratorRuntime
|
|
9753
|
+
_internalGetAssets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17(query) {
|
|
9754
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
10041
9755
|
while (1) switch (_context17.prev = _context17.next) {
|
|
10042
9756
|
case 0:
|
|
10043
9757
|
_context17.prev = 0;
|
|
@@ -10064,8 +9778,8 @@ var contentful = (function (exports) {
|
|
|
10064
9778
|
return _getTag.apply(this, arguments);
|
|
10065
9779
|
}
|
|
10066
9780
|
function _getTag() {
|
|
10067
|
-
_getTag = _asyncToGenerator
|
|
10068
|
-
return _regeneratorRuntime
|
|
9781
|
+
_getTag = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(id) {
|
|
9782
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
10069
9783
|
while (1) switch (_context18.prev = _context18.next) {
|
|
10070
9784
|
case 0:
|
|
10071
9785
|
return _context18.abrupt("return", get({
|
|
@@ -10084,10 +9798,10 @@ var contentful = (function (exports) {
|
|
|
10084
9798
|
return _getTags.apply(this, arguments);
|
|
10085
9799
|
}
|
|
10086
9800
|
function _getTags() {
|
|
10087
|
-
_getTags = _asyncToGenerator
|
|
9801
|
+
_getTags = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19() {
|
|
10088
9802
|
var query,
|
|
10089
9803
|
_args19 = arguments;
|
|
10090
|
-
return _regeneratorRuntime
|
|
9804
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
10091
9805
|
while (1) switch (_context19.prev = _context19.next) {
|
|
10092
9806
|
case 0:
|
|
10093
9807
|
query = _args19.length > 0 && _args19[0] !== undefined ? _args19[0] : {};
|
|
@@ -10111,9 +9825,9 @@ var contentful = (function (exports) {
|
|
|
10111
9825
|
return _createAssetKey.apply(this, arguments);
|
|
10112
9826
|
}
|
|
10113
9827
|
function _createAssetKey() {
|
|
10114
|
-
_createAssetKey = _asyncToGenerator
|
|
9828
|
+
_createAssetKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee20(expiresAt) {
|
|
10115
9829
|
var now, currentMaxLifetime;
|
|
10116
|
-
return _regeneratorRuntime
|
|
9830
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
10117
9831
|
while (1) switch (_context20.prev = _context20.next) {
|
|
10118
9832
|
case 0:
|
|
10119
9833
|
try {
|
|
@@ -10145,10 +9859,10 @@ var contentful = (function (exports) {
|
|
|
10145
9859
|
return _getLocales.apply(this, arguments);
|
|
10146
9860
|
}
|
|
10147
9861
|
function _getLocales() {
|
|
10148
|
-
_getLocales = _asyncToGenerator
|
|
9862
|
+
_getLocales = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
|
|
10149
9863
|
var query,
|
|
10150
9864
|
_args21 = arguments;
|
|
10151
|
-
return _regeneratorRuntime
|
|
9865
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
10152
9866
|
while (1) switch (_context21.prev = _context21.next) {
|
|
10153
9867
|
case 0:
|
|
10154
9868
|
query = _args21.length > 0 && _args21[0] !== undefined ? _args21[0] : {};
|
|
@@ -10172,10 +9886,10 @@ var contentful = (function (exports) {
|
|
|
10172
9886
|
return _sync.apply(this, arguments);
|
|
10173
9887
|
}
|
|
10174
9888
|
function _sync() {
|
|
10175
|
-
_sync = _asyncToGenerator
|
|
9889
|
+
_sync = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee22(query) {
|
|
10176
9890
|
var syncOptions,
|
|
10177
9891
|
_args22 = arguments;
|
|
10178
|
-
return _regeneratorRuntime
|
|
9892
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
10179
9893
|
while (1) switch (_context22.prev = _context22.next) {
|
|
10180
9894
|
case 0:
|
|
10181
9895
|
syncOptions = _args22.length > 1 && _args22[1] !== undefined ? _args22[1] : {
|
|
@@ -10194,11 +9908,11 @@ var contentful = (function (exports) {
|
|
|
10194
9908
|
return _makePagedSync.apply(this, arguments);
|
|
10195
9909
|
}
|
|
10196
9910
|
function _makePagedSync() {
|
|
10197
|
-
_makePagedSync = _asyncToGenerator
|
|
9911
|
+
_makePagedSync = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23(query, syncOptions) {
|
|
10198
9912
|
var options,
|
|
10199
9913
|
combinedOptions,
|
|
10200
9914
|
_args23 = arguments;
|
|
10201
|
-
return _regeneratorRuntime
|
|
9915
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
10202
9916
|
while (1) switch (_context23.prev = _context23.next) {
|
|
10203
9917
|
case 0:
|
|
10204
9918
|
options = _args23.length > 2 && _args23[2] !== undefined ? _args23[2] : {
|
|
@@ -10245,7 +9959,7 @@ var contentful = (function (exports) {
|
|
|
10245
9959
|
http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
|
|
10246
9960
|
}
|
|
10247
9961
|
return {
|
|
10248
|
-
version: "11.2.
|
|
9962
|
+
version: "11.2.3",
|
|
10249
9963
|
getSpace: getSpace,
|
|
10250
9964
|
getContentType: getContentType,
|
|
10251
9965
|
getContentTypes: getContentTypes,
|
|
@@ -10368,7 +10082,7 @@ var contentful = (function (exports) {
|
|
|
10368
10082
|
environment: 'master'
|
|
10369
10083
|
};
|
|
10370
10084
|
var config = Object.assign(Object.assign({}, defaultConfig), params);
|
|
10371
|
-
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.2.
|
|
10085
|
+
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.2.3"), config.application, config.integration);
|
|
10372
10086
|
config.headers = Object.assign(Object.assign({}, config.headers), {
|
|
10373
10087
|
'Content-Type': 'application/vnd.contentful.delivery.v1+json',
|
|
10374
10088
|
'X-Contentful-User-Agent': userAgentHeader
|