"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultedMap = void 0;
class DefaultedMap extends Map {
    constructor(defaultValue) {
        super();
        this.defaultValue = defaultValue;
    }
    get(key) {
        let value = super.get(key);
        if (!value) {
            value = this.defaultValue(key);
            super.set(key, value);
        }
        return value;
    }
}
exports.DefaultedMap = DefaultedMap;
//# sourceMappingURL=DefaultedMap.js.map