"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimpleResourceStore = void 0;
class SimpleResourceStore {
    constructor() {
        this.data = {};
    }
    get(path) {
        if (!path)
            return undefined;
        const parts = path.split(".");
        let current = this.data;
        for (const part of parts) {
            if (current == null || typeof current !== "object")
                return undefined;
            current = current[part];
        }
        return current;
    }
    set(path, value) {
        if (!path)
            return;
        const parts = path.split(".");
        let current = this.data;
        for (let i = 0; i < parts.length - 1; i += 1) {
            const part = parts[i];
            if (current[part] == null ||
                typeof current[part] !== "object" ||
                Array.isArray(current[part])) {
                current[part] = {};
            }
            current = current[part];
        }
        current[parts[parts.length - 1]] = value;
    }
    has(path) {
        return this.get(path) !== undefined;
    }
}
exports.SimpleResourceStore = SimpleResourceStore;
//# sourceMappingURL=resource-store.js.map