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 / sections / file-key-of / file-key-of.ts
11 lines · 358 BRaw
1import type { BodyEntry } from '../../entries'
2import Layout from '../../layout'
3
4/**
5 * A file row's Button address: the path made printable, under `file:`.
6 *
7 * @param entry the file, its path as git or the transcript gave it
8 * @returns the key
9 */
10export const fileKeyOf = (entry: Pick<BodyEntry, 'path'>) =>
11 `file:${Layout.sanitizeName(entry.path)}`