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.60

18

lib/networking/createAxiosClient.js

@@ -140,3 +140,3 @@ "use strict";

async function logAxiosError(error) {
var _a, _b, _c, _d;
var _a, _b, _c, _d, _e;
if (!axios_1.default.isAxiosError(error)) {

@@ -160,7 +160,13 @@ console.log("Non axios error: ");

report.request.data = shortenData(error.config.data);
report.response = {
data: JSON.parse(shortenData(typeof ((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) == 'string' ? JSON.parse(error.response.data) : (_b = error.response) === null || _b === void 0 ? void 0 : _b.data)),
headers: (_c = error.response) === null || _c === void 0 ? void 0 : _c.headers,
code: (_d = error.response) === null || _d === void 0 ? void 0 : _d.status
};
try {
report.response = {
data: JSON.parse(shortenData(typeof ((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) == 'string' ? JSON.parse(error.response.data) : (_b = error.response) === null || _b === void 0 ? void 0 : _b.data)),
headers: (_c = error.response) === null || _c === void 0 ? void 0 : _c.headers,
code: (_d = error.response) === null || _d === void 0 ? void 0 : _d.status
};
}
catch (e) {
console.log("Networking Error Handler - Couldn't parse json for response report, raw data is ");
console.log((_e = error.response) === null || _e === void 0 ? void 0 : _e.data);
}
// For easier copy / pasting

@@ -167,0 +173,0 @@ console.log("Axios Error Report:");

{
"name": "react-native-simple-networking",
"version": "1.0.59",
"version": "1.0.60",
"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",

@@ -181,7 +181,13 @@ import axios, { AxiosError, AxiosRequestConfig } from "axios";

report.request.data = shortenData(error.config.data);
report.response = {
data: JSON.parse(shortenData(typeof error.response?.data=='string'?JSON.parse(error.response.data):error.response?.data)),
headers: error.response?.headers,
code: error.response?.status
try {
report.response = {
data: JSON.parse(shortenData(typeof error.response?.data=='string'?JSON.parse(error.response.data):error.response?.data)),
headers: error.response?.headers,
code: error.response?.status
}
} catch (e) {
console.log("Networking Error Handler - Couldn't parse json for response report, raw data is ")
console.log(error.response?.data)
}
// For easier copy / pasting

@@ -188,0 +194,0 @@ console.log("Axios Error Report:")