+ if (name != null && typeof name !== 'string') {
+ reject(new TypeError('name argument must be a string'))
+ }
+ if (
+ name != null &&
+ typeof name === 'string' &&
+ name.trim().length === 0
+ ) {
+ reject(new TypeError('name argument must not be an empty string'))
+ }
+ if (
+ name != null &&
+ this.taskFunctions != null &&
+ !this.taskFunctions.includes(name)
+ ) {
+ reject(
+ new Error(`Task function '${name}' is not registered in the pool`)
+ )
+ }
+ if (transferList != null && !Array.isArray(transferList)) {
+ reject(new TypeError('transferList argument must be an array'))
+ }