Skip to content

Commit ecce41f

Browse files
authored
Merge pull request #5 from vkkis93/fix/choice-state
fix choice state -> use _.isNil instead of _.isEmpty
2 parents 7584482 + fc6047e commit ecce41f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

build.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = {
2323
const filePath = `${dir}/${splitHandler[0]}.js`;
2424
const handlerName = `${splitHandler[1]}`;
2525

26-
return { handler: handlerName, filePath };
26+
return {handler: handlerName, filePath};
2727
},
2828

2929
buildStepWorkFlow() {
@@ -75,9 +75,9 @@ module.exports = {
7575
} else if (steps[index].waitState) {
7676
//type: Wait
7777
return resolve(this._run(steps[index].f(result), result, index));
78+
} else {
79+
return resolve(this._run(steps[index].f(), result, index));
7880
}
79-
80-
return resolve(this._run(steps[index].f(), result, index));
8181
},
8282

8383
_runChoice(typeChoice, result, resolve, index) {
@@ -86,7 +86,7 @@ module.exports = {
8686
//look through choice and find appropriate
8787
_.forEach(typeChoice.choice, choice => {
8888
//check if result from previous function has of value which described in Choice
89-
if (!_.isEmpty(result[choice.variable])) {
89+
if (!_.isNil(result[choice.variable])) {
9090
//check condition
9191
const isConditionTrue = choice.checkFunction(result[choice.variable], choice.compareWithValue);
9292
if (isConditionTrue) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-step-functions-offline",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "Serverlesss plugin to support step function offline",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)