contentful 11.10.2 → 11.10.4

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.
@@ -108,6 +108,90 @@ var contentful = (function (exports) {
108
108
  }), e;
109
109
  }
110
110
 
111
+ function _assertThisInitialized(e) {
112
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
113
+ return e;
114
+ }
115
+
116
+ function _possibleConstructorReturn(t, e) {
117
+ if (e && ("object" == _typeof$2(e) || "function" == typeof e)) return e;
118
+ if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
119
+ return _assertThisInitialized(t);
120
+ }
121
+
122
+ function _getPrototypeOf(t) {
123
+ return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
124
+ return t.__proto__ || Object.getPrototypeOf(t);
125
+ }, _getPrototypeOf(t);
126
+ }
127
+
128
+ function _setPrototypeOf(t, e) {
129
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
130
+ return t.__proto__ = e, t;
131
+ }, _setPrototypeOf(t, e);
132
+ }
133
+
134
+ function _inherits(t, e) {
135
+ if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
136
+ t.prototype = Object.create(e && e.prototype, {
137
+ constructor: {
138
+ value: t,
139
+ writable: true,
140
+ configurable: true
141
+ }
142
+ }), Object.defineProperty(t, "prototype", {
143
+ writable: false
144
+ }), e && _setPrototypeOf(t, e);
145
+ }
146
+
147
+ function _isNativeFunction(t) {
148
+ try {
149
+ return -1 !== Function.toString.call(t).indexOf("[native code]");
150
+ } catch (n) {
151
+ return "function" == typeof t;
152
+ }
153
+ }
154
+
155
+ function _isNativeReflectConstruct$4() {
156
+ try {
157
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
158
+ } catch (t) {}
159
+ return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() {
160
+ return !!t;
161
+ })();
162
+ }
163
+
164
+ function _construct(t, e, r) {
165
+ if (_isNativeReflectConstruct$4()) return Reflect.construct.apply(null, arguments);
166
+ var o = [null];
167
+ o.push.apply(o, e);
168
+ var p = new (t.bind.apply(t, o))();
169
+ return r && _setPrototypeOf(p, r.prototype), p;
170
+ }
171
+
172
+ function _wrapNativeSuper(t) {
173
+ var r = "function" == typeof Map ? new Map() : void 0;
174
+ return _wrapNativeSuper = function _wrapNativeSuper(t) {
175
+ if (null === t || !_isNativeFunction(t)) return t;
176
+ if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
177
+ if (void 0 !== r) {
178
+ if (r.has(t)) return r.get(t);
179
+ r.set(t, Wrapper);
180
+ }
181
+ function Wrapper() {
182
+ return _construct(t, arguments, _getPrototypeOf(this).constructor);
183
+ }
184
+ return Wrapper.prototype = Object.create(t.prototype, {
185
+ constructor: {
186
+ value: Wrapper,
187
+ enumerable: false,
188
+ writable: true,
189
+ configurable: true
190
+ }
191
+ }), _setPrototypeOf(Wrapper, t);
192
+ }, _wrapNativeSuper(t);
193
+ }
194
+
111
195
  function _arrayWithHoles(r) {
112
196
  if (Array.isArray(r)) return r;
113
197
  }
@@ -614,6 +698,8 @@ var contentful = (function (exports) {
614
698
  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; }
615
699
  function ownKeys$2(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; }
616
700
  function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
701
+ function _callSuper$3(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
702
+ function _isNativeReflectConstruct$3() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() { return !!t; })(); }
617
703
  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"); }
618
704
  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: true }) : 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); }
619
705
 
