import type { ServerWebSocket } from "bun";
import datasquirel from "@moduletrace/datasquirel";
import { WebSocketData, WebSocketDataType } from "@/src/types";
const EJSON = datasquirel.client.utils.EJSON;

export default function sendData(
    ws: ServerWebSocket<WebSocketData>,
    data: WebSocketDataType,
) {
    ws.send(String(EJSON.stringify(data)));
}
