renovate/lib/util/cache/run.ts
2020-05-24 07:13:55 +02:00

19 lines
344 B
TypeScript

let repoCache: Record<string, any> | undefined;
export function init(): void {
repoCache = {};
}
export function reset(): void {
repoCache = undefined;
}
export function get<T = any>(key: string): T {
return repoCache?.[key];
}
export function set(key: string, value: any): void {
if (repoCache) {
repoCache[key] = value;
}
}