UNPKG

@copilotkit/shared

Version:

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

11 lines (9 loc) 397 B
/** * Safely read a Response/Request body with sensible defaults: * - clones the response/request to avoid consuming the original response/request * - Skips GET/HEAD * - Tries JSON first regardless of content-type * - Falls back to text and optionally parses when it "looks" like JSON */ declare function readBody<T extends Response | Request>(r: T): Promise<unknown>; export { readBody };