@logtape/logtape 1.2.2 → 1.2.4
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/package.json +4 -1
- package/deno.json +0 -36
- package/src/config.test.ts +0 -589
- package/src/config.ts +0 -409
- package/src/context.test.ts +0 -187
- package/src/context.ts +0 -55
- package/src/filter.test.ts +0 -84
- package/src/filter.ts +0 -64
- package/src/fixtures.ts +0 -35
- package/src/formatter.test.ts +0 -569
- package/src/formatter.ts +0 -961
- package/src/level.test.ts +0 -71
- package/src/level.ts +0 -86
- package/src/logger.test.ts +0 -1508
- package/src/logger.ts +0 -1788
- package/src/mod.ts +0 -59
- package/src/record.ts +0 -49
- package/src/sink.test.ts +0 -2590
- package/src/sink.ts +0 -976
- package/src/util.deno.ts +0 -19
- package/src/util.node.ts +0 -12
- package/src/util.ts +0 -11
- package/tsdown.config.ts +0 -24
package/src/util.deno.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface InspectOptions {
|
|
2
|
-
colors?: boolean;
|
|
3
|
-
depth?: number | null;
|
|
4
|
-
compact?: boolean;
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function inspect(obj: unknown, options?: InspectOptions): string {
|
|
9
|
-
if ("Deno" in globalThis) {
|
|
10
|
-
return Deno.inspect(obj, {
|
|
11
|
-
colors: options?.colors,
|
|
12
|
-
depth: options?.depth ?? undefined,
|
|
13
|
-
compact: options?.compact ?? true,
|
|
14
|
-
});
|
|
15
|
-
} else {
|
|
16
|
-
const indent = options?.compact === true ? undefined : 2;
|
|
17
|
-
return JSON.stringify(obj, null, indent);
|
|
18
|
-
}
|
|
19
|
-
}
|
package/src/util.node.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import util from "node:util";
|
|
2
|
-
|
|
3
|
-
export interface InspectOptions {
|
|
4
|
-
colors?: boolean;
|
|
5
|
-
depth?: number | null;
|
|
6
|
-
compact?: boolean;
|
|
7
|
-
[key: string]: unknown;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function inspect(obj: unknown, options?: InspectOptions): string {
|
|
11
|
-
return util.inspect(obj, options);
|
|
12
|
-
}
|
package/src/util.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface InspectOptions {
|
|
2
|
-
colors?: boolean;
|
|
3
|
-
depth?: number | null;
|
|
4
|
-
compact?: boolean;
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function inspect(obj: unknown, options?: InspectOptions): string {
|
|
9
|
-
const indent = options?.compact === true ? undefined : 2;
|
|
10
|
-
return JSON.stringify(obj, null, indent);
|
|
11
|
-
}
|
package/tsdown.config.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "tsdown";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
entry: ["src/mod.ts", "src/util.ts", "src/util.deno.ts", "src/util.node.ts"],
|
|
5
|
-
dts: {
|
|
6
|
-
sourcemap: true,
|
|
7
|
-
},
|
|
8
|
-
format: ["esm", "cjs"],
|
|
9
|
-
platform: "neutral",
|
|
10
|
-
unbundle: true,
|
|
11
|
-
inputOptions: {
|
|
12
|
-
onLog(level, log, defaultHandler) {
|
|
13
|
-
if (
|
|
14
|
-
level === "warn" && log.code === "UNRESOLVED_IMPORT" &&
|
|
15
|
-
["node:async_hooks", "node:util", "consolemock", "#util"].includes(
|
|
16
|
-
log.exporter ?? "",
|
|
17
|
-
)
|
|
18
|
-
) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
defaultHandler(level, log);
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
});
|