lib-task-scheduler
Advanced tools
Comparing version 1.0.15 to 1.0.16
@@ -63,11 +63,14 @@ "use strict"; | ||
} | ||
if (!config.name && _.has(task, 'name')) { | ||
config.name = task.name; | ||
if (!config.name) { | ||
const taskAny = task; | ||
if (_.isString(taskAny.name)) { | ||
config.name = taskAny.name; | ||
} | ||
else if (taskAny.constructor && _.isString(taskAny.constructor.name)) { | ||
config.name = taskAny.constructor.name; | ||
} | ||
else { | ||
throw new Error('Task must be configured with a name (either through its TaskConfig, a name property, or having a named constructor)'); | ||
} | ||
} | ||
else if (!config.name && _.has(task, 'constructor.name')) { | ||
config.name = task.constructor.name; | ||
} | ||
else if (!config.name) { | ||
throw new Error('Task must be configured with a name (either through its TaskConfig, a name property, or having a named constructor)'); | ||
} | ||
if (config.intervalMs <= 0) { | ||
@@ -74,0 +77,0 @@ throw new Error('Task interval must be greater than zero.'); |
{ | ||
"name": "lib-task-scheduler", | ||
"version": "1.0.15", | ||
"version": "1.0.16", | ||
"description": "A lightweight, modular task scheduler.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/convoyinc/lib-task-scheduler", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
102860
1486