MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / parseCommit

Function parseCommit

scripts/draft-changelog.ts:244–256  ·  view source on GitHub ↗
(commit: RawCommit)

Source from the content-addressed store, hash-verified

242}
243
244export function parseCommit(commit: RawCommit): ParsedCommit {
245 const prNumber = extractPrNumber(commit.subject);
246 const subjectWithoutPr = commit.subject.replace(/\s+\(#\d+\)$/, "");
247 const parsedSubject = parseConventionalSubject(subjectWithoutPr);
248 const category = categorizeCommit(parsedSubject);
249
250 return {
251 ...commit,
252 ...parsedSubject,
253 category,
254 prNumber,
255 };
256}
257
258export function parseConventionalSubject(subject: string): ParsedSubject {
259 const match = /^([a-z]+)(?:\(([^)]+)\))?(!)?:\s+(.+)$/.exec(subject);

Callers 3

getWeeklyCommitsFunction · 0.90
commitFunction · 0.90

Calls 3

extractPrNumberFunction · 0.85
parseConventionalSubjectFunction · 0.85
categorizeCommitFunction · 0.85

Tested by 1

commitFunction · 0.72