@certik/skynet 0.10.8 → 0.10.9
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/CHANGELOG.md +4 -0
- package/log.js +18 -1
- package/monitor.js +6 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/log.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
function isObject(a) {
|
|
2
|
+
return !!a && a.constructor === Object;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function print(o) {
|
|
6
|
+
if (Array.isArray(o)) {
|
|
7
|
+
return `[${o.map(print).join(", ")}]`
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (isObject(o)) {
|
|
11
|
+
return `{${Object.keys(o).map(k => `${k}: ${o[k]}`).join(", ")}}`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return `${o}`;
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
function getLine(params) {
|
|
2
18
|
let line = "";
|
|
3
19
|
|
|
@@ -5,7 +21,7 @@ function getLine(params) {
|
|
|
5
21
|
for (let i = 0, l = params.length; i < l; i++) {
|
|
6
22
|
// Certain objects don't get converted
|
|
7
23
|
// Note using JSON.stringfy may be too slow for large objects
|
|
8
|
-
line += `${params[i]} `.replace(/\n/gm, "\t");
|
|
24
|
+
line += `${print(params[i])} `.replace(/\n/gm, "\t");
|
|
9
25
|
}
|
|
10
26
|
|
|
11
27
|
return line.trim();
|
|
@@ -25,5 +41,6 @@ const inline = {
|
|
|
25
41
|
};
|
|
26
42
|
|
|
27
43
|
module.exports = {
|
|
44
|
+
print,
|
|
28
45
|
inline,
|
|
29
46
|
};
|
package/monitor.js
CHANGED
|
@@ -106,7 +106,12 @@ ${
|
|
|
106
106
|
|
|
107
107
|
async function runCheck({ verbose, production, mode, ...selectorFlags }) {
|
|
108
108
|
const startTime = Date.now();
|
|
109
|
-
|
|
109
|
+
|
|
110
|
+
if (Object.keys(selectorFlags).length > 0) {
|
|
111
|
+
console.log(`[MONITOR] starting check, ${toSelectorString(selectorFlags, ", ")}`);
|
|
112
|
+
} else {
|
|
113
|
+
console.log(`[MONITOR] starting check`);
|
|
114
|
+
}
|
|
110
115
|
|
|
111
116
|
let checkState = {};
|
|
112
117
|
|