Socket
Socket
Sign inDemoInstall

@wmfs/asl-choice-processor

Package Overview
Dependencies
16
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @wmfs/asl-choice-processor

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


Version published
Weekly downloads
444
decreased by-4.72%
Maintainers
1
Install size
4.85 MB
Created
Weekly downloads
 

Changelog

Source

1.24.1 (2023-12-11)

Bug Fixes

  • includes: check for array (40c7698)

✨ Features

📦 Code Refactoring

  • tidy up IsNull and extend tests (f5efe84)
  • tidy up IsUndefined and extend tests (00dea40)

Readme

Source

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.

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

Keywords

FAQs

Last updated on 11 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc