1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | Object.defineProperty(exports, "__esModule", { value: true });
|
7 | exports.assignRouterSpec = void 0;
|
8 | function assignRouterSpec(target, additions) {
|
9 | if (additions.components) {
|
10 | if (!target.components)
|
11 | target.components = {};
|
12 | for (const key in additions.components) {
|
13 | if (!target.components[key])
|
14 | target.components[key] = {};
|
15 | Object.assign(target.components[key], additions.components[key]);
|
16 | }
|
17 | }
|
18 | for (const url in additions.paths) {
|
19 | if (!(url in target.paths))
|
20 | target.paths[url] = {};
|
21 | for (const verbOrKey in additions.paths[url]) {
|
22 |
|
23 | if (verbOrKey in target.paths[url])
|
24 | continue;
|
25 | target.paths[url][verbOrKey] = additions.paths[url][verbOrKey];
|
26 | }
|
27 | }
|
28 | if (additions.tags && additions.tags.length > 0) {
|
29 | if (!target.tags)
|
30 | target.tags = [];
|
31 | for (const tag of additions.tags) {
|
32 |
|
33 | if (target.tags.some(t => t.name === tag.name))
|
34 | continue;
|
35 | target.tags.push(tag);
|
36 | }
|
37 | }
|
38 | }
|
39 | exports.assignRouterSpec = assignRouterSpec;
|
40 |
|
\ | No newline at end of file |