(a, b)
| 284 | * @returns {RuntimeSpec} merged |
| 285 | */ |
| 286 | const mergeRuntimeOwned = (a, b) => { |
| 287 | if (b === undefined) { |
| 288 | return a; |
| 289 | } else if (a === b) { |
| 290 | return a; |
| 291 | } else if (a === undefined) { |
| 292 | if (typeof b === "string") { |
| 293 | return b; |
| 294 | } |
| 295 | /** @type {RuntimeSpecSortableSet} */ |
| 296 | return new SortableSet(b); |
| 297 | } else if (typeof a === "string") { |
| 298 | if (typeof b === "string") { |
| 299 | /** @type {RuntimeSpecSortableSet} */ |
| 300 | const set = new SortableSet(); |
| 301 | set.add(a); |
| 302 | set.add(b); |
| 303 | return set; |
| 304 | } |
| 305 | /** @type {RuntimeSpecSortableSet} */ |
| 306 | const set = new SortableSet(b); |
| 307 | set.add(a); |
| 308 | return set; |
| 309 | } |
| 310 | if (typeof b === "string") { |
| 311 | a.add(b); |
| 312 | return a; |
| 313 | } |
| 314 | for (const item of b) a.add(item); |
| 315 | return a; |
| 316 | }; |
| 317 | |
| 318 | /** |
| 319 | * Returns merged. |
no test coverage detected