(items, selector)
| 371 | * @returns {I[]} array of values |
| 372 | */ |
| 373 | const uniqueArray = (items, selector) => { |
| 374 | /** @type {Set<I>} */ |
| 375 | const set = new Set(); |
| 376 | for (const item of items) { |
| 377 | for (const i of selector(item)) { |
| 378 | set.add(i); |
| 379 | } |
| 380 | } |
| 381 | return [...set]; |
| 382 | }; |
| 383 | |
| 384 | /** |
| 385 | * Unique ordered array. |
no test coverage detected