(v1: string, v2: string)
| 29 | * } |
| 30 | */ |
| 31 | export function checkVersion(v1: string, v2: string) { |
| 32 | // Convert to proper "x.y.z" format if necessary |
| 33 | if (/^\d+$/.test(v1)) { |
| 34 | v1 += ".0.0"; |
| 35 | } else if (/^\d+\.\d+$/.test(v1)) { |
| 36 | v1 += ".0"; |
| 37 | } |
| 38 | if (/^\d+$/.test(v2)) { |
| 39 | v2 += ".0.0"; |
| 40 | } else if (/^\d+\.\d+$/.test(v2)) { |
| 41 | v2 += ".0"; |
| 42 | } |
| 43 | return compare(v1, v2); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * parse the fragment (hash) from a URL and returns them into |
no test coverage detected