@logtape/logtape 0.6.0 → 0.6.1
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/esm/formatter.js +2 -2
- package/esm/fs.cjs +1 -1
- package/esm/nodeUtil.cjs +16 -0
- package/esm/nodeUtil.js +2 -0
- package/package.json +1 -1
- package/script/formatter.js +3 -3
- package/script/fs.js +1 -1
- package/script/nodeUtil.js +16 -0
- package/types/formatter.d.ts.map +1 -1
- package/types/nodeUtil.d.ts +3 -0
- package/types/nodeUtil.d.ts.map +1 -0
package/esm/formatter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import util from "
|
|
1
|
+
import util from "./nodeUtil.js";
|
|
2
2
|
/**
|
|
3
3
|
* The severity level abbreviations.
|
|
4
4
|
*/
|
|
@@ -31,7 +31,7 @@ const inspect =
|
|
|
31
31
|
? globalThis.Deno.inspect.bind(globalThis.Deno)
|
|
32
32
|
// @ts-ignore: Node.js global
|
|
33
33
|
// dnt-shim-ignore
|
|
34
|
-
: "inspect" in util && typeof util.inspect === "function"
|
|
34
|
+
: util != null && "inspect" in util && typeof util.inspect === "function"
|
|
35
35
|
// @ts-ignore: Node.js global
|
|
36
36
|
// dnt-shim-ignore
|
|
37
37
|
? util.inspect.bind(util)
|
package/esm/fs.cjs
CHANGED
package/esm/nodeUtil.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
let util = null;
|
|
2
|
+
if (
|
|
3
|
+
"process" in globalThis && "versions" in globalThis.process &&
|
|
4
|
+
"node" in globalThis.process.versions &&
|
|
5
|
+
typeof globalThis.caches === "undefined" &&
|
|
6
|
+
typeof globalThis.addEventListener !== "function" ||
|
|
7
|
+
"Bun" in globalThis
|
|
8
|
+
) {
|
|
9
|
+
try {
|
|
10
|
+
util = require(["node", "util"].join(":"));
|
|
11
|
+
} catch (_) {
|
|
12
|
+
util = null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = util;
|
package/esm/nodeUtil.js
ADDED
package/package.json
CHANGED
package/script/formatter.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.ansiColorFormatter = exports.defaultTextFormatter = void 0;
|
|
|
7
7
|
exports.getTextFormatter = getTextFormatter;
|
|
8
8
|
exports.getAnsiColorFormatter = getAnsiColorFormatter;
|
|
9
9
|
exports.defaultConsoleFormatter = defaultConsoleFormatter;
|
|
10
|
-
const
|
|
10
|
+
const nodeUtil_js_1 = __importDefault(require("./nodeUtil.js"));
|
|
11
11
|
/**
|
|
12
12
|
* The severity level abbreviations.
|
|
13
13
|
*/
|
|
@@ -40,10 +40,10 @@ const inspect =
|
|
|
40
40
|
? globalThis.Deno.inspect.bind(globalThis.Deno)
|
|
41
41
|
// @ts-ignore: Node.js global
|
|
42
42
|
// dnt-shim-ignore
|
|
43
|
-
: "inspect" in
|
|
43
|
+
: nodeUtil_js_1.default != null && "inspect" in nodeUtil_js_1.default && typeof nodeUtil_js_1.default.inspect === "function"
|
|
44
44
|
// @ts-ignore: Node.js global
|
|
45
45
|
// dnt-shim-ignore
|
|
46
|
-
?
|
|
46
|
+
? nodeUtil_js_1.default.inspect.bind(nodeUtil_js_1.default)
|
|
47
47
|
: (v) => JSON.stringify(v);
|
|
48
48
|
/**
|
|
49
49
|
* Get a text formatter with the specified options. Although it's flexible
|
package/script/fs.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
let util = null;
|
|
2
|
+
if (
|
|
3
|
+
"process" in globalThis && "versions" in globalThis.process &&
|
|
4
|
+
"node" in globalThis.process.versions &&
|
|
5
|
+
typeof globalThis.caches === "undefined" &&
|
|
6
|
+
typeof globalThis.addEventListener !== "function" ||
|
|
7
|
+
"Bun" in globalThis
|
|
8
|
+
) {
|
|
9
|
+
try {
|
|
10
|
+
util = require(["node", "util"].join(":"));
|
|
11
|
+
} catch (_) {
|
|
12
|
+
util = null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = util;
|
package/types/formatter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,MAAM,CAAC;AAyC1D;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,SAAS,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,SAAS,CAAC,EACN,oBAAoB,GACpB,cAAc,GACd,WAAW,GACX,eAAe,GACf,SAAS,GACT,MAAM,GACN,MAAM,GACN,SAAS,GACT,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAE7B;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,EACF,MAAM,GACN,MAAM,GACN,GAAG,GACH,MAAM,GACN,MAAM,GACN,GAAG,GACH,CAAC,CAAC,KAAK,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC;IAElC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,KAAK,MAAM,CAAC,CAAC;IAE9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