@meadown/logger 1.8.0 → 1.8.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.
- package/README.md +2 -0
- package/dist/cjs/tap/tapAsync.js +2 -2
- package/dist/tap/tapAsync.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -88,6 +88,8 @@ const user = await logger.tap(
|
|
|
88
88
|
You can immediately see: was it successful? How long did it take? What came
|
|
89
89
|
back? Without opening DevTools.
|
|
90
90
|
|
|
91
|
+

|
|
92
|
+
|
|
91
93
|
Works with plain values too — logs it, returns it, nothing changes:
|
|
92
94
|
|
|
93
95
|
```ts
|
package/dist/cjs/tap/tapAsync.js
CHANGED
|
@@ -35,9 +35,9 @@ function formatDuration(ms, useColor) {
|
|
|
35
35
|
const text = ms >= 1000 ? `${(ms / 1000).toFixed(2)}s` : `${ms}ms`;
|
|
36
36
|
if (!useColor)
|
|
37
37
|
return text;
|
|
38
|
-
if (ms >=
|
|
38
|
+
if (ms >= 2000)
|
|
39
39
|
return (0, color_js_1.colorize)(text, "red");
|
|
40
|
-
if (ms >=
|
|
40
|
+
if (ms >= 500)
|
|
41
41
|
return (0, color_js_1.colorize)(text, "yellow");
|
|
42
42
|
return (0, color_js_1.colorize)(text, "green");
|
|
43
43
|
}
|
package/dist/tap/tapAsync.js
CHANGED
|
@@ -31,9 +31,9 @@ function formatDuration(ms, useColor) {
|
|
|
31
31
|
const text = ms >= 1000 ? `${(ms / 1000).toFixed(2)}s` : `${ms}ms`;
|
|
32
32
|
if (!useColor)
|
|
33
33
|
return text;
|
|
34
|
-
if (ms >=
|
|
34
|
+
if (ms >= 2000)
|
|
35
35
|
return colorize(text, "red");
|
|
36
|
-
if (ms >=
|
|
36
|
+
if (ms >= 500)
|
|
37
37
|
return colorize(text, "yellow");
|
|
38
38
|
return colorize(text, "green");
|
|
39
39
|
}
|
package/package.json
CHANGED