@ztimson/utils 0.23.22 → 0.24.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/cache.d.ts +0 -9
- package/dist/index.cjs +286 -272
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +192 -178
- package/dist/index.mjs.map +1 -1
- package/dist/jwt.d.ts +1 -1
- package/dist/search.d.ts +1 -0
- package/package.json +1 -1
package/dist/cache.d.ts
CHANGED
|
@@ -19,7 +19,6 @@ export declare class Cache<K extends string | number | symbol, T> {
|
|
|
19
19
|
complete: boolean;
|
|
20
20
|
/**
|
|
21
21
|
* Create new cache
|
|
22
|
-
*
|
|
23
22
|
* @param {keyof T} key Default property to use as primary key
|
|
24
23
|
* @param options
|
|
25
24
|
*/
|
|
@@ -27,13 +26,11 @@ export declare class Cache<K extends string | number | symbol, T> {
|
|
|
27
26
|
private getKey;
|
|
28
27
|
/**
|
|
29
28
|
* Get all cached items
|
|
30
|
-
*
|
|
31
29
|
* @return {T[]} Array of items
|
|
32
30
|
*/
|
|
33
31
|
all(): T[];
|
|
34
32
|
/**
|
|
35
33
|
* Add a new item to the cache. Like set, but finds key automatically
|
|
36
|
-
*
|
|
37
34
|
* @param {T} value Item to add to cache
|
|
38
35
|
* @param {number | undefined} ttl Override default expiry
|
|
39
36
|
* @return {this}
|
|
@@ -41,7 +38,6 @@ export declare class Cache<K extends string | number | symbol, T> {
|
|
|
41
38
|
add(value: T, ttl?: any): this;
|
|
42
39
|
/**
|
|
43
40
|
* Add several rows to the cache
|
|
44
|
-
*
|
|
45
41
|
* @param {T[]} rows Several items that will be cached using the default key
|
|
46
42
|
* @param complete Mark cache as complete & reliable, defaults to true
|
|
47
43
|
* @return {this}
|
|
@@ -53,7 +49,6 @@ export declare class Cache<K extends string | number | symbol, T> {
|
|
|
53
49
|
clear(): void;
|
|
54
50
|
/**
|
|
55
51
|
* Delete an item from the cache
|
|
56
|
-
*
|
|
57
52
|
* @param {K} key Item's primary key
|
|
58
53
|
*/
|
|
59
54
|
delete(key: K): void;
|
|
@@ -70,19 +65,16 @@ export declare class Cache<K extends string | number | symbol, T> {
|
|
|
70
65
|
get(key: K): T;
|
|
71
66
|
/**
|
|
72
67
|
* Get a list of cached keys
|
|
73
|
-
*
|
|
74
68
|
* @return {K[]} Array of keys
|
|
75
69
|
*/
|
|
76
70
|
keys(): K[];
|
|
77
71
|
/**
|
|
78
72
|
* Get map of cached items
|
|
79
|
-
*
|
|
80
73
|
* @return {Record<K, T>}
|
|
81
74
|
*/
|
|
82
75
|
map(): Record<K, T>;
|
|
83
76
|
/**
|
|
84
77
|
* Add an item to the cache manually specifying the key
|
|
85
|
-
*
|
|
86
78
|
* @param {K} key Key item will be cached under
|
|
87
79
|
* @param {T} value Item to cache
|
|
88
80
|
* @param {number | undefined} ttl Override default expiry in seconds
|
|
@@ -91,7 +83,6 @@ export declare class Cache<K extends string | number | symbol, T> {
|
|
|
91
83
|
set(key: K, value: T, ttl?: number | undefined): this;
|
|
92
84
|
/**
|
|
93
85
|
* Get all cached items
|
|
94
|
-
*
|
|
95
86
|
* @return {T[]} Array of items
|
|
96
87
|
*/
|
|
97
88
|
values: T[];
|