Cleanup
This commit is contained in:
12
node_modules/mongoose/lib/helpers/schema/merge.js
generated
vendored
12
node_modules/mongoose/lib/helpers/schema/merge.js
generated
vendored
@@ -1,7 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function merge(s1, s2) {
|
||||
s1.add(s2.tree || {});
|
||||
module.exports = function merge(s1, s2, skipConflictingPaths) {
|
||||
const paths = Object.keys(s2.tree);
|
||||
const pathsToAdd = {};
|
||||
for (const key of paths) {
|
||||
if (skipConflictingPaths && (s1.paths[key] || s1.nested[key] || s1.singleNestedPaths[key])) {
|
||||
continue;
|
||||
}
|
||||
pathsToAdd[key] = s2.tree[key];
|
||||
}
|
||||
s1.add(pathsToAdd);
|
||||
|
||||
s1.callQueue = s1.callQueue.concat(s2.callQueue);
|
||||
s1.method(s2.methods);
|
||||
|
||||
Reference in New Issue
Block a user