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
604 B
Raw Blame
import { UUID_LENGTH_FLOOR } from './uuid-length-floor'
import { UUID_LENGTH_LIMIT } from './uuid-length-limit'

/**
 * A value the config holds as an account or organization id, when it is a
 * string long enough to be one; a number or a trivial string is dropped.
 *
 * @param value what the config holds under the key
 * @returns the id, or undefined
 */
export function plausibleUuid(value: unknown): string | undefined {
  const isPlausible =
    typeof value === 'string' &&
    value.length >= UUID_LENGTH_FLOOR &&
    value.length <= UUID_LENGTH_LIMIT

  return isPlausible ? value : undefined
}