import { customAlphabet } from "nanoid"; // 7-character random string export const nanoid = customAlphabet("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 7); export function createChunkDecoder() { const decoder = new TextDecoder(); return function (chunk: Uint8Array | undefined): string { if (!chunk) return ""; return decoder.decode(chunk, { stream: true }); }; }