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
import type Types from '../../types'
/**
* Whether a row is the last file of the whole diff git printed for its
* fetch: the last tracked row, the untracked ones being listed apart.
*
* The built-in reads that diff in one piece and trims its end, so the last
* file alone has no closing empty line to draw (withClosingLine).
*
* @param data the fetch the row belongs to
* @param file the row
* @returns whether git printed this file last
*/
export const isLastOfDiff = (
data: Types.DiffData,
file: Types.FileStat,
): boolean =>
data.files.filter(row => !row.isUntracked).at(-1)?.path === file.path