wishthis/node_modules/rxjs/dist/esm/internal/ajax/getXHRResponse.js
2022-04-07 09:06:43 +02:00

26 lines
No EOL
674 B
JavaScript

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