@toapi/cache 0.3.0 → 0.4.0
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 +1 -1
- package/dist/no-cache.d.ts +0 -13
- package/dist/no-cache.d.ts.map +0 -1
- package/dist/no-cache.js +0 -21
package/package.json
CHANGED
package/dist/no-cache.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Cache, CacheEntry, Subscription } from "./index";
|
|
2
|
-
export declare class NoCache implements Cache {
|
|
3
|
-
subscribers: Set<Subscription>;
|
|
4
|
-
get(_key: string): Promise<CacheEntry | null>;
|
|
5
|
-
set(_: CacheEntry & {
|
|
6
|
-
key: string;
|
|
7
|
-
ttl: number;
|
|
8
|
-
tags: string[];
|
|
9
|
-
}): Promise<void>;
|
|
10
|
-
delete(tags: string[]): Promise<void>;
|
|
11
|
-
subscribe(callback: Subscription): () => void;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=no-cache.d.ts.map
|
package/dist/no-cache.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"no-cache.d.ts","sourceRoot":"","sources":["../src/no-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/D,qBAAa,OAAQ,YAAW,KAAK;IACnC,WAAW,oBAA2B;IAEhC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAInD,GAAG,CACD,CAAC,EAAE,UAAU,GAAG;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,EAAE,CAAC;KAChB,GACA,OAAO,CAAC,IAAI,CAAC;IAIhB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrC,SAAS,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,IAAI;CAO9C"}
|
package/dist/no-cache.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export class NoCache {
|
|
2
|
-
subscribers = new Set();
|
|
3
|
-
async get(_key) {
|
|
4
|
-
return null;
|
|
5
|
-
}
|
|
6
|
-
set(_) {
|
|
7
|
-
return Promise.resolve();
|
|
8
|
-
}
|
|
9
|
-
delete(tags) {
|
|
10
|
-
for (const callback of this.subscribers) {
|
|
11
|
-
callback(tags);
|
|
12
|
-
}
|
|
13
|
-
return Promise.resolve();
|
|
14
|
-
}
|
|
15
|
-
subscribe(callback) {
|
|
16
|
-
this.subscribers.add(callback);
|
|
17
|
-
return () => {
|
|
18
|
-
this.subscribers.delete(callback);
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
}
|