UNPKG

phonic

Version:

[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FPhonic-Co%2Fphonic-node) [![npm shield](htt

18 lines (17 loc) 580 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getBinaryResponse = getBinaryResponse; function getBinaryResponse(response) { const binaryResponse = { get bodyUsed() { return response.bodyUsed; }, stream: () => response.body, arrayBuffer: response.arrayBuffer.bind(response), blob: response.blob.bind(response), }; if ("bytes" in response && typeof response.bytes === "function") { binaryResponse.bytes = response.bytes.bind(response); } return binaryResponse; }