mirror of
https://github.com/SomboChea/ui
synced 2026-01-18 00:56:00 +07:00
fix: added packageMeta type
This commit is contained in:
committed by
Griffithtp
parent
c0b0189cc6
commit
3c54b116c9
@@ -6,9 +6,9 @@ import '../../types';
|
||||
* @param {object} response
|
||||
* @returns {promise}
|
||||
*/
|
||||
function handleResponseType(response): Promise<any> {
|
||||
function handleResponseType(response: Response): Promise<[boolean, Blob | string]> | Promise<void> {
|
||||
if (response.headers) {
|
||||
const contentType = response.headers.get('Content-Type');
|
||||
const contentType = response.headers.get('Content-Type') as string;
|
||||
if (contentType.includes('application/pdf')) {
|
||||
return Promise.all([response.ok, response.blob()]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user