* Executes a regular expression with one capture group. * * @param regex A regular expression to execute. * @param text Content to execute the RegEx on. * @returns The captured string if matched; otherwise undefined.
(regex: RegExp, text: string)
| 423 | * @returns The captured string if matched; otherwise undefined. |
| 424 | */ |
| 425 | function matchFirst(regex: RegExp, text: string): string | undefined { |
| 426 | const match = regex.exec(text); |
| 427 | return match ? match[1] : undefined; |
| 428 | } |
| 429 | |
| 430 | /** Loads the macOS operating system context. */ |
| 431 | async function getDarwinInfo(): Promise<OsContext> { |
no test coverage detected