@naturalcycles/nodejs-lib 15.137.0 → 15.138.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.
|
@@ -15,6 +15,7 @@ export declare class LRUMemoCache<KEY = any, VALUE = any> implements MemoCache<K
|
|
|
15
15
|
has(k: any): boolean;
|
|
16
16
|
get(k: any): any;
|
|
17
17
|
set(k: any, v: any): void;
|
|
18
|
+
delete(k: any): void;
|
|
18
19
|
clear(): void;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
@@ -26,5 +27,6 @@ export declare class LRUAsyncMemoCache<KEY = any, VALUE = any> implements AsyncM
|
|
|
26
27
|
has(k: any): Promise<boolean>;
|
|
27
28
|
get(k: any): Promise<VALUE | typeof MISS>;
|
|
28
29
|
set(k: any, v: any): Promise<void>;
|
|
30
|
+
delete(k: any): Promise<void>;
|
|
29
31
|
clear(): Promise<void>;
|
|
30
32
|
}
|
|
@@ -24,6 +24,9 @@ export class LRUMemoCache {
|
|
|
24
24
|
set(k, v) {
|
|
25
25
|
this.lru.set(k, v);
|
|
26
26
|
}
|
|
27
|
+
delete(k) {
|
|
28
|
+
this.lru.delete(k);
|
|
29
|
+
}
|
|
27
30
|
clear() {
|
|
28
31
|
this.lru.clear();
|
|
29
32
|
}
|
|
@@ -53,6 +56,9 @@ export class LRUAsyncMemoCache {
|
|
|
53
56
|
async set(k, v) {
|
|
54
57
|
this.lru.set(k, v === undefined ? UNDEFINED : v);
|
|
55
58
|
}
|
|
59
|
+
async delete(k) {
|
|
60
|
+
this.lru.delete(k);
|
|
61
|
+
}
|
|
56
62
|
async clear() {
|
|
57
63
|
this.lru.clear();
|
|
58
64
|
}
|
package/package.json
CHANGED
|
@@ -34,6 +34,10 @@ export class LRUMemoCache<KEY = any, VALUE = any> implements MemoCache<KEY, VALU
|
|
|
34
34
|
this.lru.set(k, v)
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
delete(k: any): void {
|
|
38
|
+
this.lru.delete(k)
|
|
39
|
+
}
|
|
40
|
+
|
|
37
41
|
clear(): void {
|
|
38
42
|
this.lru.clear()
|
|
39
43
|
}
|
|
@@ -69,6 +73,10 @@ export class LRUAsyncMemoCache<KEY = any, VALUE = any> implements AsyncMemoCache
|
|
|
69
73
|
this.lru.set(k, v === undefined ? UNDEFINED : v)
|
|
70
74
|
}
|
|
71
75
|
|
|
76
|
+
async delete(k: any): Promise<void> {
|
|
77
|
+
this.lru.delete(k)
|
|
78
|
+
}
|
|
79
|
+
|
|
72
80
|
async clear(): Promise<void> {
|
|
73
81
|
this.lru.clear()
|
|
74
82
|
}
|