fetch-json-cache 1.3.5 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/dist/cjs/Cache.d.cts +0 -9
- package/dist/cjs/get.d.cts +0 -2
- package/dist/cjs/getSync.d.cts +0 -1
- package/dist/cjs/hash.d.cts +0 -1
- package/dist/cjs/index.d.cts +0 -2
- package/dist/cjs/types.d.cts +0 -13
- package/dist/cjs/update.d.cts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fetch-json-cache",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "Caches fetched json. Updates when etag changes and is uses cache regardless if endpoint unreachable. Uses write-file-atomic for safe updates",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"every",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"./package.json": "./package.json"
|
|
25
25
|
},
|
|
26
26
|
"main": "dist/cjs/index.js",
|
|
27
|
-
"types": "dist/cjs/index.d.
|
|
27
|
+
"types": "dist/cjs/index.d.ts",
|
|
28
28
|
"files": [
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
package/dist/cjs/Cache.d.cts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CacheOptions, ClearCallback, GetCallback, GetOptions } from './types.js';
|
|
2
|
-
export default class Cache {
|
|
3
|
-
cachePath: string;
|
|
4
|
-
options: CacheOptions;
|
|
5
|
-
constructor(cachePath: string, options?: CacheOptions);
|
|
6
|
-
get<T>(endpoint: string, options?: GetOptions | GetCallback<T>, callback?: GetCallback<T>): undefined | Promise<object | null>;
|
|
7
|
-
getSync<T>(endpoint: string): T | null;
|
|
8
|
-
clear(callback?: ClearCallback): undefined | Promise<undefined>;
|
|
9
|
-
}
|
package/dist/cjs/get.d.cts
DELETED
package/dist/cjs/getSync.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function getCacheAsync<T>(endpoint: string): T;
|
package/dist/cjs/hash.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function hash(data: string): string;
|
package/dist/cjs/index.d.cts
DELETED
package/dist/cjs/types.d.cts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface Record<T> {
|
|
2
|
-
headers: object;
|
|
3
|
-
body: T;
|
|
4
|
-
}
|
|
5
|
-
export interface CacheOptions {
|
|
6
|
-
hash?: (string: string) => string;
|
|
7
|
-
}
|
|
8
|
-
export interface GetOptions {
|
|
9
|
-
force?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export type GetCallback<T> = (error?: Error, result?: T) => undefined;
|
|
12
|
-
export type ClearCallback = (error?: Error) => undefined;
|
|
13
|
-
export type UpdateCallback<T> = (error?: Error, result?: T) => undefined;
|
package/dist/cjs/update.d.cts
DELETED