Skip to content

Commit a8f5b98

Browse files
committed
fix(plugins/verbose): replace unknown with any for log payloads
1 parent e32b2e8 commit a8f5b98

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

demo.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Client } from "./mod.ts";
2+
3+
const client = new Client({
4+
nick: "totoche",
5+
verbose: (log) => {
6+
if (log.type === "event") {
7+
if (log.event === "join") {
8+
log.payload;
9+
} else if (log.event === "fdfdfs") {
10+
log.payload;
11+
}
12+
}
13+
},
14+
});
15+
16+
client.connect("irc.libera.chat");
17+
18+
client.on("")

plugins/verbose.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CoreClient } from "../core/client.ts";
1+
// deno-lint-ignore-file no-explicit-any
22
import { type ClientError } from "../core/errors.ts";
33
import { createPlugin } from "../core/plugins.ts";
44
import { type AnyRawCommand } from "../core/protocol.ts";
@@ -12,7 +12,7 @@ interface RawLogPayload {
1212
interface EventLogPayload {
1313
type: "event";
1414
event: string;
15-
payload: unknown;
15+
payload: any;
1616
}
1717

1818
interface CommandLogPayload {
@@ -23,9 +23,9 @@ interface CommandLogPayload {
2323

2424
interface StateLogPayload {
2525
type: "state";
26-
state: CoreClient["state"];
27-
key: keyof CoreClient["state"];
28-
value: unknown;
26+
state: any;
27+
key: string;
28+
value: any;
2929
}
3030

3131
type LogPayload =
@@ -127,7 +127,6 @@ export default createPlugin(
127127
const loggerImpl = getLoggerImpl();
128128
if (!loggerImpl) return;
129129

130-
// deno-lint-ignore no-explicit-any
131130
client.hooks.afterCall("read" as any, (chunks: string | null) => {
132131
loggerImpl({ type: "raw_input", msg: chunks });
133132
});

0 commit comments

Comments
 (0)