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.
@@ -14854,6 +14854,26 @@ const isPlainObject$2 = val => {
14854
14854
  return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag$1 in val) && !(iterator in val);
14855
14855
  };
14856
14856
 
14857
+ /**
14858
+ * Determine if a value is an empty object (safely handles Buffers)
14859
+ *
14860
+ * @param {*} val The value to test
14861
+ *
14862
+ * @returns {boolean} True if value is an empty object, otherwise false
14863
+ */
14864
+ const isEmptyObject = val => {
14865
+ // Early return for non-objects or Buffers to prevent RangeError
14866
+ if (!isObject(val) || isBuffer$1(val)) {
14867
+ return false;
14868
+ }
14869
+ try {
14870
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
14871
+ } catch (e) {
14872
+ // Fallback for any other objects that might cause RangeError with Object.keys()
14873
+ return false;
14874
+ }
14875
+ };
14876
+
14857
14877
  /**
14858
14878
  * Determine if a value is a Date
14859
14879
  *
@@ -14968,6 +14988,11 @@ function forEach(obj, fn, {
14968
14988
  fn.call(null, obj[i], i, obj);
14969
14989
  }
14970
14990
  } else {
14991
+ // Buffer check
14992
+ if (isBuffer$1(obj)) {
14993
+ return;
14994
+ }
14995
+
14971
14996
  // Iterate over object keys
14972
14997
  const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
14973
14998
  const len = keys.length;
@@ -14979,6 +15004,9 @@ function forEach(obj, fn, {
14979
15004
  }
14980
15005
  }
14981
15006
  function findKey(obj, key) {
15007
+ if (isBuffer$1(obj)) {
15008
+ return null;
15009
+ }
14982
15010
  key = key.toLowerCase();
14983
15011
  const keys = Object.keys(obj);
14984
15012
  let i = keys.length;
@@ -15308,6 +15336,11 @@ const toJSONObject = obj => {
15308
15336
  if (stack.indexOf(source) >= 0) {
15309
15337
  return;
15310
15338
  }
15339
+
15340
+ //Buffer check
15341
+ if (isBuffer$1(source)) {
15342
+ return source;
15343
+ }
15311
15344
  if (!('toJSON' in source)) {
15312
15345
  stack[i] = source;
15313
15346
  const target = isArray$8(source) ? [] : {};
@@ -15364,6 +15397,7 @@ const utils$1$1 = {
15364
15397
  isBoolean: isBoolean$1,
15365
15398
  isObject,
15366
15399
  isPlainObject: isPlainObject$2,
15400
+ isEmptyObject,
15367
15401
  isReadableStream,
15368
15402
  isRequest,
15369
15403
  isResponse,
@@ -15919,7 +15953,7 @@ const utils$3 = /*#__PURE__*/Object.freeze({
15919
15953
  });
15920
15954
  const platform = _objectSpread2(_objectSpread2({}, utils$3), platform$1);
15921
15955
  function toURLEncodedForm(data, options) {
15922
- return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
15956
+ return toFormData(data, new platform.classes.URLSearchParams(), _objectSpread2({
15923
15957
  visitor: function (value, key, path, helpers) {
15924
15958
  if (platform.isNode && utils$1$1.isBuffer(value)) {
15925
15959
  this.append(key, value.toString('base64'));
@@ -16502,7 +16536,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
16502
16536
  }
16503
16537
  return requestedURL;
16504
16538
  }
16505
- const VERSION = "1.10.0";
16539
+ const VERSION = "1.11.0";
16506
16540
  function parseProtocol(url) {
16507
16541
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
16508
16542
  return match && match[1] || '';
@@ -16858,7 +16892,7 @@ function throttle(fn, freq) {
16858
16892
  clearTimeout(timer);
16859
16893
  timer = null;
16860
16894
  }
16861
- fn.apply(null, args);
16895
+ fn(...args);
16862
16896
  };
16863
16897
  const throttled = (...args) => {
16864
16898
  const now = Date.now();
@@ -17591,7 +17625,7 @@ function mergeConfig(config1, config2) {
17591
17625
  validateStatus: mergeDirectKeys,
17592
17626
  headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
17593
17627
  };
17594
- utils$1$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
17628
+ utils$1$1.forEach(Object.keys(_objectSpread2(_objectSpread2({}, config1), config2)), function computeConfigValue(prop) {
17595
17629
  const merge = mergeMap[prop] || mergeDeepProperties;
17596
17630
  const configValue = merge(config1[prop], config2[prop], prop);
17597
17631
  utils$1$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
@@ -18427,8 +18461,8 @@ class Axios {
18427
18461
  let len;
18428
18462
  if (!synchronousRequestInterceptors) {
18429
18463
  const chain = [dispatchRequest.bind(this), undefined];
18430
- chain.unshift.apply(chain, requestInterceptorChain);
18431
- chain.push.apply(chain, responseInterceptorChain);
18464
+ chain.unshift(...requestInterceptorChain);
18465
+ chain.push(...responseInterceptorChain);
18432
18466
  len = chain.length;
18433
18467
  promise = Promise.resolve(config);
18434
18468
  while (i < len) {
@@ -23337,7 +23371,7 @@ function createContentfulApi({
23337
23371
  http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
23338
23372
  }
23339
23373
  return {
23340
- version: "11.7.10",
23374
+ version: "11.7.11",
23341
23375
  getSpace,
23342
23376
  getContentType,
23343
23377
  getContentTypes,
@@ -23460,7 +23494,7 @@ function createClient(params) {
23460
23494
  environment: 'master'
23461
23495
  };
23462
23496
  const config = Object.assign(Object.assign({}, defaultConfig), params);
23463
- const userAgentHeader = getUserAgentHeader(`contentful.js/${"11.7.10"}`, config.application, config.integration);
23497
+ const userAgentHeader = getUserAgentHeader(`contentful.js/${"11.7.11"}`, config.application, config.integration);
23464
23498
  config.headers = Object.assign(Object.assign({}, config.headers), {
23465
23499
  'Content-Type': 'application/vnd.contentful.delivery.v1+json',
23466
23500
  'X-Contentful-User-Agent': userAgentHeader
@@ -37,7 +37,7 @@ function createClient(params) {
37
37
  environment: 'master',
38
38
  };
39
39
  const config = Object.assign(Object.assign({}, defaultConfig), params);
40
- const userAgentHeader = getUserAgentHeader(`contentful.js/${"11.7.10"}`, config.application, config.integration);
40
+ const userAgentHeader = getUserAgentHeader(`contentful.js/${"11.7.11"}`, config.application, config.integration);
41
41
  config.headers = Object.assign(Object.assign({}, config.headers), { 'Content-Type': 'application/vnd.contentful.delivery.v1+json', 'X-Contentful-User-Agent': userAgentHeader });
42
42
  const http = createHttpClient(axios, config);
43
43
  if (!http.defaults.baseURL) {
@@ -391,7 +391,7 @@ function createContentfulApi({ http, getGlobalOptions }, options) {
391
391
  http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
392
392
  }
393
393
  return {
394
- version: "11.7.10",
394
+ version: "11.7.11",
395
395
  getSpace,
396
396
  getContentType,
397
397
  getContentTypes,