Skip to content

Commit

Permalink
chore: update code
Browse files Browse the repository at this point in the history
  • Loading branch information
suhaotian committed Apr 25, 2024
1 parent ec52c05 commit b7ab3d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/xior.ts
Expand Up @@ -26,7 +26,7 @@ export type XiorInstance = xior;

async function getResponseData(
response: Response,
responseType?: 'json' | 'text' | 'stream' | 'document' | 'arraybuffer' | 'blob' | 'original'
responseType?: 'json' | 'text' | 'blob' | 'arraybuffer' | 'stream' | 'document' | 'original'
) {
let data: any;
if (!responseType || !response.ok || ['text', 'json'].includes(responseType)) {
Expand All @@ -38,9 +38,9 @@ async function getResponseData(
} catch (e) {}
}
} else if (responseType === 'blob') {
data = await response.blob();
return response.blob();
} else if (responseType === 'arraybuffer') {
data = await response.arrayBuffer();
return response.arrayBuffer();
}
return data;
}
Expand Down

0 comments on commit b7ab3d3

Please sign in to comment.