(name: string, value: string)
| 22 | const VERSION_REGEX = /^v?[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.\-]+)?(\+[a-zA-Z0-9.\-]+)?$/; |
| 23 | |
| 24 | function validateVersion(name: string, value: string): void { |
| 25 | if (!VERSION_REGEX.test(value)) { |
| 26 | throw new Error( |
| 27 | `Invalid ${name} in package.json: ${JSON.stringify(value)}. Expected a version string.`, |
| 28 | ); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | async function main(): Promise<void> { |
| 33 | const repoRoot = process.cwd(); |