@@ -655,7 +741,7 @@ var contentful = (function (exports) {
655
741
  };
656
742
 
657
743
  /**
658
- * Determine if a value is an Array
744
+ * Determine if a value is a non-null object
659
745
  *
660
746
  * @param {Object} val The value to test
661
747
  *
@@ -670,7 +756,7 @@ var contentful = (function (exports) {
670
756
  *
671
757
  * @returns {boolean} True if the value is undefined, otherwise false
672
758
  */
673
- var isUndefined = typeOfTest('undefined');
759
+ var isUndefined = typeOfTest("undefined");
674
760
 
675
761
  /**
676
762
  * Determine if a value is a Buffer
@@ -690,7 +776,7 @@ var contentful = (function (exports) {
690
776
  *
691
777
  * @returns {boolean} True if value is an ArrayBuffer, otherwise false
692
778
  */
693
- var isArrayBuffer = kindOfTest('ArrayBuffer');
779
+ var isArrayBuffer = kindOfTest("ArrayBuffer");
694
780
 
695
781
  /**
696
782
  * Determine if a value is a view on an ArrayBuffer
@@ -701,7 +787,7 @@ var contentful = (function (exports) {
701
787
  */
702
788
  function isArrayBufferView(val) {
703
789
  var result;
704
- if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
790
+ if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
705
791
  result = ArrayBuffer.isView(val);
706
792
  } else {
707
793
  result = val && val.buffer && isArrayBuffer(val.buffer);
@@ -716,7 +802,7 @@ var contentful = (function (exports) {
716
802
  *
717
803
  * @returns {boolean} True if value is a String, otherwise false
718
804
  */
719
- var isString$3 = typeOfTest('string');
805
+ var isString$3 = typeOfTest("string");
720
806
 
721
807
  /**
722
808
  * Determine if a value is a Function
@@ -724,7 +810,7 @@ var contentful = (function (exports) {
724
810
  * @param {*} val The value to test
725
811
  * @returns {boolean} True if value is a Function, otherwise false
726
812
  */
727
- var isFunction$1 = typeOfTest('function');
813
+ var isFunction$1 = typeOfTest("function");
728
814
 
729
815
  /**
730
816
  * Determine if a value is a Number
@@ -733,7 +819,7 @@ var contentful = (function (exports) {
733
819
  *
734
820
  * @returns {boolean} True if value is a Number, otherwise false
735
821
  */
736
- var isNumber$1 = typeOfTest('number');
822
+ var isNumber$1 = typeOfTest("number");
737
823
 
738
824
  /**
739
825
  * Determine if a value is an Object
@@ -743,7 +829,7 @@ var contentful = (function (exports) {
743
829
  * @returns {boolean} True if value is an Object, otherwise false
744
830
  */
745
831
  var isObject = function isObject(thing) {
746
- return thing !== null && _typeof$2(thing) === 'object';
832
+ return thing !== null && _typeof$2(thing) === "object";
747
833
  };
748
834
 
749
835
  /**
@@ -764,7 +850,7 @@ var contentful = (function (exports) {
764
850
  * @returns {boolean} True if value is a plain Object, otherwise false
765
851
  */
766
852
  var isPlainObject$2 = function isPlainObject(val) {
767
- if (kindOf(val) !== 'object') {
853
+ if (kindOf(val) !== "object") {
768
854
  return false;
769
855
  }
770
856
  var prototype = getPrototypeOf$1(val);
@@ -798,7 +884,7 @@ var contentful = (function (exports) {
798
884
  *
799
885
  * @returns {boolean} True if value is a Date, otherwise false
800
886
  */
801
- var isDate$1 = kindOfTest('Date');
887
+ var isDate$1 = kindOfTest("Date");
802
888
 
803
889
  /**
804
890
  * Determine if a value is a File
@@ -807,7 +893,7 @@ var contentful = (function (exports) {
807
893
  *
808
894
  * @returns {boolean} True if value is a File, otherwise false
809
895
  */
810
- var isFile = kindOfTest('File');
896
+ var isFile = kindOfTest("File");
811
897
 
812
898
  /**
813
899
  * Determine if a value is a Blob
@@ -816,7 +902,7 @@ var contentful = (function (exports) {
816
902
  *
817
903
  * @returns {boolean} True if value is a Blob, otherwise false
818
904
  */
819
- var isBlob = kindOfTest('Blob');
905
+ var isBlob = kindOfTest("Blob");
820
906
 
821
907
  /**
822
908
  * Determine if a value is a FileList
@@ -825,7 +911,7 @@ var contentful = (function (exports) {
825
911
  *
826
912
  * @returns {boolean} True if value is a File, otherwise false
827
913
  */
828
- var isFileList = kindOfTest('FileList');
914
+ var isFileList = kindOfTest("FileList");
829
915
 
830
916
  /**
831
917
  * Determine if a value is a Stream
@@ -847,9 +933,9 @@ var contentful = (function (exports) {
847
933
  */
848
934
  var isFormData = function isFormData(thing) {
849
935
  var kind;
850
- return thing && (typeof FormData === 'function' && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === 'formdata' ||
936
+ return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" ||
851
937
  // detect form-data instance
852
- kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]'));
938
+ kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
853
939
  };
854
940
 
855
941
  /**
@@ -859,8 +945,8 @@ var contentful = (function (exports) {
859
945
  *
860
946
  * @returns {boolean} True if value is a URLSearchParams object, otherwise false
861
947
  */
862
- var isURLSearchParams = kindOfTest('URLSearchParams');
863
- var _map = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest),
948
+ var isURLSearchParams = kindOfTest("URLSearchParams");
949
+ var _map = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest),
864
950
  _map2 = _slicedToArray$1(_map, 4),
865
951
  isReadableStream = _map2[0],
866
952
  isRequest = _map2[1],
@@ -875,7 +961,7 @@ var contentful = (function (exports) {
875
961
  * @returns {String} The String freed of excess whitespace
876
962
  */
877
963
  var trim = function trim(str) {
878
- return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
964
+ return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
879
965
  };
880
966
 
881
967
  /**
@@ -887,10 +973,11 @@ var contentful = (function (exports) {
887
973
  * If 'obj' is an Object callback will be called passing
888
974
  * the value, key, and complete object for each property.
889
975
  *
890
- * @param {Object|Array} obj The object to iterate
976
+ * @param {Object|Array<unknown>} obj The object to iterate
891
977
  * @param {Function} fn The callback to invoke for each item
892
978
  *
893
- * @param {Boolean} [allOwnKeys = false]
979
+ * @param {Object} [options]
980
+ * @param {Boolean} [options.allOwnKeys = false]
894
981
  * @returns {any}
895
982
  */
896
983
  function forEach(obj, fn) {
@@ -898,14 +985,14 @@ var contentful = (function (exports) {
898
985
  _ref3$allOwnKeys = _ref3.allOwnKeys,
899
986
  allOwnKeys = _ref3$allOwnKeys === void 0 ? false : _ref3$allOwnKeys;
900
987
  // Don't bother if no value provided
901
- if (obj === null || typeof obj === 'undefined') {
988
+ if (obj === null || typeof obj === "undefined") {
902
989
  return;
903
990
  }
904
991
  var i;
905
992
  var l;
906
993
 
907
994
  // Force an array if not already something iterable
908
- if (_typeof$2(obj) !== 'object') {
995
+ if (_typeof$2(obj) !== "object") {
909
996
  /*eslint no-param-reassign:0*/
910
997
  obj = [obj];
911
998
  }
@@ -949,7 +1036,7 @@ var contentful = (function (exports) {
949
1036
  var _global = function () {
950
1037
  /*eslint no-undef:0*/
951
1038
  if (typeof globalThis !== "undefined") return globalThis;
952
- return typeof self !== "undefined" ? self : typeof window !== 'undefined' ? window : global;
1039
+ return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
953
1040
  }();
954
1041
  var isContextDefined = function isContextDefined(context) {
955
1042
  return !isUndefined(context) && context !== _global;
@@ -965,7 +1052,7 @@ var contentful = (function (exports) {
965
1052
  * Example:
966
1053
  *
967
1054
  * ```js
968
- * var result = merge({foo: 123}, {foo: 456});
1055
+ * const result = merge({foo: 123}, {foo: 456});
969
1056
  * console.log(result.foo); // outputs 456
970
1057
  * ```
971
1058
  *
@@ -980,6 +1067,10 @@ var contentful = (function (exports) {
980
1067
  skipUndefined = _ref4.skipUndefined;
981
1068
  var result = {};
982
1069
  var assignValue = function assignValue(val, key) {
1070
+ // Skip dangerous property names to prevent prototype pollution
1071
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
1072
+ return;
1073
+ }
983
1074
  var targetKey = caseless && findKey(result, key) || key;
984
1075
  if (isPlainObject$2(result[targetKey]) && isPlainObject$2(val)) {
985
1076
  result[targetKey] = merge$1(result[targetKey], val);
@@ -1004,7 +1095,8 @@ var contentful = (function (exports) {
1004
1095
  * @param {Object} b The object to copy properties from
1005
1096
  * @param {Object} thisArg The object to bind function to
1006
1097
  *
1007
- * @param {Boolean} [allOwnKeys]
1098
+ * @param {Object} [options]
1099
+ * @param {Boolean} [options.allOwnKeys]
1008
1100
  * @returns {Object} The resulting value of object a
1009
1101
  */
1010
1102
  var extend = function extend(a, b, thisArg) {
@@ -1012,9 +1104,19 @@ var contentful = (function (exports) {
1012
1104
  allOwnKeys = _ref5.allOwnKeys;
1013
1105
  forEach(b, function (val, key) {
1014
1106
  if (thisArg && isFunction$1(val)) {
1015
- a[key] = bind$3(val, thisArg);
1107
+ Object.defineProperty(a, key, {
1108
+ value: bind$3(val, thisArg),
1109
+ writable: true,
1110
+ enumerable: true,
1111
+ configurable: true
1112
+ });
1016
1113
  } else {
1017
- a[key] = val;
1114
+ Object.defineProperty(a, key, {
1115
+ value: val,
1116
+ writable: true,
1117
+ enumerable: true,
1118
+ configurable: true
1119
+ });
1018
1120
  }
1019
1121
  }, {
1020
1122
  allOwnKeys: allOwnKeys
@@ -1030,7 +1132,7 @@ var contentful = (function (exports) {
1030
1132
  * @returns {string} content value without BOM
1031
1133
  */
1032
1134
  var stripBOM = function stripBOM(content) {
1033
- if (content.charCodeAt(0) === 0xFEFF) {
1135
+ if (content.charCodeAt(0) === 0xfeff) {
1034
1136
  content = content.slice(1);
1035
1137
  }
1036
1138
  return content;
@@ -1047,8 +1149,13 @@ var contentful = (function (exports) {
1047
1149
  */
1048
1150
  var inherits = function inherits(constructor, superConstructor, props, descriptors) {
1049
1151
  constructor.prototype = Object.create(superConstructor.prototype, descriptors);
1050
- constructor.prototype.constructor = constructor;
1051
- Object.defineProperty(constructor, 'super', {
1152
+ Object.defineProperty(constructor.prototype, "constructor", {
1153
+ value: constructor,
1154
+ writable: true,
1155
+ enumerable: false,
1156
+ configurable: true
1157
+ });
1158
+ Object.defineProperty(constructor, "super", {
1052
1159
  value: superConstructor.prototype
1053
1160
  });
1054
1161
  props && Object.assign(constructor.prototype, props);
@@ -1138,7 +1245,7 @@ var contentful = (function (exports) {
1138
1245
  return function (thing) {
1139
1246
  return TypedArray && thing instanceof TypedArray;
1140
1247
  };
1141
- }(typeof Uint8Array !== 'undefined' && getPrototypeOf$1(Uint8Array));
1248
+ }(typeof Uint8Array !== "undefined" && getPrototypeOf$1(Uint8Array));
1142
1249
 
1143
1250
  /**
1144
1251
  * For each entry in the object, call the function with the key and value.
@@ -1176,7 +1283,7 @@ var contentful = (function (exports) {
1176
1283
  };
1177
1284
 
1178
1285
  /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
1179
- var isHTMLForm = kindOfTest('HTMLFormElement');
1286
+ var isHTMLForm = kindOfTest("HTMLFormElement");
1180
1287
  var toCamelCase = function toCamelCase(str) {
1181
1288
  return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
1182
1289
  return p1.toUpperCase() + p2;
@@ -1198,7 +1305,7 @@ var contentful = (function (exports) {
1198
1305
  *
1199
1306
  * @returns {boolean} True if value is a RegExp object, otherwise false
1200
1307
  */
1201
- var isRegExp$2 = kindOfTest('RegExp');
1308
+ var isRegExp$2 = kindOfTest("RegExp");
1202
1309
  var reduceDescriptors = function reduceDescriptors(obj, reducer) {
1203
1310
  var descriptors = Object.getOwnPropertyDescriptors(obj);
1204
1311
  var reducedDescriptors = {};
@@ -1219,19 +1326,19 @@ var contentful = (function (exports) {
1219
1326
  var freezeMethods = function freezeMethods(obj) {
1220
1327
  reduceDescriptors(obj, function (descriptor, name) {
1221
1328
  // skip restricted props in strict mode
1222
- if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
1329
+ if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
1223
1330
  return false;
1224
1331
  }
1225
1332
  var value = obj[name];
1226
1333
  if (!isFunction$1(value)) return;
1227
1334
  descriptor.enumerable = false;
1228
- if ('writable' in descriptor) {
1335
+ if ("writable" in descriptor) {
1229
1336
  descriptor.writable = false;
1230
1337
  return;
1231
1338
  }
1232
1339
  if (!descriptor.set) {
1233
1340
  descriptor.set = function () {
1234
- throw Error('Can not rewrite read-only method \'' + name + '\'');
1341
+ throw Error("Can not rewrite read-only method '" + name + "'");
1235
1342
  };
1236
1343
  }
1237
1344
  });
@@ -1259,7 +1366,7 @@ var contentful = (function (exports) {
1259
1366
  * @returns {boolean}
1260
1367
  */
1261
1368
  function isSpecCompliantForm(thing) {
1262
- return !!(thing && isFunction$1(thing.append) && thing[toStringTag$1] === 'FormData' && thing[iterator]);
1369
+ return !!(thing && isFunction$1(thing.append) && thing[toStringTag$1] === "FormData" && thing[iterator]);
1263
1370
  }
1264
1371
  var toJSONObject = function toJSONObject(obj) {
1265
1372
  var stack = new Array(10);
@@ -1273,7 +1380,7 @@ var contentful = (function (exports) {
1273
1380
  if (isBuffer$1(source)) {
1274
1381
  return source;
1275
1382
  }
1276
- if (!('toJSON' in source)) {
1383
+ if (!("toJSON" in source)) {
1277
1384
  stack[i] = source;
1278
1385
  var target = isArray$7(source) ? [] : {};
1279
1386
  forEach(source, function (value, key) {
@@ -1288,7 +1395,7 @@ var contentful = (function (exports) {
1288
1395
  };
1289
1396
  return _visit(obj, 0);
1290
1397
  };
1291
- var isAsyncFn = kindOfTest('AsyncFunction');
1398
+ var isAsyncFn = kindOfTest("AsyncFunction");
1292
1399
  var isThenable = function isThenable(thing) {
1293
1400
  return thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
1294
1401
  };
@@ -1315,8 +1422,8 @@ var contentful = (function (exports) {
1315
1422
  }("axios@".concat(Math.random()), []) : function (cb) {
1316
1423
  return setTimeout(cb);
1317
1424
  };
1318
- }(typeof setImmediate === 'function', isFunction$1(_global.postMessage));
1319
- var asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global) : typeof process !== 'undefined' && process.nextTick || _setImmediate;
1425
+ }(typeof setImmediate === "function", isFunction$1(_global.postMessage));
1426
+ var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
1320
1427
 
1321
1428
  // *********************
1322
1429
 
@@ -1383,95 +1490,79 @@ var contentful = (function (exports) {
1383
1490
  asap: asap,
1384
1491
  isIterable: isIterable
1385
1492
  };
1386
-
1387
- /**
1388
- * Create an Error with the specified message, config, error code, request and response.
1389
- *
1390
- * @param {string} message The error message.
1391
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
1392
- * @param {Object} [config] The config.
1393
- * @param {Object} [request] The request.
1394
- * @param {Object} [response] The response.
1395
- *
1396
- * @returns {Error} The created error.
1397
- */
1398
- function AxiosError(message, code, config, request, response) {
1399
- Error.call(this);
1400
- if (Error.captureStackTrace) {
1401
- Error.captureStackTrace(this, this.constructor);
1402
- } else {
1403
- this.stack = new Error().stack;
1404
- }
1405
- this.message = message;
1406
- this.name = 'AxiosError';
1407
- code && (this.code = code);
1408
- config && (this.config = config);
1409
- request && (this.request = request);
1410
- if (response) {
1411
- this.response = response;
1412
- this.status = response.status ? response.status : null;
1413
- }
1414
- }
1415
- utils$1$1.inherits(AxiosError, Error, {
1416
- toJSON: function toJSON() {
1417
- return {
1418
- // Standard
1419
- message: this.message,
1420
- name: this.name,
1421
- // Microsoft
1422
- description: this.description,
1423
- number: this.number,
1424
- // Mozilla
1425
- fileName: this.fileName,
1426
- lineNumber: this.lineNumber,
1427
- columnNumber: this.columnNumber,
1428
- stack: this.stack,
1429
- // Axios
1430
- config: utils$1$1.toJSONObject(this.config),
1431
- code: this.code,
1432
- status: this.status
1433
- };
1434
- }
1435
- });
1436
- var prototype$1 = AxiosError.prototype;
1437
- var descriptors = {};
1438
- ['ERR_BAD_OPTION_VALUE', 'ERR_BAD_OPTION', 'ECONNABORTED', 'ETIMEDOUT', 'ERR_NETWORK', 'ERR_FR_TOO_MANY_REDIRECTS', 'ERR_DEPRECATED', 'ERR_BAD_RESPONSE', 'ERR_BAD_REQUEST', 'ERR_CANCELED', 'ERR_NOT_SUPPORT', 'ERR_INVALID_URL'
1439
- // eslint-disable-next-line func-names
1440
- ].forEach(function (code) {
1441
- descriptors[code] = {
1442
- value: code
1443
- };
1444
- });
1445
- Object.defineProperties(AxiosError, descriptors);
1446
- Object.defineProperty(prototype$1, 'isAxiosError', {
1447
- value: true
1448
- });
1449
-
1450
- // eslint-disable-next-line func-names
1451
- AxiosError.from = function (error, code, config, request, response, customProps) {
1452
- var axiosError = Object.create(prototype$1);
1453
- utils$1$1.toFlatObject(error, axiosError, function filter(obj) {
1454
- return obj !== Error.prototype;
1455
- }, function (prop) {
1456
- return prop !== 'isAxiosError';
1457
- });
1458
- var msg = error && error.message ? error.message : 'Error';
1459
-
1460
- // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
1461
- var errCode = code == null && error ? error.code : code;
1462
- AxiosError.call(axiosError, msg, errCode, config, request, response);
1463
-
1464
- // Chain the original error on the standard field; non-enumerable to avoid JSON noise
1465
- if (error && axiosError.cause == null) {
1466
- Object.defineProperty(axiosError, 'cause', {
1467
- value: error,
1468
- configurable: true
1469
- });
1493
+ var AxiosError = /*#__PURE__*/function (_Error) {
1494
+ /**
1495
+ * Create an Error with the specified message, config, error code, request and response.
1496
+ *
1497
+ * @param {string} message The error message.
1498
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
1499
+ * @param {Object} [config] The config.
1500
+ * @param {Object} [request] The request.
1501
+ * @param {Object} [response] The response.
1502
+ *
1503
+ * @returns {Error} The created error.
1504
+ */
1505
+ function AxiosError(message, code, config, request, response) {
1506
+ var _this;
1507
+ _classCallCheck(this, AxiosError);
1508
+ _this = _callSuper$3(this, AxiosError, [message]);
1509
+ _this.name = 'AxiosError';
1510
+ _this.isAxiosError = true;
1511
+ code && (_this.code = code);
1512
+ config && (_this.config = config);
1513
+ request && (_this.request = request);
1514
+ if (response) {
1515
+ _this.response = response;
1516
+ _this.status = response.status;
1517
+ }
1518
+ return _this;
1470
1519
  }
1471
- axiosError.name = error && error.name || 'Error';
1472
- customProps && Object.assign(axiosError, customProps);
1473
- return axiosError;
1474
- };
1520
+ _inherits(AxiosError, _Error);
1521
+ return _createClass(AxiosError, [{
1522
+ key: "toJSON",
1523
+ value: function toJSON() {
1524
+ return {
1525
+ // Standard
1526
+ message: this.message,
1527
+ name: this.name,
1528
+ // Microsoft
1529
+ description: this.description,
1530
+ number: this.number,
1531
+ // Mozilla
1532
+ fileName: this.fileName,
1533
+ lineNumber: this.lineNumber,
1534
+ columnNumber: this.columnNumber,
1535
+ stack: this.stack,
1536
+ // Axios
1537
+ config: utils$1$1.toJSONObject(this.config),
1538
+ code: this.code,
1539
+ status: this.status
1540
+ };
1541
+ }
1542
+ }], [{
1543
+ key: "from",
1544
+ value: function from(error, code, config, request, response, customProps) {
1545
+ var axiosError = new AxiosError(error.message, code || error.code, config, request, response);
1546
+ axiosError.cause = error;
1547
+ axiosError.name = error.name;
1548
+ customProps && Object.assign(axiosError, customProps);
1549
+ return axiosError;
1550
+ }
1551
+ }]);
1552
+ }(/*#__PURE__*/_wrapNativeSuper(Error)); // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
1553
+ AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
1554
+ AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
1555
+ AxiosError.ECONNABORTED = 'ECONNABORTED';
1556
+ AxiosError.ETIMEDOUT = 'ETIMEDOUT';
1557
+ AxiosError.ERR_NETWORK = 'ERR_NETWORK';
1558
+ AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
1559
+ AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
1560
+ AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
1561
+ AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
1562
+ AxiosError.ERR_CANCELED = 'ERR_CANCELED';
1563
+ AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
1564
+ AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
1565
+ var AxiosError$1 = AxiosError;
1475
1566
 
1476
1567
  // eslint-disable-next-line strict
1477
1568
  var httpAdapter = null;
@@ -1589,7 +1680,7 @@ var contentful = (function (exports) {
1589
1680
  return value.toString();
1590
1681
  }
1591
1682
  if (!useBlob && utils$1$1.isBlob(value)) {
1592
- throw new AxiosError('Blob is not supported. Use a Buffer instead.');
1683
+ throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
1593
1684
  }
1594
1685
  if (utils$1$1.isArrayBuffer(value) || utils$1$1.isTypedArray(value)) {
1595
1686
  return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
@@ -1729,22 +1820,19 @@ var contentful = (function (exports) {
1729
1820
  * @returns {string} The formatted url
1730
1821
  */
1731
1822
  function buildURL(url, params, options) {
1732
- /*eslint no-param-reassign:0*/
1733
1823
  if (!params) {
1734
1824
  return url;
1735
1825
  }
1736
1826
  var _encode = options && options.encode || encode$2;
1737
- if (utils$1$1.isFunction(options)) {
1738
- options = {
1739
- serialize: options
1740
- };
1741
- }
1742
- var serializeFn = options && options.serialize;
1827
+ var _options = utils$1$1.isFunction(options) ? {
1828
+ serialize: options
1829
+ } : options;
1830
+ var serializeFn = _options && _options.serialize;
1743
1831
  var serializedParams;
1744
1832
  if (serializeFn) {
1745
- serializedParams = serializeFn(params, options);
1833
+ serializedParams = serializeFn(params, _options);
1746
1834
  } else {
1747
- serializedParams = utils$1$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
1835
+ serializedParams = utils$1$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
1748
1836
  }
1749
1837
  if (serializedParams) {
1750
1838
  var hashmarkIndex = url.indexOf("#");
@@ -1766,6 +1854,7 @@ var contentful = (function (exports) {
1766
1854
  *
1767
1855
  * @param {Function} fulfilled The function to handle `then` for a `Promise`
1768
1856
  * @param {Function} rejected The function to handle `reject` for a `Promise`
1857
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
1769
1858
  *
1770
1859
  * @return {Number} An ID used to remove interceptor later
1771
1860
  */
@@ -1834,7 +1923,8 @@ var contentful = (function (exports) {
1834
1923
  var transitionalDefaults = {
1835
1924
  silentJSONParsing: true,
1836
1925
  forcedJSONParsing: true,
1837
- clarifyTimeoutError: false
1926
+ clarifyTimeoutError: false,
1927
+ legacyInterceptorReqResOrdering: true
1838
1928
  };
1839
1929
  var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
1840
1930
  var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
@@ -2064,7 +2154,7 @@ var contentful = (function (exports) {
2064
2154
  } catch (e) {
2065
2155
  if (strictJSONParsing) {
2066
2156
  if (e.name === 'SyntaxError') {
2067
- throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
2157
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
2068
2158
  }
2069
2159
  throw e;
2070
2160
  }
@@ -2460,24 +2550,28 @@ var contentful = (function (exports) {
2460
2550
  function isCancel(value) {
2461
2551
  return !!(value && value.__CANCEL__);
2462
2552
  }
2463
-
2464
- /**
2465
- * A `CanceledError` is an object that is thrown when an operation is canceled.
2466
- *
2467
- * @param {string=} message The message.
2468
- * @param {Object=} config The config.
2469
- * @param {Object=} request The request.
2470
- *
2471
- * @returns {CanceledError} The created error.
2472
- */
2473
- function CanceledError(message, config, request) {
2474
- // eslint-disable-next-line no-eq-null,eqeqeq
2475
- AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
2476
- this.name = 'CanceledError';
2477
- }
2478
- utils$1$1.inherits(CanceledError, AxiosError, {
2479
- __CANCEL__: true
2480
- });
2553
+ var CanceledError = /*#__PURE__*/function (_AxiosError$) {
2554
+ /**
2555
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
2556
+ *
2557
+ * @param {string=} message The message.
2558
+ * @param {Object=} config The config.
2559
+ * @param {Object=} request The request.
2560
+ *
2561
+ * @returns {CanceledError} The created error.
2562
+ */
2563
+ function CanceledError(message, config, request) {
2564
+ var _this2;
2565
+ _classCallCheck(this, CanceledError);
2566
+ _this2 = _callSuper$3(this, CanceledError, [message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request]);
2567
+ _this2.name = 'CanceledError';
2568
+ _this2.__CANCEL__ = true;
2569
+ return _this2;
2570
+ }
2571
+ _inherits(CanceledError, _AxiosError$);
2572
+ return _createClass(CanceledError);
2573
+ }(AxiosError$1);
2574
+ var CanceledError$1 = CanceledError;
2481
2575
 
2482
2576
  /**
2483
2577
  * Resolve or reject a Promise based on response status.
@@ -2493,7 +2587,7 @@ var contentful = (function (exports) {
2493
2587
  if (!response.status || !validateStatus || validateStatus(response.status)) {
2494
2588
  resolve(response);
2495
2589
  } else {
2496
- reject(new AxiosError('Request failed with status code ' + response.status, [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
2590
+ reject(new AxiosError$1('Request failed with status code ' + response.status, [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
2497
2591
  }
2498
2592
  }
2499
2593
  function parseProtocol(url) {
@@ -2689,6 +2783,9 @@ var contentful = (function (exports) {
2689
2783
  // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2690
2784
  // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2691
2785
  // by any combination of letters, digits, plus, period, or hyphen.
2786
+ if (typeof url !== 'string') {
2787
+ return false;
2788
+ }
2692
2789
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2693
2790
  }
2694
2791
 
@@ -2750,8 +2847,6 @@ var contentful = (function (exports) {
2750
2847
  }
2751
2848
  return source;
2752
2849
  }
2753
-
2754
- // eslint-disable-next-line consistent-return
2755
2850
  function mergeDeepProperties(a, b, prop, caseless) {
2756
2851
  if (!utils$1$1.isUndefined(b)) {
2757
2852
  return getMergedValue(a, b, prop, caseless);
@@ -2818,7 +2913,8 @@ var contentful = (function (exports) {
2818
2913
  }
2819
2914
  };
2820
2915
  utils$1$1.forEach(Object.keys(_objectSpread$2(_objectSpread$2({}, config1), config2)), function computeConfigValue(prop) {
2821
- var merge = mergeMap[prop] || mergeDeepProperties;
2916
+ if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
2917
+ var merge = utils$1$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
2822
2918
  var configValue = merge(config1[prop], config2[prop], prop);
2823
2919
  utils$1$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
2824
2920
  });
@@ -2952,7 +3048,7 @@ var contentful = (function (exports) {
2952
3048
  if (!request) {
2953
3049
  return;
2954
3050
  }
2955
- reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
3051
+ reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
2956
3052
 
2957
3053
  // Clean up request
2958
3054
  request = null;
@@ -2964,7 +3060,7 @@ var contentful = (function (exports) {
2964
3060
  // (message may be empty; when present, surface it)
2965
3061
  // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
2966
3062
  var msg = event && event.message ? event.message : 'Network Error';
2967
- var err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
3063
+ var err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
2968
3064
  // attach the underlying event for consumers who want details
2969
3065
  err.event = event || null;
2970
3066
  reject(err);
@@ -2978,7 +3074,7 @@ var contentful = (function (exports) {
2978
3074
  if (_config.timeoutErrorMessage) {
2979
3075
  timeoutErrorMessage = _config.timeoutErrorMessage;
2980
3076
  }
2981
- reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request));
3077
+ reject(new AxiosError$1(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, config, request));
2982
3078
 
2983
3079
  // Clean up request
2984
3080
  request = null;
@@ -3029,7 +3125,7 @@ var contentful = (function (exports) {
3029
3125
  if (!request) {
3030
3126
  return;
3031
3127
  }
3032
- reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
3128
+ reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
3033
3129
  request.abort();
3034
3130
  request = null;
3035
3131
  };
@@ -3040,7 +3136,7 @@ var contentful = (function (exports) {
3040
3136
  }
3041
3137
  var protocol = parseProtocol(_config.url);
3042
3138
  if (protocol && platform.protocols.indexOf(protocol) === -1) {
3043
- reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
3139
+ reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
3044
3140
  return;
3045
3141
  }
3046
3142
 
@@ -3059,12 +3155,12 @@ var contentful = (function (exports) {
3059
3155
  aborted = true;
3060
3156
  unsubscribe();
3061
3157
  var err = reason instanceof Error ? reason : this.reason;
3062
- controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
3158
+ controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
3063
3159
  }
3064
3160
  };
3065
3161
  var timer = timeout && setTimeout(function () {
3066
3162
  timer = null;
3067
- onabort(new AxiosError("timeout ".concat(timeout, " of ms exceeded"), AxiosError.ETIMEDOUT));
3163
+ onabort(new AxiosError$1("timeout of ".concat(timeout, "ms exceeded"), AxiosError$1.ETIMEDOUT));
3068
3164
  }, timeout);
3069
3165
  var unsubscribe = function unsubscribe() {
3070
3166
  if (signals) {
@@ -3383,7 +3479,7 @@ var contentful = (function (exports) {
3383
3479
  if (method) {
3384
3480
  return method.call(res);
3385
3481
  }
3386
- throw new AxiosError("Response type '".concat(type, "' is not supported"), AxiosError.ERR_NOT_SUPPORT, config);
3482
+ throw new AxiosError$1("Response type '".concat(type, "' is not supported"), AxiosError$1.ERR_NOT_SUPPORT, config);
3387
3483
  });
3388
3484
  });
3389
3485
  }();
@@ -3566,11 +3662,11 @@ var contentful = (function (exports) {
3566
3662
  _context8.next = 41;
3567
3663
  break;
3568
3664
  }
3569
- throw Object.assign(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), {
3665
+ throw Object.assign(new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request, _context8.t2 && _context8.t2.response), {
3570
3666
  cause: _context8.t2.cause || _context8.t2
3571
3667
  });
3572
3668
  case 41:
3573
- throw AxiosError.from(_context8.t2, _context8.t2 && _context8.t2.code, config, request);
3669
+ throw AxiosError$1.from(_context8.t2, _context8.t2 && _context8.t2.code, config, request, _context8.t2 && _context8.t2.response);
3574
3670
  case 42:
3575
3671
  case "end":
3576
3672
  return _context8.stop();
@@ -3681,7 +3777,7 @@ var contentful = (function (exports) {
3681
3777
  if (!isResolvedHandle(nameOrAdapter)) {
3682
3778
  adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3683
3779
  if (adapter === undefined) {
3684
- throw new AxiosError("Unknown adapter '".concat(id, "'"));
3780
+ throw new AxiosError$1("Unknown adapter '".concat(id, "'"));
3685
3781
  }
3686
3782
  }
3687
3783
  if (adapter && (utils$1$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
@@ -3697,7 +3793,7 @@ var contentful = (function (exports) {
3697
3793
  return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build');
3698
3794
  });
3699
3795
  var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
3700
- throw new AxiosError("There is no suitable adapter to dispatch the request " + s, 'ERR_NOT_SUPPORT');
3796
+ throw new AxiosError$1("There is no suitable adapter to dispatch the request " + s, 'ERR_NOT_SUPPORT');
3701
3797
  }
3702
3798
  return adapter;
3703
3799
  }
@@ -3730,7 +3826,7 @@ var contentful = (function (exports) {
3730
3826
  config.cancelToken.throwIfRequested();
3731
3827
  }
3732
3828
  if (config.signal && config.signal.aborted) {
3733
- throw new CanceledError(null, config);
3829
+ throw new CanceledError$1(null, config);
3734
3830
  }
3735
3831
  }
3736
3832
 
@@ -3771,7 +3867,7 @@ var contentful = (function (exports) {
3771
3867
  return Promise.reject(reason);
3772
3868
  });
3773
3869
  }
3774
- var VERSION = "1.13.2";
3870
+ var VERSION = "1.13.5";
3775
3871
  var validators$1 = {};
3776
3872
 
3777
3873
  // eslint-disable-next-line func-names
@@ -3799,7 +3895,7 @@ var contentful = (function (exports) {
3799
3895
  // eslint-disable-next-line func-names
3800
3896
  return function (value, opt, opts) {
3801
3897
  if (validator === false) {
3802
- throw new AxiosError(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError.ERR_DEPRECATED);
3898
+ throw new AxiosError$1(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError$1.ERR_DEPRECATED);
3803
3899
  }
3804
3900
  if (version && !deprecatedWarnings[opt]) {
3805
3901
  deprecatedWarnings[opt] = true;
@@ -3829,7 +3925,7 @@ var contentful = (function (exports) {
3829
3925
 
3830
3926
  function assertOptions(options, schema, allowUnknown) {
3831
3927
  if (_typeof$2(options) !== 'object') {
3832
- throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
3928
+ throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
3833
3929
  }
3834
3930
  var keys = Object.keys(options);
3835
3931
  var i = keys.length;
@@ -3840,12 +3936,12 @@ var contentful = (function (exports) {
3840
3936
  var value = options[opt];
3841
3937
  var result = value === undefined || _validator(value, opt, options);
3842
3938
  if (result !== true) {
3843
- throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
3939
+ throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
3844
3940
  }
3845
3941
  continue;
3846
3942
  }
3847
3943
  if (allowUnknown !== true) {
3848
- throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
3944
+ throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
3849
3945
  }
3850
3946
  }
3851
3947
  }
@@ -3945,7 +4041,8 @@ var contentful = (function (exports) {
3945
4041
  validator.assertOptions(transitional, {
3946
4042
  silentJSONParsing: validators.transitional(validators.boolean),
3947
4043
  forcedJSONParsing: validators.transitional(validators.boolean),
3948
- clarifyTimeoutError: validators.transitional(validators.boolean)
4044
+ clarifyTimeoutError: validators.transitional(validators.boolean),
4045
+ legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
3949
4046
  }, false);
3950
4047
  }
3951
4048
  if (paramsSerializer != null) {
@@ -3990,7 +4087,13 @@ var contentful = (function (exports) {
3990
4087
  return;
3991
4088
  }
3992
4089
  synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
3993
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
4090
+ var transitional = config.transitional || transitionalDefaults;
4091
+ var legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
4092
+ if (legacyInterceptorReqResOrdering) {
4093
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
4094
+ } else {
4095
+ requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
4096
+ }
3994
4097
  });
3995
4098
  var responseInterceptorChain = [];
3996
4099
  this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
@@ -4120,7 +4223,7 @@ var contentful = (function (exports) {
4120
4223
  // Cancellation has already been requested
4121
4224
  return;
4122
4225
  }
4123
- token.reason = new CanceledError(message, config, request);
4226
+ token.reason = new CanceledError$1(message, config, request);
4124
4227
  resolvePromise(token.reason);
4125
4228
  });
4126
4229
  }
@@ -4170,14 +4273,14 @@ var contentful = (function (exports) {
4170
4273
  }, {
4171
4274
  key: "toAbortSignal",
4172
4275
  value: function toAbortSignal() {
4173
- var _this = this;
4276
+ var _this3 = this;
4174
4277
  var controller = new AbortController();
4175
4278
  var abort = function abort(err) {
4176
4279
  controller.abort(err);
4177
4280
  };
4178
4281
  this.subscribe(abort);
4179
4282
  controller.signal.unsubscribe = function () {
4180
- return _this.unsubscribe(abort);
4283
+ return _this3.unsubscribe(abort);
4181
4284
  };
4182
4285
  return controller.signal;
4183
4286
  }
@@ -4209,7 +4312,7 @@ var contentful = (function (exports) {
4209
4312
  *
4210
4313
  * ```js
4211
4314
  * function f(x, y, z) {}
4212
- * var args = [1, 2, 3];
4315
+ * const args = [1, 2, 3];
4213
4316
  * f.apply(null, args);
4214
4317
  * ```
4215
4318
  *
@@ -4353,14 +4456,14 @@ var contentful = (function (exports) {
4353
4456
  axios.Axios = Axios$1;
4354
4457
 
4355
4458
  // Expose Cancel & CancelToken
4356
- axios.CanceledError = CanceledError;
4459
+ axios.CanceledError = CanceledError$1;
4357
4460
  axios.CancelToken = CancelToken$1;
4358
4461
  axios.isCancel = isCancel;
4359
4462
  axios.VERSION = VERSION;
4360
4463
  axios.toFormData = toFormData;
4361
4464
 
4362
4465
  // Expose AxiosError class
4363
- axios.AxiosError = AxiosError;
4466
+ axios.AxiosError = AxiosError$1;
4364
4467
 
4365
4468
  // alias for CanceledError for backward compatibility
4366
4469
  axios.Cancel = axios.CanceledError;
@@ -5091,25 +5194,6 @@ var contentful = (function (exports) {
5091
5194
  }());
5092
5195
  }
5093
5196
 
5094
- function _setPrototypeOf(t, e) {
5095
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
5096
- return t.__proto__ = e, t;
5097
- }, _setPrototypeOf(t, e);
5098
- }
5099
-
5100
- function _inherits(t, e) {
5101
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
5102
- t.prototype = Object.create(e && e.prototype, {
5103
- constructor: {
5104
- value: t,
5105
- writable: true,
5106
- configurable: true
5107
- }
5108
- }), Object.defineProperty(t, "prototype", {
5109
- writable: false
5110
- }), e && _setPrototypeOf(t, e);
5111
- }
5112
-
5113
5197
  var freeGlobal$1 = (typeof global === "undefined" ? "undefined" : _typeof$2(global)) == 'object' && global && global.Object === Object && global;
5114
5198
  var _freeGlobal = freeGlobal$1;
5115
5199
 
@@ -5281,71 +5365,6 @@ var contentful = (function (exports) {
5281
5365
  var isString_1 = isString$1;
5282
5366
  var isString$2 = /*@__PURE__*/getDefaultExportFromCjs(isString_1);
5283
5367
 
5284
- function _assertThisInitialized(e) {
5285
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5286
- return e;
5287
- }
5288
-
5289
- function _possibleConstructorReturn(t, e) {
5290
- if (e && ("object" == _typeof$2(e) || "function" == typeof e)) return e;
5291
- if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
5292
- return _assertThisInitialized(t);
5293
- }
5294
-
5295
- function _getPrototypeOf(t) {
5296
- return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
5297
- return t.__proto__ || Object.getPrototypeOf(t);
5298
- }, _getPrototypeOf(t);
5299
- }
5300
-
5301
- function _isNativeFunction(t) {
5302
- try {
5303
- return -1 !== Function.toString.call(t).indexOf("[native code]");
5304
- } catch (n) {
5305
- return "function" == typeof t;
5306
- }
5307
- }
5308
-
5309
- function _isNativeReflectConstruct$3() {
5310
- try {
5311
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
5312
- } catch (t) {}
5313
- return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() {
5314
- return !!t;
5315
- })();
5316
- }
5317
-
5318
- function _construct(t, e, r) {
5319
- if (_isNativeReflectConstruct$3()) return Reflect.construct.apply(null, arguments);
5320
- var o = [null];
5321
- o.push.apply(o, e);
5322
- var p = new (t.bind.apply(t, o))();
5323
- return r && _setPrototypeOf(p, r.prototype), p;
5324
- }
5325
-
5326
- function _wrapNativeSuper(t) {
5327
- var r = "function" == typeof Map ? new Map() : void 0;
5328
- return _wrapNativeSuper = function _wrapNativeSuper(t) {
5329
- if (null === t || !_isNativeFunction(t)) return t;
5330
- if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
5331
- if (void 0 !== r) {
5332
- if (r.has(t)) return r.get(t);
5333
- r.set(t, Wrapper);
5334
- }
5335
- function Wrapper() {
5336
- return _construct(t, arguments, _getPrototypeOf(this).constructor);
5337
- }
5338
- return Wrapper.prototype = Object.create(t.prototype, {
5339
- constructor: {
5340
- value: Wrapper,
5341
- enumerable: false,
5342
- writable: true,
5343
- configurable: true
5344
- }
5345
- }), _setPrototypeOf(Wrapper, t);
5346
- }, _wrapNativeSuper(t);
5347
- }
5348
-
5349
5368
  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: true } : { done: false, 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 = true, u = false; 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 = true, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
5350
5369
  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; } }
5351
5370
  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; }
@@ -7202,7 +7221,7 @@ var contentful = (function (exports) {
7202
7221
  var hexTable = function () {
7203
7222
  var array = [];
7204
7223
  for (var i = 0; i < 256; ++i) {
7205
- array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
7224
+ array[array.length] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
7206
7225
  }
7207
7226
  return array;
7208
7227
  }();
@@ -7214,7 +7233,7 @@ var contentful = (function (exports) {
7214
7233
  var compacted = [];
7215
7234
  for (var j = 0; j < obj.length; ++j) {
7216
7235
  if (typeof obj[j] !== 'undefined') {
7217
- compacted.push(obj[j]);
7236
+ compacted[compacted.length] = obj[j];
7218
7237
  }
7219
7238
  }
7220
7239
  item.obj[item.prop] = compacted;
@@ -7239,7 +7258,11 @@ var contentful = (function (exports) {
7239
7258
  }
7240
7259
  if (_typeof$2(source) !== 'object' && typeof source !== 'function') {
7241
7260
  if (isArray$2(target)) {
7242
- target.push(source);
7261
+ var nextIndex = target.length;
7262
+ if (options && typeof options.arrayLimit === 'number' && nextIndex > options.arrayLimit) {
7263
+ return markOverflow(arrayToObject(target.concat(source), options), nextIndex);
7264
+ }
7265
+ target[nextIndex] = source;
7243
7266
  } else if (target && _typeof$2(target) === 'object') {
7244
7267
  if (isOverflow(target)) {
7245
7268
  // Add at next numeric index for overflow objects
@@ -7270,7 +7293,11 @@ var contentful = (function (exports) {
7270
7293
  }
7271
7294
  return markOverflow(result, getMaxIndex(source) + 1);
7272
7295
  }
7273
- return [target].concat(source);
7296
+ var combined = [target].concat(source);
7297
+ if (options && typeof options.arrayLimit === 'number' && combined.length > options.arrayLimit) {
7298
+ return markOverflow(arrayToObject(combined, options), combined.length - 1);
7299
+ }
7300
+ return combined;
7274
7301
  }
7275
7302
  var mergeTarget = target;
7276
7303
  if (isArray$2(target) && !isArray$2(source)) {
@@ -7283,7 +7310,7 @@ var contentful = (function (exports) {
7283
7310
  if (targetItem && _typeof$2(targetItem) === 'object' && item && _typeof$2(item) === 'object') {
7284
7311
  target[i] = merge(targetItem, item, options);
7285
7312
  } else {
7286
- target.push(item);
7313
+ target[target.length] = item;
7287
7314
  }
7288
7315
  } else {
7289
7316
  target[i] = item;
@@ -7298,6 +7325,15 @@ var contentful = (function (exports) {
7298
7325
  } else {
7299
7326
  acc[key] = value;
7300
7327
  }
7328
+ if (isOverflow(source) && !isOverflow(acc)) {
7329
+ markOverflow(acc, getMaxIndex(source));
7330
+ }
7331
+ if (isOverflow(acc)) {
7332
+ var keyNum = parseInt(key, 10);
7333
+ if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) {
7334
+ setMaxIndex(acc, keyNum);
7335
+ }
7336
+ }
7301
7337
  return acc;
7302
7338
  }, mergeTarget);
7303
7339
  };
@@ -7395,11 +7431,11 @@ var contentful = (function (exports) {
7395
7431
  var key = keys[j];
7396
7432
  var val = obj[key];
7397
7433
  if (_typeof$2(val) === 'object' && val !== null && refs.indexOf(val) === -1) {
7398
- queue.push({
7434
+ queue[queue.length] = {
7399
7435
  obj: obj,
7400
7436
  prop: key
7401
- });
7402
- refs.push(val);
7437
+ };
7438
+ refs[refs.length] = val;
7403
7439
  }
7404
7440
  }
7405
7441
  }
@@ -7435,7 +7471,7 @@ var contentful = (function (exports) {
7435
7471
  if (isArray$2(val)) {
7436
7472
  var mapped = [];
7437
7473
  for (var i = 0; i < val.length; i += 1) {
7438
- mapped.push(fn(val[i]));
7474
+ mapped[mapped.length] = fn(val[i]);
7439
7475
  }
7440
7476
  return mapped;
7441
7477
  }
@@ -7451,6 +7487,7 @@ var contentful = (function (exports) {
7451
7487
  isBuffer: isBuffer,
7452
7488
  isOverflow: isOverflow,
7453
7489
  isRegExp: isRegExp,
7490
+ markOverflow: markOverflow,
7454
7491
  maybeMap: maybeMap,
7455
7492
  merge: merge
7456
7493
  };
@@ -7757,7 +7794,7 @@ var contentful = (function (exports) {
7757
7794
  };
7758
7795
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
7759
7796
  cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
7760
- var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
7797
+ var limit = options.parameterLimit === Infinity ? void undefined : options.parameterLimit;
7761
7798
  var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded ? limit + 1 : limit);
7762
7799
  if (options.throwOnLimitExceeded && parts.length > limit) {
7763
7800
  throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
@@ -7804,6 +7841,12 @@ var contentful = (function (exports) {
7804
7841
  if (part.indexOf('[]=') > -1) {
7805
7842
  val = isArray(val) ? [val] : val;
7806
7843
  }
7844
+ if (options.comma && isArray(val) && val.length > options.arrayLimit) {
7845
+ if (options.throwOnLimitExceeded) {
7846
+ throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
7847
+ }
7848
+ val = utils.combine([], val, options.arrayLimit, options.plainObjects);
7849
+ }
7807
7850
  if (key !== null) {
7808
7851
  var existing = has.call(obj, key);
7809
7852
  if (existing && options.duplicates === 'combine') {
@@ -7839,13 +7882,19 @@ var contentful = (function (exports) {
7839
7882
  var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
7840
7883
  var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
7841
7884
  var index = parseInt(decodedRoot, 10);
7885
+ var isValidArrayIndex = !isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays;
7842
7886
  if (!options.parseArrays && decodedRoot === '') {
7843
7887
  obj = {
7844
7888
  0: leaf
7845
7889
  };
7846
- } else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays && index <= options.arrayLimit) {
7890
+ } else if (isValidArrayIndex && index < options.arrayLimit) {
7847
7891
  obj = [];
7848
7892
  obj[index] = leaf;
7893
+ } else if (isValidArrayIndex && options.throwOnLimitExceeded) {
7894
+ throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
7895
+ } else if (isValidArrayIndex) {
7896
+ obj[index] = leaf;
7897
+ utils.markOverflow(obj, index);
7849
7898
  } else if (decodedRoot !== '__proto__') {
7850
7899
  obj[decodedRoot] = leaf;
7851
7900
  }
@@ -7875,7 +7924,7 @@ var contentful = (function (exports) {
7875
7924
  return;
7876
7925
  }
7877
7926
  }
7878
- keys.push(parent);
7927
+ keys[keys.length] = parent;
7879
7928
  }
7880
7929
  var i = 0;
7881
7930
  while ((segment = child.exec(key)) !== null && i < options.depth) {
@@ -7886,13 +7935,13 @@ var contentful = (function (exports) {
7886
7935
  return;
7887
7936
  }
7888
7937
  }
7889
- keys.push(segment[1]);
7938
+ keys[keys.length] = segment[1];
7890
7939
  }
7891
7940
  if (segment) {
7892
7941
  if (options.strictDepth === true) {
7893
7942
  throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
7894
7943
  }
7895
- keys.push('[' + key.slice(segment.index) + ']');
7944
+ keys[keys.length] = '[' + key.slice(segment.index) + ']';
7896
7945
  }
7897
7946
  return keys;
7898
7947
  };