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 / tests / fixtures / code-blocks-of / parsed-hunks-of.ts
12 lines · 419 BRaw
1import type Views from '../../../hooks/views'
2import { hunksOf } from './hunks-of.js'
3import type { ParsedHunk } from './parsed-hunk.js'
4
5/**
6 * Every hunk a body's `Code` sources hold, in drawing order.
7 *
8 * @param body the file's body as `codeBlocksOf` cut it
9 * @returns the hunks read back out of each source
10 */
11export const parsedHunksOf = (body: Views.CodeBody): ParsedHunk[] =>
12 body.sources.flatMap(hunksOf)