INNER CODE UNIT · TypeScript
body
logaretm/villus · packages/batch/src/index.ts:43
const body = `[${operations.map(o => o.body).join(',')}]`;
const fetchOpts = mergeFetchOpts(opContext, { headers: {}, body });
operations = [];
if (!fetch) {
throw new Error('Could not resolve fetch, please provide a fetch function');
}
let response: ParsedResponse<unknown>;
try {
response = await fetch(opContext.url as string, fetchOpts).then(parseResponse);
ctx.response = response;
const resInit: Partial<Response> = {
ok: response.ok,
status: response.status,
statusText: response.statusText,
headers: response.headers,