"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = deepMerge;
exports._deepMerge = _deepMerge;
const isObjNotNull_1 = require("./isObjNotNull");
function deepMerge(a, b) {
    const _ = Array.isArray(a) ? [...a] : { ...a };
    _deepMerge(_, b);
    return _;
}
function _deepMerge(a, b) {
    for (let k in b) {
        if (a[k] !== undefined && b[k] !== undefined) {
            const aObjNotNull = (0, isObjNotNull_1.isObjNotNull)(a[k]);
            const bObjNotNull = (0, isObjNotNull_1.isObjNotNull)(b[k]);
            if (aObjNotNull && bObjNotNull) {
                a[k] = deepMerge(a[k], b[k]);
            }
            else {
                a[k] = b[k];
            }
        }
        else {
            a[k] = b[k];
        }
    }
}
//# sourceMappingURL=f.js.map