@3846masa/axios-cookiejar-support
Advanced tools
Comparing version 0.4.2 to 0.5.0
@@ -1,11 +0,1 @@ | ||
import { AxiosInstance } from 'axios'; | ||
import { CookieJar } from 'tough-cookie'; | ||
declare module 'axios' { | ||
export interface AxiosRequestConfig { | ||
jar?: CookieJar | boolean; | ||
} | ||
} | ||
declare var axiosCookieJarSupport: (instance: AxiosInstance) => AxiosInstance; | ||
export default axiosCookieJarSupport; | ||
export * from 'axios-cookiejar-support'; |
@@ -1,52 +0,1 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _request = _interopRequireDefault(require("./interceptors/request")); | ||
var _response = _interopRequireDefault(require("./interceptors/response")); | ||
var _symbol = require("./symbol"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function axiosCookieJarSupport(instance) { | ||
// Wrap instance when creating new instance. | ||
if (instance.create) { | ||
const createInstance = instance.create.bind(instance); | ||
instance.create = function create(defaultConfig) { | ||
const newInstance = createInstance(defaultConfig); | ||
return axiosCookieJarSupport(newInstance); | ||
}; | ||
} // Skip if already wrapped | ||
if (instance[_symbol.COOKIEJAR_SUPPORTED]) { | ||
return instance; | ||
} | ||
Object.defineProperty(instance, _symbol.COOKIEJAR_SUPPORTED, { | ||
configurable: false, | ||
enumerable: false, | ||
writable: false, | ||
value: true | ||
}); // Prevent utils.merge for defaults.jar | ||
Object.defineProperty(instance.defaults, 'jar', { | ||
configurable: false, | ||
enumerable: false, | ||
writable: true, | ||
value: instance.defaults.jar | ||
}); // Add interceptors | ||
instance.interceptors.request.use(res => (0, _request.default)(res, instance)); | ||
instance.interceptors.response.use(res => (0, _response.default)(res, instance)); | ||
return instance; | ||
} | ||
var _default = axiosCookieJarSupport; | ||
exports.default = _default; | ||
module.exports = require('axios-cookiejar-support'); |
'use strict'; | ||
function noopEnableCookieJarSupport (instance) { | ||
function noopEnableCookieJarSupport(instance) { | ||
return instance; | ||
@@ -5,0 +5,0 @@ } |
{ | ||
"name": "@3846masa/axios-cookiejar-support", | ||
"description": "Add tough-cookie support to axios.", | ||
"license": "MIT", | ||
"author": "3846masa", | ||
"license": "MIT", | ||
"homepage": "https://github.com/3846masa/axios-cookiejar-support#readme", | ||
@@ -14,18 +14,18 @@ "repository": { | ||
}, | ||
"version": "0.4.2", | ||
"version": "0.5.0", | ||
"main": "./lib/index", | ||
"directories": { | ||
"example": "example", | ||
"test": "test" | ||
"browser": { | ||
"./lib/index": "./noop.js" | ||
}, | ||
"files": [ | ||
"lib", | ||
"index.d.ts", | ||
"noop.js" | ||
], | ||
"scripts": { | ||
"build": "babel lib -x .mjs --out-dir lib", | ||
"clean": "rimraf lib/**/*.js", | ||
"test": "mocha --require intelli-espower-loader" | ||
"test": "echo noop" | ||
}, | ||
"types": "./index.d.ts", | ||
"dependencies": { | ||
"@types/tough-cookie": "^2.3.3", | ||
"is-redirect": "^1.0.0", | ||
"pify": "^4.0.0", | ||
"tough-cookie": "^2.4.3" | ||
"axios-cookiejar-support": "0.5.0" | ||
}, | ||
@@ -35,17 +35,2 @@ "peerDependencies": { | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "7.0.0", | ||
"@babel/core": "7.0.0", | ||
"@babel/plugin-transform-modules-commonjs": "7.0.0", | ||
"axios": "0.18.0", | ||
"cookie": "0.3.1", | ||
"decache": "4.4.0", | ||
"eslint": "5.4.0", | ||
"fast-async": "7.0.6", | ||
"intelli-espower-loader": "1.0.1", | ||
"mocha": "5.2.0", | ||
"nock": "9.6.1", | ||
"power-assert": "1.6.0", | ||
"rimraf": "2.6.2" | ||
}, | ||
"keywords": [ | ||
@@ -57,7 +42,3 @@ "axios", | ||
"tough-cookie" | ||
], | ||
"browser": { | ||
"./lib/index": "./noop.js" | ||
}, | ||
"types": "./index.d.ts" | ||
] | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2
0
1099
4
7
2
0
2
+ Addedaxios-cookiejar-support@0.5.0(transitive)
+ Addedip-regex@2.1.0(transitive)
+ Addedtough-cookie@3.0.1(transitive)
- Removed@types/tough-cookie@^2.3.3
- Removedis-redirect@^1.0.0
- Removedpify@^4.0.0
- Removedtough-cookie@^2.4.3
- Removedtough-cookie@2.5.0(transitive)