unprint 0.4.2 → 0.4.3
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.
- package/package.json +1 -1
- package/src/app.js +2 -2
- package/tests/init.js +1 -2
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -513,8 +513,8 @@ function initAll(context, selector, options) {
|
|
|
513
513
|
return handleError(new Error('Init context is not a DOM element, HTML or an array'), 'INVALID_CONTEXT');
|
|
514
514
|
}
|
|
515
515
|
|
|
516
|
-
return Array.from(context.querySelectorAll(
|
|
517
|
-
.map((element) => init(element,
|
|
516
|
+
return Array.from(context.querySelectorAll(selector))
|
|
517
|
+
.map((element) => init(element, null, options));
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
async function request(url, body, customOptions = {}, method = 'GET') {
|
package/tests/init.js
CHANGED
|
@@ -12,8 +12,7 @@ const port = process.env.PORT || 3101;
|
|
|
12
12
|
async function initTest() {
|
|
13
13
|
unprint.options({ headers: { 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36' } });
|
|
14
14
|
|
|
15
|
-
const res = await unprint.get(`http://127.0.0.1:${port}/html`, {
|
|
16
|
-
|
|
15
|
+
const res = await unprint.get(`http://127.0.0.1:${port}/html`, { select: 'body' });
|
|
17
16
|
// const jsonRes = await unprint.get(`http://127.0.0.1:${port}/json`);
|
|
18
17
|
// const errorRes = await unprint.get(`http://127.0.0.1:${port}/error/404`);
|
|
19
18
|
|