Skip to content

Commit 7d25f7c

Browse files
committed
Fix args.type check for isMessage.
Fix logical bug in type guard.
1 parent 4345123 commit 7d25f7c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sources/common/packet.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ export function isMessage<C extends code|undefined=undefined,T extends type|unde
254254
if(argsType !== undefined && typeof (data as Message<"DEEP_LINK",string>).args.params === "object")
255255
switch(argsType) {
256256
case "CHANNEL":
257-
if(!checkRecord(
257+
if(!(checkRecord(
258258
(data as Message<"DEEP_LINK",string>).args.params,
259259
["guildId", "channelId", "search", "fingerprint"] as const,
260260
"string"
261-
) || (data as Message<"DEEP_LINK","CHANNEL">).args.params.channelId !== undefined)
261+
) || (data as Message<"DEEP_LINK","CHANNEL">).args.params.channelId === undefined))
262262
return false;
263263
}
264-
264+
265265
// All is "good enough"
266266
return true;
267267
}

0 commit comments

Comments
 (0)