Something went wrong. Try again.
source dump of claude code forked from oppi.li/claude-code
Something went wrong. Try again.
364 B · 13 lines
TypeScript
at main
1234567891011121314export function intersperse<A>(as: A[], separator: (index: number) => A): A[] { return as.flatMap((a, i) => (i ? [separator(i), a] : [a]))}
export function count<T>(arr: readonly T[], pred: (x: T) => unknown): number { let n = 0 for (const x of arr) n += +!!pred(x) return n}
export function uniq<T>(xs: Iterable<T>): T[] { return [...new Set(xs)]}