unprint 0.4.1 → 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/README.md +6 -1
- package/package.json +1 -1
- package/src/app.js +3 -3
package/README.md
CHANGED
|
@@ -74,7 +74,12 @@ Options
|
|
|
74
74
|
Returns
|
|
75
75
|
```javascript
|
|
76
76
|
{
|
|
77
|
-
|
|
77
|
+
context: { // using select or no option
|
|
78
|
+
query, // (object) unprint querying methods
|
|
79
|
+
},
|
|
80
|
+
context: [{ // using selectAll
|
|
81
|
+
query,
|
|
82
|
+
}],
|
|
78
83
|
html, // (string) HTML body
|
|
79
84
|
data, // (object) parsed JSON response
|
|
80
85
|
status, // (number) HTTP status code
|
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -508,13 +508,13 @@ function initAll(context, selector, options) {
|
|
|
508
508
|
return initAll(window.document, selector, { ...options, window });
|
|
509
509
|
}
|
|
510
510
|
|
|
511
|
-
if (!(context
|
|
511
|
+
if (!isDomObject(context)) {
|
|
512
512
|
// the context is not a valid
|
|
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') {
|