({
manifest,
userConfig,
}: HasRequiredConfigMissingOptions)
| 195 | * @returns true if required configuration is missing |
| 196 | */ |
| 197 | export function hasRequiredConfigMissing({ |
| 198 | manifest, |
| 199 | userConfig, |
| 200 | }: HasRequiredConfigMissingOptions): boolean { |
| 201 | if (!manifest.user_config) { |
| 202 | return false; |
| 203 | } |
| 204 | |
| 205 | const config = userConfig || {}; |
| 206 | |
| 207 | for (const [key, configOption] of Object.entries(manifest.user_config)) { |
| 208 | if (configOption.required) { |
| 209 | const value = config[key]; |
| 210 | if ( |
| 211 | isInvalidSingleValue(value) || |
| 212 | (Array.isArray(value) && |
| 213 | (value.length === 0 || value.some(isInvalidSingleValue))) |
| 214 | ) { |
| 215 | return true; |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | return false; |
| 221 | } |
no test coverage detected
searching dependent graphs…