(config: GoldenLayout.Config)
| 1108 | * @throws Error if the configuration is invalid (should be caught and handled) |
| 1109 | */ |
| 1110 | export function fromGoldenLayoutConfig(config: GoldenLayout.Config): GoldenLayoutConfig { |
| 1111 | if (!config || typeof config !== 'object') { |
| 1112 | throw new Error('Invalid configuration: must be an object'); |
| 1113 | } |
| 1114 | |
| 1115 | // Validate the root structure |
| 1116 | return { |
| 1117 | ...config, |
| 1118 | content: config.content ? validateItemConfigs(config.content) : undefined, |
| 1119 | }; |
| 1120 | } |
| 1121 | |
| 1122 | /** |
| 1123 | * Validates an array of item configurations (recursive) |
no test coverage detected