parse-git-patch
Version:
Parse git patches with ease
23 lines (22 loc) • 576 B
TypeScript
export type ParsedPatchModifiedLineType = {
added: boolean;
lineNumber: number;
line: string;
};
export type ParsedPatchFileDataType = {
added: boolean;
deleted: boolean;
beforeName: string;
afterName: string;
modifiedLines: ParsedPatchModifiedLineType[];
};
export type ParsedPatchType = {
hash?: string;
authorName?: string;
authorEmail?: string;
date?: string;
message?: string;
files: ParsedPatchFileDataType[];
};
declare function parseGitPatch(patch: string): ParsedPatchType | null;
export default parseGitPatch;