import Chunk from "./chunk"; class ChunkCache { private cache = new Map(); get(index: number) { return this.cache.get(index); } set(chunk: Chunk) { this.cache.set(chunk.getIndex(), chunk.getBuffer()); } clear() { this.cache.clear(); } } const chunkCache = new ChunkCache(); export default chunkCache;