contentful 9.2.17 → 9.2.18

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.
@@ -4531,6 +4531,33 @@ __webpack_require__.r(__webpack_exports__);
4531
4531
 
4532
4532
 
4533
4533
 
4534
+ function _iterableToArrayLimit(arr, i) {
4535
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
4536
+ if (null != _i) {
4537
+ var _s,
4538
+ _e,
4539
+ _x,
4540
+ _r,
4541
+ _arr = [],
4542
+ _n = !0,
4543
+ _d = !1;
4544
+ try {
4545
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
4546
+ if (Object(_i) !== _i) return;
4547
+ _n = !1;
4548
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
4549
+ } catch (err) {
4550
+ _d = !0, _e = err;
4551
+ } finally {
4552
+ try {
4553
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
4554
+ } finally {
4555
+ if (_d) throw _e;
4556
+ }
4557
+ }
4558
+ return _arr;
4559
+ }
4560
+ }
4534
4561
  function ownKeys(object, enumerableOnly) {
4535
4562
  var keys = Object.keys(object);
4536
4563
  if (Object.getOwnPropertySymbols) {
@@ -4584,12 +4611,18 @@ function _wrapRegExp() {
4584
4611
  }
4585
4612
  return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) {
4586
4613
  var result = _super.exec.call(this, str);
4587
- return result && (result.groups = buildGroups(result, this)), result;
4614
+ if (result) {
4615
+ result.groups = buildGroups(result, this);
4616
+ var indices = result.indices;
4617
+ indices && (indices.groups = buildGroups(indices, this));
4618
+ }
4619
+ return result;
4588
4620
  }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
4589
4621
  if ("string" == typeof substitution) {
4590
4622
  var groups = _groups.get(this);
4591
4623
  return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
4592
- return "$" + groups[name];
4624
+ var group = groups[name];
4625
+ return "$" + (Array.isArray(group) ? group.join("$") : group);
4593
4626
  }));
4594
4627
  }
4595
4628
  if ("function" == typeof substitution) {
@@ -4603,6 +4636,7 @@ function _wrapRegExp() {
4603
4636
  }, _wrapRegExp.apply(this, arguments);
4604
4637
  }
4605
4638
  function _defineProperty(obj, key, value) {
4639
+ key = _toPropertyKey(key);
4606
4640
  if (key in obj) {
4607
4641
  Object.defineProperty(obj, key, {
4608
4642
  value: value,
@@ -4644,30 +4678,6 @@ function _slicedToArray(arr, i) {
4644
4678
  function _arrayWithHoles(arr) {
4645
4679
  if (Array.isArray(arr)) return arr;
4646
4680
  }
4647
- function _iterableToArrayLimit(arr, i) {
4648
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
4649
- if (_i == null) return;
4650
- var _arr = [];
4651
- var _n = true;
4652
- var _d = false;
4653
- var _s, _e;
4654
- try {
4655
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
4656
- _arr.push(_s.value);
4657
- if (i && _arr.length === i) break;
4658
- }
4659
- } catch (err) {
4660
- _d = true;
4661
- _e = err;
4662
- } finally {
4663
- try {
4664
- if (!_n && _i["return"] != null) _i["return"]();
4665
- } finally {
4666
- if (_d) throw _e;
4667
- }
4668
- }
4669
- return _arr;
4670
- }
4671
4681
  function _unsupportedIterableToArray(o, minLen) {
4672
4682
  if (!o) return;
4673
4683
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -4735,16 +4745,28 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
4735
4745
  }
4736
4746
  };
4737
4747
  }
4748
+ function _toPrimitive(input, hint) {
4749
+ if (typeof input !== "object" || input === null) return input;
4750
+ var prim = input[Symbol.toPrimitive];
4751
+ if (prim !== undefined) {
4752
+ var res = prim.call(input, hint || "default");
4753
+ if (typeof res !== "object") return res;
4754
+ throw new TypeError("@@toPrimitive must return a primitive value.");
4755
+ }
4756
+ return (hint === "string" ? String : Number)(input);
4757
+ }
4758
+ function _toPropertyKey(arg) {
4759
+ var key = _toPrimitive(arg, "string");
4760
+ return typeof key === "symbol" ? key : String(key);
4761
+ }
4738
4762
 
4739
4763
  function isNode() {
4740
4764
  /**
4741
- * Polyfills of 'process' might set process.browser === true
4742
- *
4743
- * See:
4744
- * https://github.com/webpack/node-libs-browser/blob/master/mock/process.js#L8
4745
- * https://github.com/defunctzombie/node-process/blob/master/browser.js#L156
4746
- **/
4747
- return typeof process !== 'undefined' && !process.browser;
4765
+ * Save way to check for the global scope which should confirm if an environment is node
4766
+ * For reference: https://stackoverflow.com/a/31090240
4767
+ */
4768
+ var isNodeFunc = new Function('try {return this===global;}catch(e){return false;}');
4769
+ return isNodeFunc();
4748
4770
  }
4749
4771
  function isReactNative() {
4750
4772
  return typeof window !== 'undefined' && 'navigator' in window && 'product' in window.navigator && window.navigator.product === 'ReactNative';
@@ -4989,14 +5011,6 @@ function createHttpClient(axios, options) {
4989
5011
  if (!config.headers.Authorization && typeof config.accessToken !== 'function') {
4990
5012
  config.headers.Authorization = 'Bearer ' + config.accessToken;
4991
5013
  }
4992
-
4993
- // Set these headers only for node because browsers don't like it when you
4994
- // override user-agent or accept-encoding.
4995
- // The SDKs should set their own X-Contentful-User-Agent.
4996
- if (isNode()) {
4997
- config.headers['user-agent'] = 'node.js/' + getNodeVersion();
4998
- config.headers['Accept-Encoding'] = 'gzip';
4999
- }
5000
5014
  var axiosOptions = {
5001
5015
  // Axios
5002
5016
  baseURL: baseURL,
@@ -10063,7 +10077,7 @@ function createClient(params) {
10063
10077
  environment: 'master'
10064
10078
  };
10065
10079
  const config = _objectSpread(_objectSpread({}, defaultConfig), params);
10066
- const userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])(`contentful.js/${"9.2.17"}`, config.application, config.integration);
10080
+ const userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])(`contentful.js/${"9.2.18"}`, config.application, config.integration);
10067
10081
  config.headers = _objectSpread(_objectSpread({}, config.headers), {}, {
10068
10082
  'Content-Type': 'application/vnd.contentful.delivery.v1+json',
10069
10083
  'X-Contentful-User-Agent': userAgentHeader