MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / isLower

Function isLower

src/common/constant.ts:72–94  ·  view source on GitHub ↗
(
  configVersion: string,
  minimalVersion: string
)

Source from the content-addressed store, hash-verified

70}
71
72export 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}
95export { constants };

Callers 4

checkTheGithubPagesMethod · 0.90
loadMethod · 0.90
loadFromConfigMethod · 0.90
resumeMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected