(config: IPublicTypeWidgetBaseConfig)
| 426 | } |
| 427 | |
| 428 | private parseConfig(config: IPublicTypeWidgetBaseConfig) { |
| 429 | if (config.parsed) { |
| 430 | return config; |
| 431 | } |
| 432 | const { content, ...restConfig } = config; |
| 433 | if (content) { |
| 434 | if (isPlainObject(content) && !isValidElement(content)) { |
| 435 | Object.keys(content).forEach((key) => { |
| 436 | if (/props$/i.test(key) && restConfig[key]) { |
| 437 | restConfig[key] = { |
| 438 | ...restConfig[key], |
| 439 | ...content[key], |
| 440 | }; |
| 441 | } else { |
| 442 | restConfig[key] = content[key]; |
| 443 | } |
| 444 | }); |
| 445 | } else { |
| 446 | restConfig.content = content; |
| 447 | } |
| 448 | } |
| 449 | restConfig.pluginKey = restConfig.name; |
| 450 | restConfig.parsed = true; |
| 451 | return restConfig; |
| 452 | } |
| 453 | |
| 454 | registerConfigTransducer( |
| 455 | transducer: IPublicTypeConfigTransducer, |
no test coverage detected