20 lines
527 B
TypeScript
20 lines
527 B
TypeScript
![]() |
import type { ServerWebSocket } from "bun";
|
||
|
import type { WebSocketData } from "@WS/.";
|
||
|
import type { WebSocketDataType } from "@/types";
|
||
|
import datasquirel from "@moduletrace/datasquirel";
|
||
|
const EJSON = datasquirel.client.utils.EJSON;
|
||
|
|
||
|
export default function sendSuccess(
|
||
|
ws: ServerWebSocket<WebSocketData>,
|
||
|
message: String
|
||
|
) {
|
||
|
ws.send(
|
||
|
String(
|
||
|
EJSON.stringify({
|
||
|
event: "server:success",
|
||
|
message: message,
|
||
|
} as WebSocketDataType)
|
||
|
)
|
||
|
);
|
||
|
}
|