This commit is contained in:
Jonasz Bigda
2023-03-25 21:51:42 +01:00
parent 0db1d5117e
commit b332e9ceb0
1044 changed files with 37502 additions and 63938 deletions

View File

@@ -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);