fix: comments to outputs and removed # path alias

This commit is contained in:
Hazork 2021-09-01 16:30:37 -03:00
parent cc6332ff24
commit 4592d180c4
9 changed files with 13 additions and 32 deletions

View File

@ -1,3 +1,2 @@
/dist
/ignore
/node_modules

View File

@ -1,7 +1,7 @@
import { applyRequestInterceptor } from '#/interceptors/request';
import { applyResponseInterceptor } from '#/interceptors/response';
import { MemoryStorage } from '#/storage/memory';
import { defaultKeyGenerator } from '#/utils/key-generator';
import { applyRequestInterceptor } from '../interceptors/request';
import { applyResponseInterceptor } from '../interceptors/response';
import { MemoryStorage } from '../storage/memory';
import { defaultKeyGenerator } from '../utils/key-generator';
import { AxiosInstance } from 'axios';
import { AxiosCacheInstance, CacheInstance, CacheRequestConfig } from './types';

View File

@ -1,4 +1,4 @@
import { CacheStorage } from '#/storage/types';
import { CacheStorage } from '../storage/types';
import type {
AxiosInstance,
AxiosInterceptorManager,

View File

@ -1,9 +1,9 @@
import { AxiosCacheInstance } from '#/axios/types';
import { AxiosCacheInstance } from '../axios/types';
import {
CACHED_RESPONSE_STATUS,
CACHED_RESPONSE_STATUS_TEXT
} from '#/constants';
import { Deferred } from '#/utils/deferred';
} from '../constants';
import { Deferred } from '../utils/deferred';
export function applyRequestInterceptor(axios: AxiosCacheInstance) {
axios.interceptors.request.use(async (config) => {

View File

@ -1,4 +1,4 @@
import { AxiosCacheInstance } from '#/axios/types';
import { AxiosCacheInstance } from '../axios/types';
import { parse } from '@tusbar/cache-control';
export function applyResponseInterceptor(axios: AxiosCacheInstance) {

View File

@ -1,4 +1,4 @@
import { Deferred } from '#/utils/deferred';
import { Deferred } from '../utils/deferred';
export interface CacheStorage {
/**

View File

@ -1,16 +0,0 @@
import axios from 'axios';
import { createCache } from './';
import { SessionCacheStorage } from './storage';
// My own api
const api = axios.create();
const cache = createCache(api, {
// Store values on window.sessionStorage
storage: new SessionCacheStorage(),
// Use the max-age header to determina the cache expiration time
interpretHeader: true
});
cache.get('http://example.com/');

View File

@ -1,4 +1,4 @@
import { CacheRequestConfig } from '#/axios/types';
import { CacheRequestConfig } from '../axios/types';
export function defaultKeyGenerator({
baseURL,

View File

@ -18,7 +18,7 @@
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
"removeComments": true /* Do not emit comments to output. */,
// "removeComments": true /* Do not emit comments to output. */,
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
"downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */,
@ -45,9 +45,7 @@
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
"baseUrl": "./" /* Base directory to resolve non-absolute module names. */,
"paths": {
"#/*": ["./src/*"]
} /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
// "paths": {} /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */