@e280/quay
Version:
File-browser and outliner UI for the web
22 lines • 580 B
JavaScript
import { MapG } from "@e280/stz";
export class MemoryForklift {
#map = new MapG();
async *list() {
for (const label of this.#map.keys())
yield label;
}
async has(label) {
return this.#map.has(label);
}
async save(label, file) {
const bytes = new Uint8Array(await file.arrayBuffer());
this.#map.set(label, bytes);
}
async load(label) {
return new Blob([this.#map.require(label)]);
}
async delete(label) {
this.#map.delete(label);
}
}
//# sourceMappingURL=memory-forklift.js.map