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