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 / diff / hooks / views / layout / sanitize-name / sanitize-name.ts
13 lines · 465 BRaw
1import { sanitizeLine } from '../sanitize-line'
2
3/**
4 * A path, preview or message made safe to draw as a name: sanitizeLine's
5 * rule, which already drops every control, format and invisible character.
6 *
7 * Kept as its own word so a name's rule can tighten without touching the
8 * diff body's.
9 *
10 * @param text the name as git, the transcript or an error gave it
11 * @returns the drawable name
12 */
13export const sanitizeName = (text: string) => sanitizeLine(text)