🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

axios-cache-interceptor

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-cache-interceptor - npm Package Compare versions

Comparing version

to
0.2.6

11

dist/axios/cache.d.ts

@@ -14,7 +14,10 @@ import { AxiosInstance, AxiosRequestConfig } from 'axios';

*
* @param config The config for the caching interceptors
* @param axiosConfig The config for the created axios instance
* @returns The same instance but with caching enabled
* @param config The config for the caching interceptors and the axios instance
* @returns A new AxiosCacheInstance with caching enabled
*/
export declare function createCache(config?: Partial<CacheInstance> & Partial<CacheProperties>, axiosConfig?: AxiosRequestConfig): AxiosCacheInstance;
export declare function createCache({ axios, cache }?: CreateCacheOptions): AxiosCacheInstance;
export declare type CreateCacheOptions = {
axios?: Partial<AxiosRequestConfig>;
cache?: Partial<CacheInstance> & Partial<CacheProperties>;
};
//# sourceMappingURL=cache.d.ts.map

@@ -53,10 +53,9 @@ "use strict";

*
* @param config The config for the caching interceptors
* @param axiosConfig The config for the created axios instance
* @returns The same instance but with caching enabled
* @param config The config for the caching interceptors and the axios instance
* @returns A new AxiosCacheInstance with caching enabled
*/
function createCache(config = {}, axiosConfig = {}) {
return applyCache(axios_1.default.create(axiosConfig), config);
function createCache({ axios = {}, cache = {} } = {}) {
return applyCache(axios_1.default.create(axios), cache);
}
exports.createCache = createCache;
//# sourceMappingURL=cache.js.map
{
"name": "axios-cache-interceptor",
"version": "0.2.5",
"version": "0.2.6",
"description": "Cache interceptor for axios",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -64,11 +64,15 @@ import Axios, { AxiosInstance, AxiosRequestConfig } from 'axios';

*
* @param config The config for the caching interceptors
* @param axiosConfig The config for the created axios instance
* @returns The same instance but with caching enabled
* @param config The config for the caching interceptors and the axios instance
* @returns A new AxiosCacheInstance with caching enabled
*/
export function createCache(
config: Partial<CacheInstance> & Partial<CacheProperties> = {},
axiosConfig: AxiosRequestConfig = {}
): AxiosCacheInstance {
return applyCache(Axios.create(axiosConfig), config);
export function createCache({
axios = {},
cache = {}
}: CreateCacheOptions = {}): AxiosCacheInstance {
return applyCache(Axios.create(axios), cache);
}
export type CreateCacheOptions = {
axios?: Partial<AxiosRequestConfig>;
cache?: Partial<CacheInstance> & Partial<CacheProperties>;
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet