2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

Refactored adapters loader; (#5277)

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Dmitriy Mozgovoy
2022-11-22 20:53:56 +02:00
committed by GitHub
parent a3d901777b
commit d032edda08
9 changed files with 89 additions and 59 deletions
+3 -1
View File
@@ -100,8 +100,10 @@ function setProxy(options, configProxy, location) {
};
}
const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process';
/*eslint consistent-return:0*/
export default function httpAdapter(config) {
export default isHttpAdapterSupported && function httpAdapter(config) {
return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
let data = config.data;
const responseType = config.responseType;