Something went wrong. Try again.
fork of prime agent with changes i want but are not upstreamable probqbly (and some fixes)
Something went wrong. Try again.
620 B · 25 lines
TypeScript
at main
1234567891011121314151617181920212223242526export class VersionedRenderCache { private cachedWidth?: number; private cachedVersion?: number; private cachedLines?: string[];
get(width: number, version: number): string[] | undefined { if (this.cachedWidth === width && this.cachedVersion === version) { return this.cachedLines; } return undefined; }
set(width: number, version: number, lines: string[]): string[] { this.cachedWidth = width; this.cachedVersion = version; this.cachedLines = lines; return lines; }
invalidate(): void { this.cachedWidth = undefined; this.cachedVersion = undefined; this.cachedLines = undefined; }}