contentful 11.7.10 → 11.7.11

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.
@@ -757,6 +757,26 @@ var contentful = (function (exports) {
757
757
  return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag$1 in val) && !(iterator in val);
758
758
  };
759
759
 
760
+ /**
761
+ * Determine if a value is an empty object (safely handles Buffers)
762
+ *
763
+ * @param {*} val The value to test
764
+ *
765
+ * @returns {boolean} True if value is an empty object, otherwise false
766
+ */
767
+ var isEmptyObject = function isEmptyObject(val) {
768
+ // Early return for non-objects or Buffers to prevent RangeError
769
+ if (!isObject(val) || isBuffer$1(val)) {
770
+ return false;
771
+ }
772
+ try {
773
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
774
+ } catch (e) {
775
+ // Fallback for any other objects that might cause RangeError with Object.keys()
776
+ return false;
777
+ }
778
+ };
779
+
760
780
  /**
761
781
  * Determine if a value is a Date
762
782
  *
@@ -881,6 +901,11 @@ var contentful = (function (exports) {
881
901
  fn.call(null, obj[i], i, obj);
882
902
  }
883
903
  } else {
904
+ // Buffer check
905
+ if (isBuffer$1(obj)) {
906
+ return;
907
+ }
908
+
884
909
  // Iterate over object keys
885
910
  var keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
886
911
  var len = keys.length;
@@ -892,6 +917,9 @@ var contentful = (function (exports) {
892
917
  }
893
918
  }
894
919
  function findKey(obj, key) {
920
+ if (isBuffer$1(obj)) {
921
+ return null;
922
+ }
895
923
  key = key.toLowerCase();
896
924
  var keys = Object.keys(obj);
897
925
  var i = keys.length;
@@ -1225,6 +1253,11 @@ var contentful = (function (exports) {
1225
1253
  if (stack.indexOf(source) >= 0) {
1226
1254
  return;
1227
1255
  }
1256
+
1257
+ //Buffer check
1258
+ if (isBuffer$1(source)) {
1259
+ return source;
1260
+ }
1228
1261
  if (!('toJSON' in source)) {
1229
1262
  stack[i] = source;
1230
1263
  var target = isArray$7(source) ? [] : {};
@@ -1286,6 +1319,7 @@ var contentful = (function (exports) {
1286
1319
  isBoolean: isBoolean$1,
1287
1320
  isObject: isObject,
1288
1321
  isPlainObject: isPlainObject$2,
1322
+ isEmptyObject: isEmptyObject,
1289
1323
  isReadableStream: isReadableStream,
1290
1324
  isRequest: isRequest,
1291
1325
  isResponse: isResponse,
@@ -1835,7 +1869,7 @@ var contentful = (function (exports) {
1835
1869
  });
1836
1870
  var platform = _objectSpread$2(_objectSpread$2({}, utils$3), platform$1);
1837
1871
  function toURLEncodedForm(data, options) {
1838
- return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
1872
+ return toFormData(data, new platform.classes.URLSearchParams(), _objectSpread$2({
1839
1873
  visitor: function visitor(value, key, path, helpers) {
1840
1874
  if (platform.isNode && utils$1$1.isBuffer(value)) {
1841
1875
  this.append(key, value.toString('base64'));
@@ -2500,7 +2534,7 @@ var contentful = (function (exports) {
2500
2534
  clearTimeout(timer);
2501
2535
  timer = null;
2502
2536
  }
2503
- fn.apply(null, args);
2537
+ fn.apply(void 0, _toConsumableArray$1(args));
2504
2538
  };
2505
2539
  var throttled = function throttled() {
2506
2540
  var now = Date.now();
@@ -2744,7 +2778,7 @@ var contentful = (function (exports) {
2744
2778
  return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
2745
2779
  }
2746
2780
  };
2747
- utils$1$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2781
+ utils$1$1.forEach(Object.keys(_objectSpread$2(_objectSpread$2({}, config1), config2)), function computeConfigValue(prop) {
2748
2782
  var merge = mergeMap[prop] || mergeDeepProperties;
2749
2783
  var configValue = merge(config1[prop], config2[prop], prop);
2750
2784
  utils$1$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
@@ -3590,7 +3624,7 @@ var contentful = (function (exports) {
3590
3624
  return Promise.reject(reason);
3591
3625
  });
3592
3626
  }
3593
- var VERSION = "1.10.0";
3627
+ var VERSION = "1.11.0";
3594
3628
  var validators$1 = {};
3595
3629
 
3596
3630
  // eslint-disable-next-line func-names
@@ -10406,7 +10440,7 @@ var contentful = (function (exports) {
10406
10440
  http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
10407
10441
  }
10408
10442
  return {
10409
- version: "11.7.10",
10443
+ version: "11.7.11",
10410
10444
  getSpace: getSpace,
10411
10445
  getContentType: getContentType,
10412
10446
  getContentTypes: getContentTypes,
@@ -10533,7 +10567,7 @@ var contentful = (function (exports) {
10533
10567
  environment: 'master'
10534
10568
  };
10535
10569
  var config = Object.assign(Object.assign({}, defaultConfig), params);
10536
- var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.7.10"), config.application, config.integration);
10570
+ var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.7.11"), config.application, config.integration);
10537
10571
  config.headers = Object.assign(Object.assign({}, config.headers), {
10538
10572
  'Content-Type': 'application/vnd.contentful.delivery.v1+json',
10539
10573
  'X-Contentful-User-Agent': userAgentHeader