canvasxpress-cli 41.2.61 → 41.2.62
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/cmds/io.js +14 -4
- package/package.json +1 -1
package/cmds/io.js
CHANGED
|
@@ -49,10 +49,20 @@ module.exports = async (obj) => {
|
|
|
49
49
|
//page.on("console", (consoleObj) => console.log(consoleObj.text()));
|
|
50
50
|
|
|
51
51
|
// Print All except warnings
|
|
52
|
-
page.on('console', consoleObj => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
//page.on('console', consoleObj => {
|
|
53
|
+
// if (consoleObj.type() !== 'warning') {
|
|
54
|
+
// console.log(consoleObj.text());
|
|
55
|
+
// }
|
|
56
|
+
//});
|
|
57
|
+
|
|
58
|
+
page.on('console', async msg => {
|
|
59
|
+
const args = await Promise.all(msg.args.map(arg => arg.executionContext().evaluate(arg => {
|
|
60
|
+
if (arg instanceof Error) {
|
|
61
|
+
return arg.message;
|
|
62
|
+
}
|
|
63
|
+
return arg;
|
|
64
|
+
}, arg)));
|
|
65
|
+
console.log(...args);
|
|
56
66
|
});
|
|
57
67
|
|
|
58
68
|
/*
|