You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-simple-networking

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-simple-networking - npm Package Compare versions

Comparing version

to
1.0.21

34

lib/createAxiosClient.js

@@ -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 @@