@sebspark/promise-cache 1.0.0 → 1.1.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/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +6 -2
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -28,6 +28,10 @@ declare class Persistor {
|
|
|
28
28
|
set<T>(key: string, { value, timestamp, ttl }: SetParams<T>): Promise<void>;
|
|
29
29
|
delete(key: string): Promise<void>;
|
|
30
30
|
}
|
|
31
|
+
declare const createPersistor: (redis?: {
|
|
32
|
+
url: string;
|
|
33
|
+
password?: string;
|
|
34
|
+
}) => Persistor;
|
|
31
35
|
|
|
32
36
|
declare class PromiseCache<U> {
|
|
33
37
|
persistor: Persistor;
|
|
@@ -87,4 +91,4 @@ declare class LocalStorage {
|
|
|
87
91
|
}
|
|
88
92
|
declare const createLocalMemoryClient: () => LocalStorage;
|
|
89
93
|
|
|
90
|
-
export { LocalStorage, PromiseCache, createLocalMemoryClient };
|
|
94
|
+
export { LocalStorage, Persistor, PromiseCache, createLocalMemoryClient, createPersistor };
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ declare class Persistor {
|
|
|
28
28
|
set<T>(key: string, { value, timestamp, ttl }: SetParams<T>): Promise<void>;
|
|
29
29
|
delete(key: string): Promise<void>;
|
|
30
30
|
}
|
|
31
|
+
declare const createPersistor: (redis?: {
|
|
32
|
+
url: string;
|
|
33
|
+
password?: string;
|
|
34
|
+
}) => Persistor;
|
|
31
35
|
|
|
32
36
|
declare class PromiseCache<U> {
|
|
33
37
|
persistor: Persistor;
|
|
@@ -87,4 +91,4 @@ declare class LocalStorage {
|
|
|
87
91
|
}
|
|
88
92
|
declare const createLocalMemoryClient: () => LocalStorage;
|
|
89
93
|
|
|
90
|
-
export { LocalStorage, PromiseCache, createLocalMemoryClient };
|
|
94
|
+
export { LocalStorage, Persistor, PromiseCache, createLocalMemoryClient, createPersistor };
|
package/dist/index.js
CHANGED
|
@@ -21,8 +21,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
LocalStorage: () => LocalStorage,
|
|
24
|
+
Persistor: () => Persistor,
|
|
24
25
|
PromiseCache: () => PromiseCache,
|
|
25
|
-
createLocalMemoryClient: () => createLocalMemoryClient
|
|
26
|
+
createLocalMemoryClient: () => createLocalMemoryClient,
|
|
27
|
+
createPersistor: () => createPersistor
|
|
26
28
|
});
|
|
27
29
|
module.exports = __toCommonJS(src_exports);
|
|
28
30
|
|
|
@@ -253,6 +255,8 @@ var PromiseCache = class {
|
|
|
253
255
|
// Annotate the CommonJS export names for ESM import in node:
|
|
254
256
|
0 && (module.exports = {
|
|
255
257
|
LocalStorage,
|
|
258
|
+
Persistor,
|
|
256
259
|
PromiseCache,
|
|
257
|
-
createLocalMemoryClient
|
|
260
|
+
createLocalMemoryClient,
|
|
261
|
+
createPersistor
|
|
258
262
|
});
|
package/dist/index.mjs
CHANGED