unprint 0.15.4 → 0.15.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/app.js +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unprint",
3
- "version": "0.15.4",
3
+ "version": "0.15.6",
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
@@ -523,8 +523,6 @@ function queryStyle(context, selector, customOptions) {
523
523
  removeStyleFunctionSpaces(element, options);
524
524
  }
525
525
 
526
- console.log('OPTIONS', options.styleAttribute);
527
-
528
526
  if (element.style) {
529
527
  return options.styleAttribute
530
528
  ? element.style.getPropertyValue(options.styleAttribute)
@@ -1014,7 +1012,6 @@ async function request(url, body, customOptions = {}, method = 'GET') {
1014
1012
 
1015
1013
  const instance = axios.create({
1016
1014
  method,
1017
- data: body,
1018
1015
  validateStatus: null,
1019
1016
  headers: options.headers,
1020
1017
  timeout: options.timeout,
@@ -1036,7 +1033,10 @@ async function request(url, body, customOptions = {}, method = 'GET') {
1036
1033
 
1037
1034
  events.emit('requestInit', feedbackBase);
1038
1035
 
1039
- const res = await limiter.schedule(async () => instance.request(url));
1036
+ const res = await limiter.schedule(async () => instance.request({
1037
+ url,
1038
+ data: body,
1039
+ }));
1040
1040
 
1041
1041
  if (!(res.status >= 200 && res.status < 300)) {
1042
1042
  handleError(new Error(`HTTP response from ${url} not OK (${res.status} ${res.statusText}): ${res.data}`), 'HTTP_NOT_OK');
@@ -1072,7 +1072,7 @@ async function request(url, body, customOptions = {}, method = 'GET') {
1072
1072
  statusText: res.statusText,
1073
1073
  });
1074
1074
 
1075
- if (['application/json', 'application/javascript'].includes(res.headers['content-type']) && typeof res.data === 'object') {
1075
+ if (['application/json', 'application/javascript'].some((type) => res.headers['content-type'].includes(type)) && typeof res.data === 'object') {
1076
1076
  return {
1077
1077
  ...base,
1078
1078
  data: res.data,