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

Function parseConventionalSubject

scripts/draft-changelog.ts:258–274  ·  view source on GitHub ↗
(subject: string)

Source from the content-addressed store, hash-verified

256}
257
258export function parseConventionalSubject(subject: string): ParsedSubject {
259 const match = /^([a-z]+)(?:\(([^)]+)\))?(!)?:\s+(.+)$/.exec(subject);
260 if (!match) {
261 return {
262 type: "other",
263 summary: subject,
264 breaking: false,
265 };
266 }
267
268 return {
269 type: match[1],
270 scope: match[2],
271 summary: match[4],
272 breaking: match[3] === "!",
273 };
274}
275
276function extractPrNumber(subject: string) {
277 return /\(#(\d+)\)$/.exec(subject)?.[1];

Callers 1

parseCommitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected