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

Function intersperse

src/utils/array.ts:1–3  ·  view source on GitHub ↗
(as: A[], separator: (index: number) => A)

Source from the content-addressed store, hash-verified

1export function intersperse<A>(as: A[], separator: (index: number) => A): A[] {
2 return as.flatMap((a, i) => (i ? [separator(i), a] : [a]))
3}
4
5export function count<T>(arr: readonly T[], pred: (x: T) => unknown): number {
6 let n = 0

Callers 5

array.test.tsFile · 0.90
StructuredDiffListFunction · 0.85
FileWriteToolDiffFunction · 0.85
BackgroundTasksDialogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected