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