axios-cache-interceptor
Advanced tools
Comparing version 0.2.6 to 0.2.7
import { AxiosInstance, AxiosRequestConfig } from 'axios'; | ||
import CacheInstance, { AxiosCacheInstance, CacheProperties } from './types'; | ||
import type { AxiosCacheInstance, CacheInstance, CacheProperties } from './types'; | ||
/** | ||
@@ -10,3 +10,3 @@ * Apply the caching interceptors for a already created axios instance. | ||
*/ | ||
export declare function applyCache(axios: AxiosInstance, { storage, generateKey, waiting, headerInterpreter, requestInterceptor, responseInterceptor, ...cacheOptions }?: Partial<CacheInstance> & Partial<CacheProperties>): AxiosCacheInstance; | ||
export declare function applyCache(axios: AxiosInstance, { storage, generateKey, waiting, headerInterpreter, requestInterceptor, responseInterceptor, ...cacheOptions }?: CreateCacheOptions['cache']): AxiosCacheInstance; | ||
/** | ||
@@ -13,0 +13,0 @@ * Returns a new axios instance with caching enabled. |
@@ -45,4 +45,4 @@ "use strict"; | ||
// Apply interceptors | ||
axiosCache.requestInterceptor.apply(); | ||
axiosCache.responseInterceptor.apply(); | ||
axiosCache.requestInterceptor.use(); | ||
axiosCache.responseInterceptor.use(); | ||
return axiosCache; | ||
@@ -57,3 +57,3 @@ } | ||
*/ | ||
function createCache({ axios = {}, cache = {} } = {}) { | ||
function createCache({ axios, cache } = {}) { | ||
return applyCache(axios_1.default.create(axios), cache); | ||
@@ -60,0 +60,0 @@ } |
import type { AxiosInstance, AxiosInterceptorManager, AxiosPromise, AxiosRequestConfig, AxiosResponse, Method } from 'axios'; | ||
import { HeaderInterpreter } from '../header/types'; | ||
import { AxiosInterceptor } from '../interceptors/types'; | ||
import { CachedResponse, CachedStorageValue, CacheStorage, EmptyStorageValue } from '../storage/types'; | ||
import { Deferred } from '../util/deferred'; | ||
import { CachePredicate, KeyGenerator } from '../util/types'; | ||
import type { HeaderInterpreter } from '../header/types'; | ||
import type { AxiosInterceptor } from '../interceptors/types'; | ||
import type { CachedResponse, CachedStorageValue, CacheStorage, EmptyStorageValue } from '../storage/types'; | ||
import type { Deferred } from '../util/deferred'; | ||
import type { CachePredicate, KeyGenerator } from '../util/types'; | ||
export declare type CacheUpdater = 'delete' | ((cached: EmptyStorageValue | CachedStorageValue, newData: any) => CachedStorageValue | void); | ||
@@ -85,3 +85,3 @@ export declare type DefaultCacheRequestConfig = AxiosRequestConfig & { | ||
}; | ||
export default interface CacheInstance { | ||
export interface CacheInstance { | ||
/** | ||
@@ -88,0 +88,0 @@ * The storage to save the cache data. |
@@ -1,3 +0,3 @@ | ||
import { HeaderInterpreter } from './types'; | ||
import type { HeaderInterpreter } from './types'; | ||
export declare const defaultHeaderInterpreter: HeaderInterpreter; | ||
//# sourceMappingURL=interpreter.d.ts.map |
@@ -1,9 +0,9 @@ | ||
import { AxiosCacheInstance, CacheRequestConfig } from '../axios/types'; | ||
import { AxiosInterceptor } from './types'; | ||
import type { AxiosCacheInstance, CacheRequestConfig } from '../axios/types'; | ||
import type { AxiosInterceptor } from './types'; | ||
export declare class CacheRequestInterceptor implements AxiosInterceptor<CacheRequestConfig> { | ||
readonly axios: AxiosCacheInstance; | ||
constructor(axios: AxiosCacheInstance); | ||
apply: () => void; | ||
use: () => void; | ||
onFulfilled: (config: CacheRequestConfig) => Promise<CacheRequestConfig>; | ||
} | ||
//# sourceMappingURL=request.d.ts.map |
@@ -11,3 +11,3 @@ "use strict"; | ||
} | ||
apply = () => { | ||
use = () => { | ||
this.axios.interceptors.request.use(this.onFulfilled); | ||
@@ -42,4 +42,4 @@ }; | ||
/** | ||
* Add a default reject handler to detect when the request is | ||
* aborted without others waiting | ||
* Add a default reject handler to catch when the request is | ||
* aborted without others waiting for it. | ||
*/ | ||
@@ -46,0 +46,0 @@ this.axios.waiting[key]?.catch(() => { }); |
@@ -1,7 +0,7 @@ | ||
import { AxiosCacheInstance, CacheAxiosResponse } from '../axios/types'; | ||
import { AxiosInterceptor } from './types'; | ||
import type { AxiosCacheInstance, CacheAxiosResponse } from '../axios/types'; | ||
import type { AxiosInterceptor } from './types'; | ||
export declare class CacheResponseInterceptor implements AxiosInterceptor<CacheAxiosResponse> { | ||
readonly axios: AxiosCacheInstance; | ||
constructor(axios: AxiosCacheInstance); | ||
apply: () => void; | ||
use: () => void; | ||
private testCachePredicate; | ||
@@ -8,0 +8,0 @@ /** |
@@ -11,3 +11,3 @@ "use strict"; | ||
} | ||
apply = () => { | ||
use = () => { | ||
this.axios.interceptors.response.use(this.onFulfilled); | ||
@@ -14,0 +14,0 @@ }; |
@@ -7,4 +7,4 @@ export interface AxiosInterceptor<T> { | ||
*/ | ||
apply(): void; | ||
use(): void; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { CacheStorage, StorageValue } from './types'; | ||
import type { CacheStorage, StorageValue } from './types'; | ||
export declare class MemoryStorage implements CacheStorage { | ||
@@ -3,0 +3,0 @@ private readonly storage; |
@@ -1,2 +0,2 @@ | ||
import { CacheStorage, StorageValue } from './types'; | ||
import type { CacheStorage, StorageValue } from './types'; | ||
/** | ||
@@ -3,0 +3,0 @@ * A storage that uses any {@link Storage} as his storage. |
@@ -1,4 +0,4 @@ | ||
import { AxiosResponse } from 'axios'; | ||
import { CachePredicateObject } from './types'; | ||
import type { AxiosResponse } from 'axios'; | ||
import type { CachePredicateObject } from './types'; | ||
export declare function checkPredicateObject(response: AxiosResponse, { statusCheck, containsHeaders: containsHeader, responseMatch }: CachePredicateObject): boolean; | ||
//# sourceMappingURL=cache-predicate.d.ts.map |
@@ -20,3 +20,5 @@ "use strict"; | ||
if (containsHeader) { | ||
for (const [headerName, value] of Object.entries(containsHeader)) { | ||
for (const headerName in containsHeader) { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const value = containsHeader[headerName]; | ||
const header = response.headers[headerName]; | ||
@@ -41,6 +43,4 @@ // At any case, if the header is not found, the predicate fails. | ||
} | ||
if (responseMatch) { | ||
if (!responseMatch(response.data)) { | ||
return false; | ||
} | ||
if (responseMatch && !responseMatch(response.data)) { | ||
return false; | ||
} | ||
@@ -47,0 +47,0 @@ return true; |
@@ -1,3 +0,3 @@ | ||
import { KeyGenerator } from './types'; | ||
import type { KeyGenerator } from './types'; | ||
export declare const defaultKeyGenerator: KeyGenerator; | ||
//# sourceMappingURL=key-generator.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { AxiosResponse } from 'axios'; | ||
import { CacheRequestConfig } from '../axios/types'; | ||
import type { AxiosResponse } from 'axios'; | ||
import type { CacheRequestConfig } from '../axios/types'; | ||
export declare type CachePredicate = CachePredicateObject | ((response: AxiosResponse) => boolean); | ||
@@ -4,0 +4,0 @@ export declare type CachePredicateObject = { |
@@ -1,3 +0,3 @@ | ||
import { AxiosCacheInstance, CacheUpdater } from '../axios/types'; | ||
import type { AxiosCacheInstance, CacheUpdater } from '../axios/types'; | ||
export declare function updateCache(axios: AxiosCacheInstance, data: any, entries: Record<string, CacheUpdater>): Promise<void>; | ||
//# sourceMappingURL=update-cache.d.ts.map |
@@ -5,3 +5,5 @@ "use strict"; | ||
async function updateCache(axios, data, entries) { | ||
for (const [cacheKey, value] of Object.entries(entries)) { | ||
for (const cacheKey in entries) { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const value = entries[cacheKey]; | ||
if (value == 'delete') { | ||
@@ -8,0 +10,0 @@ await axios.storage.remove(cacheKey); |
{ | ||
"name": "axios-cache-interceptor", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"description": "Cache interceptor for axios", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -7,3 +7,3 @@ import Axios, { AxiosInstance, AxiosRequestConfig } from 'axios'; | ||
import { defaultKeyGenerator } from '../util/key-generator'; | ||
import CacheInstance, { AxiosCacheInstance, CacheProperties } from './types'; | ||
import type { AxiosCacheInstance, CacheInstance, CacheProperties } from './types'; | ||
@@ -27,3 +27,3 @@ /** | ||
...cacheOptions | ||
}: Partial<CacheInstance> & Partial<CacheProperties> = {} | ||
}: CreateCacheOptions['cache'] = {} | ||
): AxiosCacheInstance { | ||
@@ -57,4 +57,4 @@ const axiosCache = axios as AxiosCacheInstance; | ||
// Apply interceptors | ||
axiosCache.requestInterceptor.apply(); | ||
axiosCache.responseInterceptor.apply(); | ||
axiosCache.requestInterceptor.use(); | ||
axiosCache.responseInterceptor.use(); | ||
@@ -71,4 +71,4 @@ return axiosCache; | ||
export function createCache({ | ||
axios = {}, | ||
cache = {} | ||
axios, | ||
cache | ||
}: CreateCacheOptions = {}): AxiosCacheInstance { | ||
@@ -75,0 +75,0 @@ return applyCache(Axios.create(axios), cache); |
@@ -9,5 +9,5 @@ import type { | ||
} from 'axios'; | ||
import { HeaderInterpreter } from '../header/types'; | ||
import { AxiosInterceptor } from '../interceptors/types'; | ||
import { | ||
import type { HeaderInterpreter } from '../header/types'; | ||
import type { AxiosInterceptor } from '../interceptors/types'; | ||
import type { | ||
CachedResponse, | ||
@@ -18,4 +18,4 @@ CachedStorageValue, | ||
} from '../storage/types'; | ||
import { Deferred } from '../util/deferred'; | ||
import { CachePredicate, KeyGenerator } from '../util/types'; | ||
import type { Deferred } from '../util/deferred'; | ||
import type { CachePredicate, KeyGenerator } from '../util/types'; | ||
@@ -116,3 +116,3 @@ export type CacheUpdater = | ||
export default interface CacheInstance { | ||
export interface CacheInstance { | ||
/** | ||
@@ -119,0 +119,0 @@ * The storage to save the cache data. |
import { parse } from '@tusbar/cache-control'; | ||
import { HeaderInterpreter } from './types'; | ||
import type { HeaderInterpreter } from './types'; | ||
@@ -4,0 +4,0 @@ export const defaultHeaderInterpreter: HeaderInterpreter = (headers) => { |
@@ -1,3 +0,3 @@ | ||
import { AxiosCacheInstance, CacheRequestConfig } from '../axios/types'; | ||
import { | ||
import type { AxiosCacheInstance, CacheRequestConfig } from '../axios/types'; | ||
import type { | ||
CachedResponse, | ||
@@ -9,3 +9,3 @@ CachedStorageValue, | ||
import { CACHED_STATUS_CODE, CACHED_STATUS_TEXT } from '../util/status-codes'; | ||
import { AxiosInterceptor } from './types'; | ||
import type { AxiosInterceptor } from './types'; | ||
@@ -15,3 +15,3 @@ export class CacheRequestInterceptor implements AxiosInterceptor<CacheRequestConfig> { | ||
apply = (): void => { | ||
use = (): void => { | ||
this.axios.interceptors.request.use(this.onFulfilled); | ||
@@ -58,4 +58,4 @@ }; | ||
/** | ||
* Add a default reject handler to detect when the request is | ||
* aborted without others waiting | ||
* Add a default reject handler to catch when the request is | ||
* aborted without others waiting for it. | ||
*/ | ||
@@ -62,0 +62,0 @@ this.axios.waiting[key]?.catch(() => {}); |
@@ -1,3 +0,3 @@ | ||
import { AxiosResponse } from 'axios'; | ||
import { | ||
import type { AxiosResponse } from 'axios'; | ||
import type { | ||
AxiosCacheInstance, | ||
@@ -8,6 +8,6 @@ CacheAxiosResponse, | ||
} from '../axios/types'; | ||
import { CachedStorageValue } from '../storage/types'; | ||
import type { CachedStorageValue } from '../storage/types'; | ||
import { checkPredicateObject } from '../util/cache-predicate'; | ||
import { updateCache } from '../util/update-cache'; | ||
import { AxiosInterceptor } from './types'; | ||
import type { AxiosInterceptor } from './types'; | ||
@@ -19,3 +19,3 @@ type CacheConfig = CacheRequestConfig & { cache?: Partial<CacheProperties> }; | ||
apply = (): void => { | ||
use = (): void => { | ||
this.axios.interceptors.response.use(this.onFulfilled); | ||
@@ -22,0 +22,0 @@ }; |
@@ -8,3 +8,3 @@ export interface AxiosInterceptor<T> { | ||
*/ | ||
apply(): void; | ||
use(): void; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { CacheStorage, StorageValue } from './types'; | ||
import type { CacheStorage, StorageValue } from './types'; | ||
@@ -3,0 +3,0 @@ export class MemoryStorage implements CacheStorage { |
@@ -1,2 +0,2 @@ | ||
import { CacheStorage, StorageValue } from './types'; | ||
import type { CacheStorage, StorageValue } from './types'; | ||
/** | ||
@@ -3,0 +3,0 @@ * A storage that uses any {@link Storage} as his storage. |
@@ -1,3 +0,3 @@ | ||
import { AxiosResponse } from 'axios'; | ||
import { CachePredicateObject } from './types'; | ||
import type { AxiosResponse } from 'axios'; | ||
import type { CachePredicateObject } from './types'; | ||
@@ -25,3 +25,5 @@ export function checkPredicateObject( | ||
if (containsHeader) { | ||
for (const [headerName, value] of Object.entries(containsHeader)) { | ||
for (const headerName in containsHeader) { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const value = containsHeader[headerName]!; | ||
const header = response.headers[headerName]; | ||
@@ -49,6 +51,4 @@ | ||
if (responseMatch) { | ||
if (!responseMatch(response.data)) { | ||
return false; | ||
} | ||
if (responseMatch && !responseMatch(response.data)) { | ||
return false; | ||
} | ||
@@ -55,0 +55,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { KeyGenerator } from './types'; | ||
import type { KeyGenerator } from './types'; | ||
@@ -3,0 +3,0 @@ // Remove first and last '/' char, if present |
@@ -1,3 +0,3 @@ | ||
import { AxiosResponse } from 'axios'; | ||
import { CacheRequestConfig } from '../axios/types'; | ||
import type { AxiosResponse } from 'axios'; | ||
import type { CacheRequestConfig } from '../axios/types'; | ||
@@ -4,0 +4,0 @@ export type CachePredicate = |
@@ -1,2 +0,2 @@ | ||
import { AxiosCacheInstance, CacheUpdater } from '../axios/types'; | ||
import type { AxiosCacheInstance, CacheUpdater } from '../axios/types'; | ||
@@ -8,3 +8,6 @@ export async function updateCache( | ||
): Promise<void> { | ||
for (const [cacheKey, value] of Object.entries(entries)) { | ||
for (const cacheKey in entries) { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const value = entries[cacheKey]!; | ||
if (value == 'delete') { | ||
@@ -11,0 +14,0 @@ await axios.storage.remove(cacheKey); |
@@ -5,69 +5,97 @@ { | ||
/* Basic Options */ | ||
"incremental": true /* Enable incremental compilation */, | ||
"target": "ESNext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, | ||
"module": "CommonJS" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, | ||
// "lib": [], /* Specify library files to be included in the compilation. */ | ||
// "allowJs": true, /* Allow javascript files to be compiled. */ | ||
// "checkJs": true, /* Report errors in .js files. */ | ||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ | ||
"declaration": true /* Generates corresponding '.d.ts' file. */, | ||
"declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, | ||
"sourceMap": true /* Generates corresponding '.map' file. */, | ||
// "outFile": "./", /* Concatenate and emit output to single file. */ | ||
"outDir": "./dist" /* Redirect output structure to the directory. */, | ||
// "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. */, | ||
// "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'. */, | ||
// "isolatedModules": false /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */, | ||
/* Projects */ | ||
"incremental": true, /* Enable incremental compilation */ | ||
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ | ||
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ | ||
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ | ||
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ | ||
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ | ||
/* Strict Type-Checking Options */ | ||
"strict": true /* Enable all strict type-checking options. */, | ||
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, | ||
"strictNullChecks": true /* Enable strict null checks. */, | ||
"strictFunctionTypes": true /* Enable strict checking of function types. */, | ||
"strictBindCallApply": true /* Enable strict 'bind', 'call', and 'apply' methods on functions. */, | ||
"strictPropertyInitialization": true /* Enable strict checking of property initialization in classes. */, | ||
"noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */, | ||
"alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */, | ||
/* Language and Environment */ | ||
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ | ||
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ | ||
// "jsx": "preserve", /* Specify what JSX code is generated. */ | ||
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ | ||
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ | ||
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ | ||
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ | ||
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ | ||
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ | ||
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ | ||
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ | ||
/* Additional Checks */ | ||
"noUnusedLocals": true /* Report errors on unused locals. */, | ||
"noUnusedParameters": true /* Report errors on unused parameters. */, | ||
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */, | ||
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, | ||
"noUncheckedIndexedAccess": true /* Include 'undefined' in index signature results */, | ||
"noPropertyAccessFromIndexSignature": true /* Require undeclared properties from index signatures to use element accesses. */, | ||
/* Modules */ | ||
"module": "CommonJS", /* Specify what module code is generated. */ | ||
// "rootDir": "./", /* Specify the root folder within your source files. */ | ||
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ | ||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ | ||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ | ||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ | ||
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ | ||
// "types": [], /* Specify type package names to be included without being referenced in a source file. */ | ||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ | ||
// "resolveJsonModule": true, /* Enable importing .json files */ | ||
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */ | ||
/* 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": {} /* 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. */ | ||
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ | ||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, | ||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ | ||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ | ||
/* JavaScript Support */ | ||
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ | ||
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ | ||
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ | ||
/* Source Map Options */ | ||
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ | ||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ | ||
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ | ||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ | ||
/* Emit */ | ||
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ | ||
"declarationMap": true, /* Create sourcemaps for d.ts files. */ | ||
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ | ||
"sourceMap": true, /* Create source map files for emitted JavaScript files. */ | ||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ | ||
"outDir": "./dist", /* Specify an output folder for all emitted files. */ | ||
// "removeComments": true, /* Disable emitting comments. */ | ||
// "noEmit": true, /* Disable emitting files from a compilation. */ | ||
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ | ||
"importsNotUsedAsValues": "error", /* Specify emit/checking behavior for imports that are only used for types */ | ||
"downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ | ||
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ | ||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ | ||
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ | ||
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ | ||
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ | ||
"newLine": "lf", /* Set the newline character for emitting files. */ | ||
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ | ||
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ | ||
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ | ||
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ | ||
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */ | ||
/* Experimental Options */ | ||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ | ||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ | ||
/* Interop Constraints */ | ||
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ | ||
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ | ||
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ | ||
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ | ||
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ | ||
/* Advanced Options */ | ||
"skipLibCheck": true /* Skip type checking of declaration files. */, | ||
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ | ||
}, | ||
"include": ["src", "test"] | ||
/* Type Checking */ | ||
"strict": true, /* Enable all strict type-checking options. */ | ||
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ | ||
"strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ | ||
"strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ | ||
"strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ | ||
"strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ | ||
"noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ | ||
"useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ | ||
"alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ | ||
"noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ | ||
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ | ||
"exactOptionalPropertyTypes": false, /* Interpret optional property types as written, rather than adding 'undefined'. */ | ||
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ | ||
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ | ||
"noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ | ||
"noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ | ||
"noPropertyAccessFromIndexSignature": false, /* Enforces using indexed accessors for keys declared using an indexed type */ | ||
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ | ||
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ | ||
/* Completeness */ | ||
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ | ||
"skipLibCheck": true /* Skip type checking all .d.ts files. */ | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
125164
1630