chore: v2.4.12
[poolifier.git] / src / worker / abstract-worker.ts
index 12fb67af32934383a9498e541fadc031e85cbafe..163736696b8ec7080ee17556a52e18aa40e07466 100644 (file)
@@ -103,14 +103,6 @@ export abstract class AbstractWorker<
     if (taskFunctions == null) {
       throw new Error('taskFunctions parameter is mandatory')
     }
-    if (
-      typeof taskFunctions !== 'function' &&
-      typeof taskFunctions !== 'object'
-    ) {
-      throw new TypeError(
-        'taskFunctions parameter is not a function or an object'
-      )
-    }
     this.taskFunctions = new Map<string, WorkerFunction<Data, Response>>()
     if (typeof taskFunctions === 'function') {
       this.taskFunctions.set(DEFAULT_FUNCTION_NAME, taskFunctions.bind(this))
@@ -132,7 +124,9 @@ export abstract class AbstractWorker<
         throw new Error('taskFunctions parameter object is empty')
       }
     } else {
-      throw new TypeError('taskFunctions parameter is not an object literal')
+      throw new TypeError(
+        'taskFunctions parameter is not a function or a plain object'
+      )
     }
   }