(arr: readonly T[], pred: (x: T) => unknown)
| 3 | } |
| 4 | |
| 5 | export function count<T>(arr: readonly T[], pred: (x: T) => unknown): number { |
| 6 | let n = 0 |
| 7 | for (const x of arr) n += +!!pred(x) |
| 8 | return n |
| 9 | } |
| 10 | |
| 11 | export function uniq<T>(xs: Iterable<T>): T[] { |
| 12 | return [...new Set(xs)] |
no outgoing calls
no test coverage detected