( configVersion: string, minimalVersion: string )
| 70 | } |
| 71 | |
| 72 | export function isLower( |
| 73 | configVersion: string, |
| 74 | minimalVersion: string |
| 75 | ): boolean { |
| 76 | if (configVersion.indexOf("beta") != -1 && configVersion != version) { |
| 77 | return true; //如果是测试版,且版本不一致,则肯定要更新的 |
| 78 | } |
| 79 | const configInfos = configVersion |
| 80 | .substring(1) |
| 81 | .split(" ")[0] |
| 82 | .split(".") |
| 83 | .map((x) => parseInt(x)); |
| 84 | const targetInfos = minimalVersion |
| 85 | .substring(1) |
| 86 | .split(" ")[0] |
| 87 | .split(".") |
| 88 | .map((x) => parseInt(x)); |
| 89 | const configCount = |
| 90 | configInfos[0] * 10000 + configInfos[1] * 100 + configInfos[2]; |
| 91 | const targetCount = |
| 92 | targetInfos[0] * 10000 + targetInfos[1] * 100 + targetInfos[2]; |
| 93 | return configCount < targetCount; |
| 94 | } |
| 95 | export { constants }; |
no outgoing calls
no test coverage detected