* Validate Tools configuration objects and throw Error for user if it is invalid
()
| 377 | * Validate Tools configuration objects and throw Error for user if it is invalid |
| 378 | */ |
| 379 | private validateTools(): void { |
| 380 | /** |
| 381 | * Check Tools for a class containing |
| 382 | */ |
| 383 | for (const toolName in this.config.tools) { |
| 384 | if (Object.prototype.hasOwnProperty.call(this.config.tools, toolName)) { |
| 385 | if (toolName in this.internalTools) { |
| 386 | return; |
| 387 | } |
| 388 | |
| 389 | const tool = this.config.tools[toolName]; |
| 390 | |
| 391 | if (!_.isFunction(tool) && !_.isFunction((tool as ToolSettings).class)) { |
| 392 | throw Error( |
| 393 | `Tool «${toolName}» must be a constructor function or an object with function in the «class» property` |
| 394 | ); |
| 395 | } |
| 396 | } |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | /** |
| 401 | * Unify tools config |