(version: string)
| 271 | } |
| 272 | |
| 273 | function parseAgentServerVersion(version: string) { |
| 274 | const trimmed = version.trim().replace(/^v/, ""); |
| 275 | const [withoutBuild] = trimmed.split("+"); |
| 276 | const [core, prerelease] = withoutBuild.split("-", 2); |
| 277 | const parts = core.split("."); |
| 278 | |
| 279 | if (parts.length !== 3) { |
| 280 | return null; |
| 281 | } |
| 282 | |
| 283 | const [major, minor, patch] = parts.map((part) => Number(part)); |
| 284 | if ( |
| 285 | ![major, minor, patch].every((part) => Number.isInteger(part) && part >= 0) |
| 286 | ) { |
| 287 | return null; |
| 288 | } |
| 289 | |
| 290 | return { major, minor, patch, prerelease }; |
| 291 | } |
| 292 | |
| 293 | export function assertAgentServerVersionIsSupported( |
| 294 | serverInfo: AgentServerInfo, |
no outgoing calls
no test coverage detected