Initial Save
This commit is contained in:
26
node_modules/graphql-tools/dist/mergeDeep.js
generated
vendored
Normal file
26
node_modules/graphql-tools/dist/mergeDeep.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function mergeDeep(target, source) {
|
||||
var output = Object.assign({}, target);
|
||||
if (isObject(target) && isObject(source)) {
|
||||
Object.keys(source).forEach(function (key) {
|
||||
var _a, _b;
|
||||
if (isObject(source[key])) {
|
||||
if (!(key in target)) {
|
||||
Object.assign(output, (_a = {}, _a[key] = source[key], _a));
|
||||
}
|
||||
else {
|
||||
output[key] = mergeDeep(target[key], source[key]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Object.assign(output, (_b = {}, _b[key] = source[key], _b));
|
||||
}
|
||||
});
|
||||
}
|
||||
return output;
|
||||
}
|
||||
exports.default = mergeDeep;
|
||||
function isObject(item) {
|
||||
return item && typeof item === 'object' && !Array.isArray(item);
|
||||
}
|
||||
//# sourceMappingURL=mergeDeep.js.map
|
||||
Reference in New Issue
Block a user