import type { SocketMessageInterface } from '../interface/socket'; import { WS_MSG_TYPE } from '../interface/socket'; /** 判断哪些消息是 socket 需要处理的 */ export const isSocketMsg = (msg: SocketMessageInterface): boolean => { return ( msg.type === WS_MSG_TYPE.ping || msg.type === WS_MSG_TYPE.pong || msg.type === WS_MSG_TYPE.cmd ); };