export function isBunRuntime() {
    return typeof globalThis.Bun !== "undefined";
}
export function withBunCompressionHeaders(headers) {
    if (!isBunRuntime()) {
        return { ...headers };
    }
    return { ...headers, "Accept-Encoding": "gzip, deflate" };
}
export function withBunIdentityEncoding(headers) {
    return { ...headers, "Accept-Encoding": "identity" };
}
export function isBunCompressedResponseError(error) {
    if (!isBunRuntime() || !(error instanceof Error))
        return false;
    const message = error.message;
    return (message.includes("ZlibError") ||
        message.includes("ShortRead") ||
        message.includes("Decompression error"));
}
//# sourceMappingURL=bun.js.map