Skip to content

Commit

Permalink
refactor: moved all "utils" to one folder
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Sep 11, 2021
1 parent ab051fc commit 211dd50
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/axios/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AxiosInstance } from 'axios';
import { applyRequestInterceptor } from '../interceptors/request';
import { applyResponseInterceptor } from '../interceptors/response';
import { MemoryStorage } from '../storage/memory';
import { defaultKeyGenerator } from '../utils/key-generator';
import { defaultKeyGenerator } from '../util/key-generator';
import { AxiosCacheInstance, CacheInstance, CacheProperties } from './types';

export function createCache(
Expand Down
2 changes: 1 addition & 1 deletion src/axios/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
AxiosResponse,
Method
} from 'axios';
import { Deferred } from 'src/utils/deferred';
import { Deferred } from 'src/util/deferred';
import { CachedResponse, CacheStorage } from '../storage/types';

export type DefaultCacheRequestConfig = AxiosRequestConfig & {
Expand Down
2 changes: 1 addition & 1 deletion src/interceptors/request.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CachedResponse } from 'src/storage/types';
import { AxiosCacheInstance } from '../axios/types';
import { CACHED_RESPONSE_STATUS, CACHED_RESPONSE_STATUS_TEXT } from '../constants';
import { Deferred } from '../utils/deferred';
import { Deferred } from '../util/deferred';

export function applyRequestInterceptor(axios: AxiosCacheInstance) {
axios.interceptors.request.use(async (config) => {
Expand Down
2 changes: 1 addition & 1 deletion src/interceptors/response.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AxiosCacheInstance } from '../axios/types';
import { interpretCacheHeader } from './util/interpret-header';
import { updateCache } from './util/update-cache';
import { updateCache } from '../util/update-cache';

export function applyResponseInterceptor(axios: AxiosCacheInstance) {
axios.interceptors.response.use(async (response) => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AxiosCacheInstance, CacheProperties } from '../../axios';
import { AxiosCacheInstance, CacheProperties } from '../axios';

export async function updateCache(
axios: AxiosCacheInstance,
Expand Down

0 comments on commit 211dd50

Please sign in to comment.