(a, b)
| 71 | * @returns {T[] & U[]} array |
| 72 | */ |
| 73 | const mergeMaybeArrays = (a, b) => { |
| 74 | /** @type {Set<T | U | null | undefined | string | Set<T> | Set<U>>} */ |
| 75 | const set = new Set(); |
| 76 | if (Array.isArray(a)) for (const item of a) set.add(item); |
| 77 | else set.add(a); |
| 78 | if (Array.isArray(b)) for (const item of b) set.add(item); |
| 79 | else set.add(b); |
| 80 | return /** @type {T[] & U[]} */ ([.../** @type {Set<T | U>} */ (set)]); |
| 81 | }; |
| 82 | |
| 83 | /** |
| 84 | * Merges the provided values into a single result. |
no test coverage detected