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 / identity / plausible-uuid / plausible-uuid.ts
18 lines · 604 BRaw
1import { UUID_LENGTH_FLOOR } from './uuid-length-floor'
2import { UUID_LENGTH_LIMIT } from './uuid-length-limit'
3
4/**
5 * A value the config holds as an account or organization id, when it is a
6 * string long enough to be one; a number or a trivial string is dropped.
7 *
8 * @param value what the config holds under the key
9 * @returns the id, or undefined
10 */
11export function plausibleUuid(value: unknown): string | undefined {
12 const isPlausible =
13 typeof value === 'string' &&
14 value.length >= UUID_LENGTH_FLOOR &&
15 value.length <= UUID_LENGTH_LIMIT
16
17 return isPlausible ? value : undefined
18}