parse aws step function choice
npm install aws-sf-choice##### For using aws stepfunction choice json pattern
aws-sf-choice is json-condition pattern as aws asl pattern
npm install aws-sf-choice
`
Useage
`javascript
import {Choice } from 'aws-sf-choice'
let sampleCondition = {
Type: "Choice",
Choices: [
{
Variable: "$.r",
IsPresent: true,
Next: "nextState1"
},
{
Not:{
Variable: "$.r",
IsTimestamp: true,
},
Next: "nextState2",
}
],
Default: "DefaultState"
}
let sampleData = {
r : "this is sample text",
rr : 2
}
let choice = new Choice(sampleCondition,sampleData) // fist is condition , second is data
choice.start()
.then(r=>{
console.log("next state is : ",r)
})
`
start() method is promise function you could get next state by await`