(str: string)
| 504 | } |
| 505 | |
| 506 | export function parseVersion(str: string) { |
| 507 | const m = /^'?v?(\d+(\.\d+)*)/.exec(str); |
| 508 | if (!m) { |
| 509 | return undefined; |
| 510 | } |
| 511 | return m[1].split('.') |
| 512 | .map(i => parseInt(i, 10)); |
| 513 | } |
| 514 | |
| 515 | export function isEarlierVersion(left: number[], right: number[]) { |
| 516 | for (let i = 0, n = Math.max(left.length, right.length); i < n; i++) { |
no test coverage detected