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 / git / hunk-of / hunk-of.ts
17 lines · 453 BRaw
1import type Types from '../types'
2
3/**
4 * One hunk from its header's captured starts and its body lines.
5 *
6 * @param starts the `old` and `new` groups of HUNK_HEADER, when it matched
7 * @param lines the body lines after the header
8 * @returns the hunk
9 */
10export const hunkOf = (
11 starts: Record<string, string> | undefined,
12 lines: readonly string[],
13): Types.Hunk => ({
14 oldStart: Number(starts?.old),
15 newStart: Number(starts?.new),
16 lines,
17})