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 / stat-text-of / stat-text-of.ts
15 lines · 416 BRaw
1import { keptOf } from '../../../kept-of'
2
3/**
4 * `+N -M` as diffStat draws it, as plain text: what a row measures to know
5 * where its counts start; empty at 0/0.
6 *
7 * @param added lines added
8 * @param removed lines removed
9 * @returns the text
10 */
11export const statTextOf = (added: number, removed: number) =>
12 keptOf([
13 added > 0 ? `+${added}` : null,
14 removed > 0 ? `-${removed}` : null,
15 ]).join(' ')