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

30 lines
No EOL
814 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getXHRResponse = void 0;
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;
}
}
}
}
exports.getXHRResponse = getXHRResponse;
//# sourceMappingURL=getXHRResponse.js.map