unprint 0.10.0 → 0.10.2

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 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unprint",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
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
@@ -732,7 +732,7 @@ function init(elementOrHtml, selector, options = {}) {
732
732
  }
733
733
 
734
734
  const element = selector
735
- ? elementOrHtml.querySelector(selector)
735
+ ? queryElement({ element: elementOrHtml }, selector)
736
736
  : elementOrHtml;
737
737
 
738
738
  if (!element) {
@@ -772,7 +772,7 @@ function initAll(context, selector, options = {}) {
772
772
  return handleError(new Error('Init context is not a DOM element, HTML or an array'), 'INVALID_CONTEXT');
773
773
  }
774
774
 
775
- return Array.from(context.querySelectorAll(selector))
775
+ return queryElements({ element: context }, selector)
776
776
  .map((element) => init(element, null, options));
777
777
  }
778
778
 
@@ -788,9 +788,11 @@ async function request(url, body, customOptions = {}, method = 'GET') {
788
788
  method,
789
789
  data: body,
790
790
  validateStatus: null,
791
+ ...options,
791
792
  timeout: options.timeout,
792
793
  signal: options.abortSignal,
793
- ...options,
794
+ httpAgent: options.httpAgent,
795
+ httpsAgent: options.httpsAgent,
794
796
  });
795
797
 
796
798
  if (!(res.status >= 200 && res.status < 300)) {