MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / resume

Method resume

src/common/configParser.ts:270–286  ·  view source on GitHub ↗
(key: Identifier)

Source from the content-addressed store, hash-verified

268 resumeSnapshot(name: string) {
269 const snapshot = this.get<ConfigSnapshots>("configSnapshots")[name];
270 const resume = (key: Identifier) => {
271 let val = snapshot[key];
272 const rule = this.getRule(key);
273 let invalid: boolean =
274 rule.minimalVersion != undefined &&
275 isLower(snapshot["version"], rule.minimalVersion as string);
276 //config的版本小于这项rule的最低版本,则需要更新为最新的预定义值
277 invalid = invalid || !this.checkValid(key, val);
278 if (invalid) {
279 return;
280 }
281 if (key == "layoutType") {
282 this.set(key, val, true, false); //必须要禁止preset才能
283 } else {
284 this.set(key, val);
285 }
286 };
287 const keys: Identifier[] = Object.keys(snapshot) as Identifier[];
288 for (const key of keys) {
289 if (key == "layoutType") {

Callers

nothing calls this directly

Calls 4

getRuleMethod · 0.95
checkValidMethod · 0.95
setMethod · 0.95
isLowerFunction · 0.90

Tested by

no test coverage detected