New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

axios-patch

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-patch - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

index.d.ts

12

index.js

@@ -5,3 +5,3 @@ 'use strict';

const contextKey = 'axiosPatch';
const patchedSym = Symbol(contextKey + 'Patched');
const patchedSym = Symbol('patched');

@@ -11,3 +11,6 @@ function init() {

globalAxios.interceptors.response.use(undefined, err => {
globalAxios.interceptors.response.use(res => {
delete res.config[contextKey];
return res;
}, err => {
let stackFromOrigin = err.config[contextKey] && err.config[contextKey].stack;

@@ -23,2 +26,3 @@ if (stackFromOrigin) {

}
delete err.config[contextKey];
return Promise.reject(err);

@@ -34,3 +38,3 @@ });

const context = globalAxios[contextKey] = { };
const context = axios[contextKey] = { };
if (typeof axios.create === 'function') {

@@ -91,2 +95,4 @@ patchCreate(axios, context);

Object.defineProperty(exports, '__esModule', { value: true });
exports.init = init;
exports.default = { init };
{
"name": "axios-patch",
"version": "0.1.0",
"version": "0.2.0",
"description": "Better usage for axios",

@@ -5,0 +5,0 @@ "license": "MIT",

# axios-patch
- Apply global interceptor to axios.create() automatically.
- Print error stack with called origin.
- Replace stack trace with originally called info.

@@ -6,0 +6,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc