MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / count

Function count

src/utils/array.ts:5–9  ·  view source on GitHub ↗
(arr: readonly T[], pred: (x: T) => unknown)

Source from the content-addressed store, hash-verified

3}
4
5export 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
11export function uniq<T>(xs: Iterable<T>): T[] {
12 return [...new Set(xs)]

Callers 15

array.test.tsFile · 0.90
getProgressStatsFunction · 0.85
calculateAgentStatsFunction · 0.85
bashToolHasPermissionFunction · 0.85
countWorktreeChangesFunction · 0.85
queryLoopFunction · 0.85
runFunction · 0.85
KeybindingSetupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected