): void {
const { taskFunction, taskFunctionOperation, taskFunctionProperties } =
message
- if (typeof taskFunction !== 'string') {
- throw new Error(
- 'Cannot handle task function operation message without task function'
- )
- }
if (taskFunctionProperties == null) {
throw new Error(
'Cannot handle task function operation message without task function properties'
let response: TaskFunctionOperationResult
switch (taskFunctionOperation) {
case 'add':
+ if (typeof taskFunction !== 'string') {
+ throw new Error(
+ `Cannot handle task function operation ${taskFunctionOperation} message without task function`
+ )
+ }
response = this.addTaskFunction(taskFunctionProperties.name, {
// eslint-disable-next-line @typescript-eslint/no-implied-eval, no-new-func, @typescript-eslint/no-unsafe-call
taskFunction: new Function(