Skip to content

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.

TypeScript
362 B
Raw Blame
import type Git from '../../../git'
import { hunkHeaderOf } from '../hunk-header-of'

/**
 * A hunk as unified-diff text: its header (hunkHeaderOf), then its lines.
 *
 * @param hunk the hunk, its lines body lines only
 * @returns the text, no trailing newline
 */
export const hunkSourceOf = (hunk: Git.Hunk) =>
  [hunkHeaderOf(hunk), ...hunk.lines].join('\n')