# asl-choice-processor

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

Latest version **0.0.5** (published 2018-03-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install asl-choice-processor
pnpm add asl-choice-processor
yarn add asl-choice-processor
bun add asl-choice-processor
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2018-03-20 |
| First published | 2017-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 12.6 KB |
| Known vulnerabilities | 0 (+11 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 121 |
| Author | Tim Needham |
| Maintainers | timneedham |

## Links

- npm: https://www.npmjs.com/package/asl-choice-processor
- Repository: https://github.com/wmfs/tymly
- Homepage: https://github.com/wmfs/tymly#readme
- Issues: https://github.com/wmfs/tymly/issues
- npm.io page: https://npm.io/package/asl-choice-processor

## Dependencies (4)

- [boom](https://npm.io/package/boom.md) 7.2.0
- [debug](https://npm.io/package/debug.md) 3.1.0
- [lodash](https://npm.io/package/lodash.md) 4.17.5
- [jsonpath](https://npm.io/package/jsonpath.md) 1.0.0

## Recent versions

- 0.0.5 (latest) — 2018-03-20
- 0.0.4 — 2017-10-06
- 0.0.2 — 2017-09-10

## README

# asl-choice-processor
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/wmfs/tymly/blob/master/packages/asl-choice-processor/LICENSE)

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

### Useful links

* [Amazon States Language specification (Apache License, Version 2.0)](https://states-language.net/spec.html#choice-state)
* [Choice](http://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html#amazon-states-language-choice-state-rules) state documentation

## <a name="install"></a>Install
```bash
$ npm install asl-choice-processor --save
```

## <a name="usage"></a>Usage
```javascript
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
```

## <a name="tests"></a>Tests
```bash
$ npm test
```

## <a name="license"></a>License
[MIT](https://github.com/wmfs/tymly/packages/asl-choice-processor/blob/master/LICENSE)

---
_Source: https://npm.io/package/asl-choice-processor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
