New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@peacockproject/statemachine-parser

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@peacockproject/statemachine-parser

IOI state machine conditional parser.

latest
Source
npmnpm
Version
6.2.0
Version published
Maintainers
1
Created
Source

StateMachineParser

Check what an IOI state machine would return given an input.

What's an IOI state machine?

An IOI state machine is what we call a part of the JSON scripting system used within the Glacier engine.

For example:

{
    "$eq": ["$Value.MyParameter", "Hello"]
}

That is a state machine condition that checks if $Value.MyParameter is "Hello".

Normally, only the actual Glacier engine could check the output of this condition, but this parser can also do it.

How to Use

Install from npm

You can run:

yarn add @peacockproject/statemachine-parser

Or, if you use npm:

npm i @peacockproject/statemachine-parser

Build from Source

git clone https://github.com/thepeacockproject/StateMachineParser
cd StateMachineParser
# installs dependencies and builds
yarn && yarn build

Usage

const { test } = require("@peacockproject/statemachine-parser")

const condition = {
    $eq: ["$Value.Greeting", "Hi!"],
}

const result = test(
    condition, // the state machine condition
    {
        Value: {
            Greeting: "Hi!",
        },
    }, // the variables object, which is essentially the input values.
)

Keywords

ioi

FAQs

Package last updated on 07 Nov 2024

Did you know?

Socket

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