wishthis/node_modules/rxjs/dist/esm5/internal/ajax/getXHRResponse.js

26 lines
670 B
JavaScript
Raw Normal View History

2022-06-08 10:36:39 +00:00
export function getXHRResponse(xhr) {
switch (xhr.responseType) {
case 'json': {
if ('response' in xhr) {
return xhr.response;
}
else {
var ieXHR = xhr;
return JSON.parse(ieXHR.responseText);
}
}
case 'document':
return xhr.responseXML;
case 'text':
default: {
if ('response' in xhr) {
return xhr.response;
}
else {
var ieXHR = xhr;
return ieXHR.responseText;
}
}
}
}
//# sourceMappingURL=getXHRResponse.js.map