@logtape/logtape 0.10.0-dev.148 → 0.10.0-dev.155
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 +25 -18
- package/package.json +1 -1
- package/script/formatter.js +25 -18
- package/types/formatter.d.ts.map +1 -1
- package/types/nodeUtil.d.ts +10 -1
- package/types/nodeUtil.d.ts.map +1 -1
package/esm/formatter.js
CHANGED
|
@@ -20,32 +20,39 @@ const levelAbbreviations = {
|
|
|
20
20
|
* @returns The string representation of the value.
|
|
21
21
|
*/
|
|
22
22
|
const inspect =
|
|
23
|
-
// @ts-ignore:
|
|
23
|
+
// @ts-ignore: Browser detection
|
|
24
24
|
// dnt-shim-ignore
|
|
25
|
-
|
|
26
|
-
// @ts-ignore:
|
|
25
|
+
typeof document !== "undefined" ||
|
|
26
|
+
// @ts-ignore: React Native detection
|
|
27
27
|
// dnt-shim-ignore
|
|
28
|
-
typeof
|
|
29
|
-
? (v
|
|
28
|
+
typeof navigator !== "undefined" && navigator.product === "ReactNative"
|
|
29
|
+
? (v) => JSON.stringify(v)
|
|
30
30
|
// @ts-ignore: Deno global
|
|
31
31
|
// dnt-shim-ignore
|
|
32
|
-
globalThis.Deno
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})
|
|
37
|
-
// @ts-ignore: Node.js global
|
|
38
|
-
// dnt-shim-ignore
|
|
39
|
-
: util != null && "inspect" in util && typeof util.inspect === "function"
|
|
32
|
+
: "Deno" in globalThis && "inspect" in globalThis.Deno &&
|
|
33
|
+
// @ts-ignore: Deno global
|
|
34
|
+
// dnt-shim-ignore
|
|
35
|
+
typeof globalThis.Deno.inspect === "function"
|
|
40
36
|
? (v, opts) =>
|
|
41
|
-
// @ts-ignore:
|
|
37
|
+
// @ts-ignore: Deno global
|
|
42
38
|
// dnt-shim-ignore
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
globalThis.Deno.inspect(v, {
|
|
40
|
+
strAbbreviateSize: Infinity,
|
|
41
|
+
iterableLimit: Infinity,
|
|
46
42
|
...opts,
|
|
47
43
|
})
|
|
48
|
-
:
|
|
44
|
+
// @ts-ignore: Node.js global
|
|
45
|
+
// dnt-shim-ignore
|
|
46
|
+
: util != null && "inspect" in util && typeof util.inspect === "function"
|
|
47
|
+
? (v, opts) =>
|
|
48
|
+
// @ts-ignore: Node.js global
|
|
49
|
+
// dnt-shim-ignore
|
|
50
|
+
util.inspect(v, {
|
|
51
|
+
maxArrayLength: Infinity,
|
|
52
|
+
maxStringLength: Infinity,
|
|
53
|
+
...opts,
|
|
54
|
+
})
|
|
55
|
+
: (v) => JSON.stringify(v);
|
|
49
56
|
/**
|
|
50
57
|
* Get a text formatter with the specified options. Although it's flexible
|
|
51
58
|
* enough to create a custom formatter, if you want more control, you can
|
package/package.json
CHANGED
package/script/formatter.js
CHANGED
|
@@ -29,32 +29,39 @@ const levelAbbreviations = {
|
|
|
29
29
|
* @returns The string representation of the value.
|
|
30
30
|
*/
|
|
31
31
|
const inspect =
|
|
32
|
-
// @ts-ignore:
|
|
32
|
+
// @ts-ignore: Browser detection
|
|
33
33
|
// dnt-shim-ignore
|
|
34
|
-
|
|
35
|
-
// @ts-ignore:
|
|
34
|
+
typeof document !== "undefined" ||
|
|
35
|
+
// @ts-ignore: React Native detection
|
|
36
36
|
// dnt-shim-ignore
|
|
37
|
-
typeof
|
|
38
|
-
? (v
|
|
37
|
+
typeof navigator !== "undefined" && navigator.product === "ReactNative"
|
|
38
|
+
? (v) => JSON.stringify(v)
|
|
39
39
|
// @ts-ignore: Deno global
|
|
40
40
|
// dnt-shim-ignore
|
|
41
|
-
globalThis.Deno
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
})
|
|
46
|
-
// @ts-ignore: Node.js global
|
|
47
|
-
// dnt-shim-ignore
|
|
48
|
-
: nodeUtil_js_1.default != null && "inspect" in nodeUtil_js_1.default && typeof nodeUtil_js_1.default.inspect === "function"
|
|
41
|
+
: "Deno" in globalThis && "inspect" in globalThis.Deno &&
|
|
42
|
+
// @ts-ignore: Deno global
|
|
43
|
+
// dnt-shim-ignore
|
|
44
|
+
typeof globalThis.Deno.inspect === "function"
|
|
49
45
|
? (v, opts) =>
|
|
50
|
-
// @ts-ignore:
|
|
46
|
+
// @ts-ignore: Deno global
|
|
51
47
|
// dnt-shim-ignore
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
globalThis.Deno.inspect(v, {
|
|
49
|
+
strAbbreviateSize: Infinity,
|
|
50
|
+
iterableLimit: Infinity,
|
|
55
51
|
...opts,
|
|
56
52
|
})
|
|
57
|
-
:
|
|
53
|
+
// @ts-ignore: Node.js global
|
|
54
|
+
// dnt-shim-ignore
|
|
55
|
+
: nodeUtil_js_1.default != null && "inspect" in nodeUtil_js_1.default && typeof nodeUtil_js_1.default.inspect === "function"
|
|
56
|
+
? (v, opts) =>
|
|
57
|
+
// @ts-ignore: Node.js global
|
|
58
|
+
// dnt-shim-ignore
|
|
59
|
+
nodeUtil_js_1.default.inspect(v, {
|
|
60
|
+
maxArrayLength: Infinity,
|
|
61
|
+
maxStringLength: Infinity,
|
|
62
|
+
...opts,
|
|
63
|
+
})
|
|
64
|
+
: (v) => JSON.stringify(v);
|
|
58
65
|
/**
|
|
59
66
|
* Get a text formatter with the specified options. Although it's flexible
|
|
60
67
|
* enough to create a custom formatter, if you want more control, you can
|
package/types/formatter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
{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;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAE,aAAuC,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,SAAS,OAAO,EAAE,CAAC;AAazE;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,OAAO,EAAE,CA2B7E"}
|
package/types/nodeUtil.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
interface InspectOptions {
|
|
2
|
+
colors?: boolean;
|
|
3
|
+
depth?: number | null;
|
|
4
|
+
compact?: boolean;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
interface UtilInterface {
|
|
8
|
+
inspect(obj: unknown, options?: InspectOptions): string;
|
|
9
|
+
}
|
|
10
|
+
declare let util: UtilInterface;
|
|
2
11
|
export default util;
|
|
3
12
|
//# sourceMappingURL=nodeUtil.d.ts.map
|
package/types/nodeUtil.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeUtil.d.ts","sourceRoot":"","sources":["../src/nodeUtil.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nodeUtil.d.ts","sourceRoot":"","sources":["../src/nodeUtil.ts"],"names":[],"mappings":"AAcA,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,UAAU,aAAa;IACrB,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC;CACzD;AAGD,QAAA,IAAI,IAAI,EAAE,aAKT,CAAC;AAOF,eAAe,IAAI,CAAC"}
|