@clickup/ent-framework
Version:
A PostgreSQL graph-database-alike library with microsharding and row-level security
18 lines (13 loc) • 357 B
text/typescript
import QuickLRU from "quick-lru";
export abstract class IDsCache {
private ids = new QuickLRU<string, boolean>({ maxSize: 2000 });
has(id: string): boolean {
return this.ids.has(id);
}
add(id: string, value: boolean = true): void {
this.ids.set(id, value);
}
get(id: string): boolean | undefined {
return this.ids.get(id);
}
}