nextemos 5.8.5 → 5.8.6

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.
@@ -53,7 +53,8 @@ const fetchRequest = () => {
53
53
  }
54
54
  });
55
55
  }
56
- const isPreview = (options === null || options === void 0 ? void 0 : options.headers)["Preview"];
56
+ const isPreview = (options === null || options === void 0 ? void 0 : options.headers) &&
57
+ (options === null || options === void 0 ? void 0 : options.headers)["Preview"];
57
58
  // if preview is in headers, append it to the params
58
59
  if (!(params === null || params === void 0 ? void 0 : params.noPreview) && isPreview && method === __1.HTTPMethod.GET) {
59
60
  apiURL.searchParams.append("preview", "true");
@@ -64,7 +65,8 @@ const fetchRequest = () => {
64
65
  method === __1.HTTPMethod.DELETE) {
65
66
  options.headers = Object.assign({ ["Content-Type"]: "application/json" }, options.headers);
66
67
  // if output-cache-key is in headers, append it to the body
67
- const outputCacheKey = options.headers["output-cache-key"];
68
+ const outputCacheKey = options.headers &&
69
+ options.headers["output-cache-key"];
68
70
  if (outputCacheKey) {
69
71
  options.body = JSON.stringify(Object.assign(Object.assign({}, (typeof options.body === "string"
70
72
  ? JSON.parse(options.body || "{}")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "5.8.5",
3
+ "version": "5.8.6",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",