1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | function mergeDeep(target, source) {
|
4 | var output = Object.assign({}, target);
|
5 | if (isObject(target) && isObject(source)) {
|
6 | Object.keys(source).forEach(function (key) {
|
7 | if (isObject(source[key])) {
|
8 | if (!(key in target)) {
|
9 | Object.assign(output, (_a = {}, _a[key] = source[key], _a));
|
10 | }
|
11 | else {
|
12 | output[key] = mergeDeep(target[key], source[key]);
|
13 | }
|
14 | }
|
15 | else {
|
16 | Object.assign(output, (_b = {}, _b[key] = source[key], _b));
|
17 | }
|
18 | var _a, _b;
|
19 | });
|
20 | }
|
21 | return output;
|
22 | }
|
23 | exports.default = mergeDeep;
|
24 | function isObject(item) {
|
25 | return item && typeof item === 'object' && !Array.isArray(item);
|
26 | }
|
27 |
|
\ | No newline at end of file |