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 / classify / base-name-of / base-name-of.ts
7 lines · 217 BRaw
1/**
2 * A `/`-separated path's last segment: the file's own name.
3 *
4 * @param path the repository-relative path
5 * @returns the base name
6 */
7export const baseNameOf = (path: string) => path.split('/').at(-1) ?? path