MCPcopy Index your code
hub / github.com/alibaba/lowcode-engine / parseConfig

Method parseConfig

packages/editor-skeleton/src/skeleton.ts:428–452  ·  view source on GitHub ↗
(config: IPublicTypeWidgetBaseConfig)

Source from the content-addressed store, hash-verified

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,

Callers 3

createWidgetMethod · 0.95
createPanelMethod · 0.95
addMethod · 0.95

Calls 2

forEachMethod · 0.65
isPlainObjectFunction · 0.50

Tested by

no test coverage detected