"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FIFOCache = void 0;
class FIFOCache {
    constructor(capacity) {
        this.map = new Map();
        this.capacity = capacity;
    }
    set(key, value) {
        if (this.map.size >= this.capacity) {
            // Remove the oldest entry
            const oldestKey = this.map.keys().next().value;
            this.map.delete(oldestKey);
        }
        this.map.set(key, value);
    }
    get(key) {
        return this.map.get(key);
    }
    delete(key) {
        return this.map.delete(key);
    }
    clear() {
        this.map.clear();
    }
    size() {
        return this.map.size;
    }
    entries() {
        return this.map.entries();
    }
}
exports.FIFOCache = FIFOCache;
//# sourceMappingURL=fifoCache.js.map