* Unify tools config
()
| 401 | * Unify tools config |
| 402 | */ |
| 403 | private prepareConfig(): {[name: string]: ToolSettings} { |
| 404 | const config: {[name: string]: ToolSettings} = {}; |
| 405 | |
| 406 | /** |
| 407 | * Save Tools settings to a map |
| 408 | */ |
| 409 | for (const toolName in this.config.tools) { |
| 410 | /** |
| 411 | * If Tool is an object not a Tool's class then |
| 412 | * save class and settings separately |
| 413 | */ |
| 414 | if (_.isObject(this.config.tools[toolName])) { |
| 415 | config[toolName] = this.config.tools[toolName] as ToolSettings; |
| 416 | } else { |
| 417 | config[toolName] = { class: this.config.tools[toolName] as ToolConstructable }; |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | return config; |
| 422 | } |
| 423 | } |