MCPcopy Index your code
hub / github.com/CopyTranslator/CopyTranslator / compatible

Function compatible

src/common/constant.ts:50–70  ·  view source on GitHub ↗
(configVersion: string)

Source from the content-addressed store, hash-verified

48}
49
50export function compatible(configVersion: string): boolean {
51 if (configVersion.indexOf("beta") != -1 && configVersion != version) {
52 return false; //如果是测试版,肯定要更新的
53 }
54 try {
55 const configCount = version2int(configVersion);
56 const currentCount = version2int(version);
57 if (configCount > currentCount) {
58 return false; //回退到旧版本要把整个配置文件重置一下,避免冲突
59 }
60 const minVersion = "12.1.0";
61 const minCount = version2int(minVersion);
62
63 if (configCount < minCount) { // 12.0.1 之前的版本,不支持新的配置项
64 return false;
65 }
66 return true;
67 } catch (e) {
68 return false;
69 }
70}
71
72export function isLower(
73 configVersion: string,

Callers 2

loadMethod · 0.90
loadFileFunction · 0.90

Calls 1

version2intFunction · 0.85

Tested by

no test coverage detected