(value: KeyConfig)
| 122 | |
| 123 | |
| 124 | function 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 | |
| 141 | function initConfig( |
| 142 | config: ConfigParser | undefined = undefined |
nothing calls this directly
no test coverage detected