fix: types

This commit is contained in:
cha0s 2020-12-05 22:24:56 -06:00
parent bcd0ff26fa
commit 27c892288c

View File

@ -2,7 +2,9 @@ import {createSocketServer} from './lifecycle';
import LatusPacket from './packet';
const badPacketsCheck = (Packets, type) => {
const badPackets = Packets.filter((Packet) => !(Packet instanceof LatusPacket));
const badPackets = Object.fromEntries(
Object.entries(Packets).filter(([, Packet]) => !(Packet instanceof LatusPacket)),
);
if (badPackets.length > 0) {
const badKeys = Object.keys(badPackets);
throw new Error([