(
configSchema: Record<string, PluginConfigSchema> | PluginConfigSchema[]
)
| 18 | } |
| 19 | |
| 20 | export function getConfigSchemaObject( |
| 21 | configSchema: Record<string, PluginConfigSchema> | PluginConfigSchema[] |
| 22 | ): Record<string, PluginConfigSchema> { |
| 23 | if (Array.isArray(configSchema)) { |
| 24 | const newSchema: Record<string, PluginConfigSchema> = {} |
| 25 | configSchema.forEach((conf, order) => { |
| 26 | if (conf.key) { |
| 27 | newSchema[conf.key] = { ...conf, order } |
| 28 | } |
| 29 | }) |
| 30 | return newSchema |
| 31 | } else { |
| 32 | return configSchema |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | export function defaultConfigForPlugin(plugin: PluginTypeWithConfig): Record<string, any> { |
| 37 | const config: Record<string, any> = {} |
no outgoing calls
no test coverage detected
searching dependent graphs…