cacheable 1.6.0 → 1.6.1
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/README.md +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -212,6 +212,7 @@ By default we use lazy expiration deletion which means on `get` and `getMany` ty
|
|
|
212
212
|
* `clear()`: Clears the cache.
|
|
213
213
|
* `size()`: The number of keys in the cache.
|
|
214
214
|
* `keys()`: The keys in the cache.
|
|
215
|
+
* `items()`: The items in the cache as `{ key, value, expiration }`.
|
|
215
216
|
* `checkExpired()`: Checks for expired keys in the cache. This is used by the `checkInterval` property.
|
|
216
217
|
* `startIntervalCheck()`: Starts the interval check for expired keys if `checkInterval` is above 0 ms.
|
|
217
218
|
* `stopIntervalCheck()`: Stops the interval check for expired keys.
|
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -52,6 +52,11 @@ type CacheableMemoryOptions = {
|
|
|
52
52
|
lruSize?: number;
|
|
53
53
|
checkInterval?: number;
|
|
54
54
|
};
|
|
55
|
+
type CacheableItem$1 = {
|
|
56
|
+
key: string;
|
|
57
|
+
value: any;
|
|
58
|
+
expires?: number;
|
|
59
|
+
};
|
|
55
60
|
declare class CacheableMemory {
|
|
56
61
|
private readonly _hashCache;
|
|
57
62
|
private readonly _hash0;
|
|
@@ -81,6 +86,7 @@ declare class CacheableMemory {
|
|
|
81
86
|
set checkInterval(value: number);
|
|
82
87
|
get size(): number;
|
|
83
88
|
get keys(): IterableIterator<string>;
|
|
89
|
+
get items(): IterableIterator<CacheableItem$1>;
|
|
84
90
|
get<T>(key: string): any;
|
|
85
91
|
set(key: string, value: any, ttl?: number): void;
|
|
86
92
|
has(key: string): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -52,6 +52,11 @@ type CacheableMemoryOptions = {
|
|
|
52
52
|
lruSize?: number;
|
|
53
53
|
checkInterval?: number;
|
|
54
54
|
};
|
|
55
|
+
type CacheableItem$1 = {
|
|
56
|
+
key: string;
|
|
57
|
+
value: any;
|
|
58
|
+
expires?: number;
|
|
59
|
+
};
|
|
55
60
|
declare class CacheableMemory {
|
|
56
61
|
private readonly _hashCache;
|
|
57
62
|
private readonly _hash0;
|
|
@@ -81,6 +86,7 @@ declare class CacheableMemory {
|
|
|
81
86
|
set checkInterval(value: number);
|
|
82
87
|
get size(): number;
|
|
83
88
|
get keys(): IterableIterator<string>;
|
|
89
|
+
get items(): IterableIterator<CacheableItem$1>;
|
|
84
90
|
get<T>(key: string): any;
|
|
85
91
|
set(key: string, value: any, ttl?: number): void;
|
|
86
92
|
has(key: string): boolean;
|
package/dist/index.js
CHANGED