(version: string)
| 29 | } |
| 30 | |
| 31 | const parseVersionParts = (version: string): readonly number[] | null => { |
| 32 | const core = version.trim().split(/[+-]/, 1)[0]; |
| 33 | if (!core) return null; |
| 34 | const parts = core.split(".").map((part) => Number.parseInt(part, 10)); |
| 35 | return parts.every((part) => Number.isInteger(part) && part >= 0) ? parts : null; |
| 36 | }; |
| 37 | |
| 38 | export const compareUpdateVersions = (left: string, right: string): number | null => { |
| 39 | const leftParts = parseVersionParts(left); |
no outgoing calls
no test coverage detected