react-native-simple-networking
Advanced tools
Comparing version
@@ -94,20 +94,18 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const report = {}; | ||
if (config.data) { | ||
try { | ||
report.data = JSON.parse(config.data); | ||
} | ||
catch (_a) { | ||
report.data = config.data; | ||
} | ||
} | ||
; | ||
console.log("Config headers in log report: " + config.headers); | ||
report.headers = config.headers; | ||
report.method = config.method; | ||
report.url = config.url; | ||
if (config.baseURL) | ||
report.baseUrl = config.baseURL; | ||
console.log(name + " Report: "); | ||
console.log(JSON.stringify(report, null, 4)); | ||
// const report: any = {}; | ||
// if (config.data) { | ||
// try { | ||
// report.data = JSON.parse(config.data); | ||
// } catch { | ||
// report.data = config.data | ||
// } | ||
// }; | ||
// console.log("Config headers in log report: " + config.headers) | ||
// report.headers = config.headers; | ||
// report.method = config.method; | ||
// report.url = config.url; | ||
// if(config.baseURL) | ||
// report.baseUrl = config.baseURL; | ||
// console.log(name + " Report: ") | ||
// console.log(JSON.stringify(report, null, 4)) | ||
}); | ||
@@ -114,0 +112,0 @@ } |
{ | ||
"name": "react-native-simple-networking", | ||
"version": "1.0.20", | ||
"version": "1.0.21", | ||
"description": "This is a package that implements authentication state using zustand tied to axios interceptors in order to automatically add an 'authorization' header to all requests any time a request is sent with the created axios client. It also provides some basic request logging. The package will attempt to refresh any time an access token is expired, stalling all requests any time a token refresh is going on. ", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -115,18 +115,18 @@ import axios, { AxiosError, AxiosRequestConfig } from "axios"; | ||
async function logReport(config: AxiosRequestConfig, name: string,) { | ||
const report: any = {}; | ||
if (config.data) { | ||
try { | ||
report.data = JSON.parse(config.data); | ||
} catch { | ||
report.data = config.data | ||
} | ||
}; | ||
console.log("Config headers in log report: " + config.headers) | ||
report.headers = config.headers; | ||
report.method = config.method; | ||
report.url = config.url; | ||
if(config.baseURL) | ||
report.baseUrl = config.baseURL; | ||
console.log(name + " Report: ") | ||
console.log(JSON.stringify(report, null, 4)) | ||
// const report: any = {}; | ||
// if (config.data) { | ||
// try { | ||
// report.data = JSON.parse(config.data); | ||
// } catch { | ||
// report.data = config.data | ||
// } | ||
// }; | ||
// console.log("Config headers in log report: " + config.headers) | ||
// report.headers = config.headers; | ||
// report.method = config.method; | ||
// report.url = config.url; | ||
// if(config.baseURL) | ||
// report.baseUrl = config.baseURL; | ||
// console.log(name + " Report: ") | ||
// console.log(JSON.stringify(report, null, 4)) | ||
} | ||
@@ -133,0 +133,0 @@ |
23107
0.27%544
-0.37%