unprint 0.19.11 → 0.19.13

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/app.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unprint",
3
- "version": "0.19.11",
3
+ "version": "0.19.13",
4
4
  "description": "Simplify common web scraping tasks while staying in control of the data.",
5
5
  "main": "src/app.js",
6
6
  "scripts": {
package/src/app.js CHANGED
@@ -1130,7 +1130,7 @@ function curateHeaders(headers, options) {
1130
1130
  }
1131
1131
 
1132
1132
  function curateCookies(res, options) {
1133
- if (res) {
1133
+ if (res?.headers) {
1134
1134
  const setCookie = typeof res.headers.get === 'function'
1135
1135
  ? res.headers.get('set-cookie')
1136
1136
  : res.headers['set-cookie'];
@@ -1167,7 +1167,7 @@ function curateResponse(res, data, options, { url, control, customOptions }) {
1167
1167
  control,
1168
1168
  };
1169
1169
 
1170
- if (['application/json', 'application/javascript'].some((type) => {
1170
+ if (res.headers && ['application/json', 'application/javascript'].some((type) => {
1171
1171
  if (typeof res.headers.get === 'function') {
1172
1172
  return res.headers.get('content-type')?.includes(type);
1173
1173
  }