From 3909ba3953a0cf5a36cbeb681f357d0c030102f4 Mon Sep 17 00:00:00 2001 From: Kuitos Date: Mon, 29 May 2023 19:32:42 +0800 Subject: [PATCH] fix: remove ts-ignore (#102) --- .gitignore | 1 + src/throttleAdapterEnhancer.ts | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 72b7583..ccc5357 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ node_modules/ dist/ esm/ lib/ +yarn.lock diff --git a/src/throttleAdapterEnhancer.ts b/src/throttleAdapterEnhancer.ts index 48ca435..66396e4 100644 --- a/src/throttleAdapterEnhancer.ts +++ b/src/throttleAdapterEnhancer.ts @@ -4,7 +4,7 @@ * @since 2017-10-11 */ -import { AxiosAdapter, AxiosPromise, AxiosRequestConfig } from 'axios'; +import { AxiosAdapter, AxiosPromise, InternalAxiosRequestConfig } from 'axios'; import LRUCache from 'lru-cache'; import buildSortedURL from './utils/buildSortedURL'; import { ICacheLike } from './utils/isCacheLike'; @@ -21,14 +21,13 @@ export type Options = { export default function throttleAdapterEnhancer(adapter: AxiosAdapter, options: Options = {}): AxiosAdapter { - const { threshold = 1000, cache = new LRUCache({ max: 10 }) } = options; + const { threshold = 1000, cache = new LRUCache({ max: 10 }) } = options; - const recordCacheWithRequest = (index: string, config: AxiosRequestConfig) => { + const recordCacheWithRequest = (index: string, config: InternalAxiosRequestConfig) => { const responsePromise = (async () => { try { - // @ts-ignore const response = await adapter(config); cache.set(index, {