"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.weakMerge = void 0;
function weakMerge(a, b) {
    const c = {};
    return new Proxy(c, {
        get(_, p) {
            var _a, _b;
            return (_b = (_a = c[p]) !== null && _a !== void 0 ? _a : b[p]) !== null && _b !== void 0 ? _b : a[p];
        },
        set(_, p, v) {
            c[p] = v;
            return true;
        },
        has(_, p) {
            return p in c || p in b || p in a;
        },
        deleteProperty(target, property) {
            if (c[property] !== undefined) {
                delete c[property];
                return true;
            }
            if (b[property] !== undefined) {
                delete b[property];
                return true;
            }
            if (a[property] !== undefined) {
                delete a[property];
                return true;
            }
            return false;
        },
        ownKeys() {
            return [
                ...new Set([
                    ...Object.getOwnPropertyNames(a),
                    ...Object.getOwnPropertyNames(b),
                    ...Object.getOwnPropertyNames(c),
                ]),
            ];
        },
        getOwnPropertyDescriptor() {
            return {
                enumerable: true,
                configurable: true,
                writable: true,
            };
        },
    });
}
exports.weakMerge = weakMerge;
//# sourceMappingURL=weakMerge.js.map