spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / telemetry / hooks / context / vcs-of / distinct / distinct.ts
17 lines · 353 BRaw
1/**
2 * The list with each value once, first occurrence kept, order kept.
3 *
4 * @param values the list
5 * @returns the distinct values
6 */
7export function distinct(values: readonly string[]): string[] {
8 const seen = new Set<string>()
9
10 return values.filter(value => {
11 const isSeen = seen.has(value)
12
13 seen.add(value)
14
15 return !isSeen
16 })
17}