MCPcopy Create free account
hub / github.com/conventional-changelog/commitlint / widenHeaderPatterns

Function widenHeaderPatterns

@commitlint/parse/src/index.ts:44–55  ·  view source on GitHub ↗
(opts: T)

Source from the content-addressed store, hash-verified

42}
43
44function widenHeaderPatterns<T extends Record<string, any>>(opts: T): T | null {
45 const widened: Record<string, any> = { ...opts };
46 let changed = false;
47 for (const key of ["headerPattern", "breakingHeaderPattern"]) {
48 const pattern = widenTypeCapture(opts[key]);
49 if (pattern !== opts[key]) {
50 widened[key] = pattern;
51 changed = true;
52 }
53 }
54 return changed ? (widened as T) : null;
55}
56
57export async function parse(
58 message: string,

Callers 1

parseFunction · 0.85

Calls 1

widenTypeCaptureFunction · 0.85

Tested by

no test coverage detected