(version: string)
| 231 | } |
| 232 | |
| 233 | function parseAgentServerVersion(version: string) { |
| 234 | const trimmed = version.trim().replace(/^v/, ""); |
| 235 | const [withoutBuild] = trimmed.split("+"); |
| 236 | const [core, prerelease] = withoutBuild.split("-", 2); |
| 237 | const parts = core.split("."); |
| 238 | |
| 239 | if (parts.length !== 3) { |
| 240 | return null; |
| 241 | } |
| 242 | |
| 243 | const [major, minor, patch] = parts.map((part) => Number(part)); |
| 244 | if ( |
| 245 | ![major, minor, patch].every((part) => Number.isInteger(part) && part >= 0) |
| 246 | ) { |
| 247 | return null; |
| 248 | } |
| 249 | |
| 250 | return { major, minor, patch, prerelease }; |
| 251 | } |
| 252 | |
| 253 | export function assertAgentServerVersionIsSupported( |
| 254 | serverInfo: AgentServerInfo, |
no outgoing calls
no test coverage detected