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

Function generalCheck

src/common/configuration.ts:124–139  ·  view source on GitHub ↗
(value: KeyConfig)

Source from the content-addressed store, hash-verified

122
123
124function generalCheck(value: KeyConfig): CheckResult {
125 const invalidKeys = getInvalidStringKeys(value);
126 if (invalidKeys.length > 0) {
127 const reason = `字段类型无效: ${invalidKeys.join(", ")}`;
128 return { canSave: false, canEnable: false, saveReason: reason, enableReason: reason };
129 }
130 const emptyKeys = getEmptyKeys(value);
131 if (emptyKeys.length === 0) {
132 return { canSave: true, canEnable: true };
133 }
134 return {
135 canSave: true,
136 canEnable: false,
137 enableReason: `请填写: ${emptyKeys.join(", ")}`,
138 };
139}
140
141function initConfig(
142 config: ConfigParser | undefined = undefined

Callers

nothing calls this directly

Calls 2

getInvalidStringKeysFunction · 0.85
getEmptyKeysFunction · 0.85

Tested by

no test coverage detected