You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
674 B
26 lines
674 B
export function getXHRResponse(xhr) {
|
|
switch (xhr.responseType) {
|
|
case 'json': {
|
|
if ('response' in xhr) {
|
|
return xhr.response;
|
|
}
|
|
else {
|
|
const ieXHR = xhr;
|
|
return JSON.parse(ieXHR.responseText);
|
|
}
|
|
}
|
|
case 'document':
|
|
return xhr.responseXML;
|
|
case 'text':
|
|
default: {
|
|
if ('response' in xhr) {
|
|
return xhr.response;
|
|
}
|
|
else {
|
|
const ieXHR = xhr;
|
|
return ieXHR.responseText;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//# sourceMappingURL=getXHRResponse.js.map
|