Skip to content

Commit

Permalink
Merge pull request #5 from vkkis93/fix/choice-state
Browse files Browse the repository at this point in the history
fix choice state -> use _.isNil instead of _.isEmpty
  • Loading branch information
vkkis93 authored Jan 16, 2018
2 parents 7584482 + fc6047e commit ecce41f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
const filePath = `${dir}/${splitHandler[0]}.js`;
const handlerName = `${splitHandler[1]}`;

return { handler: handlerName, filePath };
return {handler: handlerName, filePath};
},

buildStepWorkFlow() {
Expand Down Expand Up @@ -75,9 +75,9 @@ module.exports = {
} else if (steps[index].waitState) {
//type: Wait
return resolve(this._run(steps[index].f(result), result, index));
} else {
return resolve(this._run(steps[index].f(), result, index));
}

return resolve(this._run(steps[index].f(), result, index));
},

_runChoice(typeChoice, result, resolve, index) {
Expand All @@ -86,7 +86,7 @@ module.exports = {
//look through choice and find appropriate
_.forEach(typeChoice.choice, choice => {
//check if result from previous function has of value which described in Choice
if (!_.isEmpty(result[choice.variable])) {
if (!_.isNil(result[choice.variable])) {
//check condition
const isConditionTrue = choice.checkFunction(result[choice.variable], choice.compareWithValue);
if (isConditionTrue) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless-step-functions-offline",
"version": "0.0.7",
"version": "0.0.8",
"description": "Serverlesss plugin to support step function offline",
"main": "index.js",
"repository": {
Expand Down

0 comments on commit ecce41f

Please sign in to comment.