refactor: moved all "utils" to one folder

This commit is contained in:
Hazork 2021-09-11 09:09:50 -03:00
parent ab051fc698
commit 211dd503f4
8 changed files with 5 additions and 5 deletions

View File

@ -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(

View File

@ -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 & {

View File

@ -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) => {

View File

@ -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) => {

View File

@ -1,4 +1,4 @@
import { AxiosCacheInstance, CacheProperties } from '../../axios';
import { AxiosCacheInstance, CacheProperties } from '../axios';
export async function updateCache(
axios: AxiosCacheInstance,