Skip to content

Commit

Permalink
fix: remove ts-ignore (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos committed May 29, 2023
1 parent f023497 commit 3909ba3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ node_modules/
dist/
esm/
lib/
yarn.lock
7 changes: 3 additions & 4 deletions src/throttleAdapterEnhancer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -21,14 +21,13 @@ export type Options = {

export default function throttleAdapterEnhancer(adapter: AxiosAdapter, options: Options = {}): AxiosAdapter {

const { threshold = 1000, cache = new LRUCache<string, RecordedCache>({ max: 10 }) } = options;
const { threshold = 1000, cache = new LRUCache<string, RecordedCache>({ 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, {
Expand Down

0 comments on commit 3909ba3

Please sign in to comment.