(opts: T)
| 42 | } |
| 43 | |
| 44 | function 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 | |
| 57 | export async function parse( |
| 58 | message: string, |
no test coverage detected