Comparing version 0.0.10 to 0.0.11
@@ -22,2 +22,5 @@ "use strict"; | ||
get(property) { | ||
if (!this.hasOwnProperty(property)) { | ||
throw Error(`No property with name "${name}" is set`); | ||
} | ||
return this[property]; | ||
@@ -35,7 +38,15 @@ } | ||
runTaskPlan(name) { | ||
return this.runTasks(this.taskPlans[name]); | ||
const taskPlan = this.taskPlans[name]; | ||
if (!taskPlan) { | ||
throw Error(`No taskPlan with name "${name}" is registered`); | ||
} | ||
return this.runTasks(taskPlan); | ||
} | ||
runTask(task, lastResult) { | ||
if (typeof task === 'string' || task instanceof String) { | ||
return this.tasks[task].run(undefined, lastResult, this.options); | ||
const taskToRun = this.tasks[task]; | ||
if (!taskToRun) { | ||
throw Error(`No task with name "${task}" is registered`); | ||
} | ||
return taskToRun.run(undefined, lastResult, this.options); | ||
} | ||
@@ -42,0 +53,0 @@ return this.tasks[task.name].run(task.seed, lastResult, this.options); |
@@ -14,5 +14,12 @@ "use strict"; | ||
getAgent(name) { | ||
return this.agents[name]; | ||
const agent = this.agents[name]; | ||
if (!agent) { | ||
throw Error(`No agent with name "${name}" is registered`); | ||
} | ||
return agent; | ||
} | ||
get(property) { | ||
if (!this.hasOwnProperty(property)) { | ||
throw Error(`No property with name "${name}" is set`); | ||
} | ||
return this[property]; | ||
@@ -19,0 +26,0 @@ } |
{ | ||
"name": "keisatsu", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "Task runner based on yakuza", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
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
23087
208