UNPKG

@copilotkit/react-ui

Version:

<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />

34 lines (33 loc) 730 B
import { __async } from "../chunk-MRXNTQOX.mjs"; // src/lib/utils.ts function fetcher(input, init) { return __async(this, null, function* () { const res = yield fetch(input, init); if (!res.ok) { const json = yield res.json(); if (json.error) { const error = new Error(json.error); error.status = res.status; throw error; } else { throw new Error("An unexpected error occurred"); } } return res.json(); }); } function formatDate(input) { const date = new Date(input); return date.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" }); } export { fetcher, formatDate }; //# sourceMappingURL=utils.mjs.map