feat: build

This commit is contained in:
claude-code-best
2026-03-31 19:22:47 +08:00
commit f90eee85d8
1906 changed files with 514339 additions and 0 deletions

13
src/utils/array.ts Normal file
View File

@@ -0,0 +1,13 @@
export 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)]
}