mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
18 lines
304 B
TypeScript
18 lines
304 B
TypeScript
export class Cache {
|
|
bucket: Record<string, any> = {};
|
|
|
|
async get(key: string) {
|
|
return this.bucket[key];
|
|
}
|
|
|
|
async set(key: string, value: any, ttl?: number) {
|
|
this.bucket[key] = value;
|
|
}
|
|
|
|
async del(key: string) {
|
|
delete this.bucket[key];
|
|
}
|
|
}
|
|
|
|
export const cache = new Cache();
|