Skip to content

For determining the next state given an Amazon States Language "Choices" definition and a set of values.

License

Notifications You must be signed in to change notification settings

wmfs/asl-choice-processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asl-choice-processor

Tymly Package npm (scoped) CircleCI codecov CodeFactor Dependabot badge Commitizen friendly JavaScript Style Guide license

For determining the next state given an Amazon States Language "Choices" definition and a set of values.

Useful links

Install

$ npm install asl-choice-processor --save

Usage

const choiceProcessor = require('asl-choice-processor')
const calculateNextState = choiceProcessor(
  {
    Choices: [
      {
        Variable: '$.foo',
        NumericEquals: 1,
        Next: 'FirstMatchState'
      },
      {
        Variable: '$.foo',
        NumericEquals: 2,
        Next: 'SecondMatchState'
      }
    ],
    Default: 'DefaultMatchState'
  }
)

calculateNextState( {foo: 1} ) // FirstMatchState
calculateNextState( {foo: 2} ) // SecondMatchState
calculateNextState( {foo: 3} ) // DefaultMatchState

Tests

$ npm test

License

MIT

About

For determining the next state given an Amazon States Language "Choices" definition and a set of values.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published