Skip to content

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.

TypeScript
353 B
Raw Blame
/**
 * The list with each value once, first occurrence kept, order kept.
 *
 * @param values the list
 * @returns the distinct values
 */
export function distinct(values: readonly string[]): string[] {
  const seen = new Set<string>()

  return values.filter(value => {
    const isSeen = seen.has(value)

    seen.add(value)

    return !isSeen
  })
}