- if (
- typeof taskFunctions !== 'function' &&
- typeof taskFunctions !== 'object'
- ) {
- throw new Error('taskFunctions parameter is not a function or an object')
- }
- if (
- typeof taskFunctions === 'object' &&
- taskFunctions.constructor !== Object &&
- Object.prototype.toString.call(taskFunctions) !== '[object Object]'
- ) {
- throw new Error('taskFunctions parameter is not an object literal')
- }