const isObject = (item) => item !== null && typeof item === 'object' && !Array.isArray(item);
export const deepMerge = (target, source) => {
    const output = Object.assign({}, target);
    for (const key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
            const sourceValue = source[key];
            const targetValue = target[key];
            if (isObject(sourceValue) && isObject(targetValue)) {
                output[key] = deepMerge(targetValue, sourceValue);
            }
            else {
                output[key] = sourceValue;
            }
        }
    }
    return output;
};
