import type { MessageFormat } from "../sendrecv.ts"; export function textFormat(): MessageFormat { return { parser: parseText, formatter: formatText, }; } function parseText(data: any): string { if (typeof data !== "string") { throw new Error("Expected message to be a text string"); } return data; } function formatText(message: string): string { return message; }