Cache the blobs generated by scripts

This commit is contained in:
theit8514
2021-12-12 19:39:53 -05:00
parent ed86577d6c
commit 8f77f720e6
9 changed files with 136 additions and 20 deletions
+14
View File
@@ -0,0 +1,14 @@
import { ScriptUrl } from "../Script/ScriptUrl";
const importCache: { [hash: string]: ScriptUrl[] } = {};
export class ImportCache {
static get(hash: string) {
return importCache[hash];
}
static store(hash: string, value: ScriptUrl[]): void {
if (importCache[hash]) return;
importCache[hash] = value;
}
}