(config: any)
| 475 | * @return {{}|*} 结构体 |
| 476 | */ |
| 477 | const configToStruct = (config: any) => { |
| 478 | if (config.type === DATA_TYPES.ARRAY) { |
| 479 | return config.value.map(v => configToStruct(v)); |
| 480 | } else if (config.type === DATA_TYPES.OBJECT) { |
| 481 | const obj = {}; |
| 482 | config.value.forEach((item: any) => { |
| 483 | obj[item.name] = configToStruct(item); |
| 484 | }); |
| 485 | return obj; |
| 486 | } else { |
| 487 | return Object.prototype.hasOwnProperty.call(config, 'value') ? config.value : config; |
| 488 | } |
| 489 | }; |
| 490 | |
| 491 | /** |
| 492 | * 创建画布操纵器 |
no test coverage detected