mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-30 04:47:03 +02:00
19 lines
429 B
TypeScript
19 lines
429 B
TypeScript
import { ScriptUrl } from "../Script/ScriptUrl";
|
|
|
|
const importCache: { [hash: string]: ScriptUrl[] } = {};
|
|
|
|
export class ImportCache {
|
|
static get(hash: string): ScriptUrl[] | null {
|
|
return importCache[hash] || null;
|
|
}
|
|
|
|
static store(hash: string, value: ScriptUrl[]): void {
|
|
if (importCache[hash]) return;
|
|
importCache[hash] = value;
|
|
}
|
|
|
|
static remove(hash: string): void {
|
|
delete importCache[hash];
|
|
}
|
|
}
|