IfThen.ifThenFinallySync()

If the provided value is true, then run the "then" circuit. Otherwise run the "else" circuit. Either way, exit "success".

Usage

Hover over inputs/exits for more info.

var IfThen = require('machinepack-ifthen');


// If the provided value is true, then run the "then" circuit. Otherwise run the "else" circuit. Either way, exit "success".

IfThen.ifThenFinallySync({

then: '->',

bool: true,

orElse: '->',

expectedOutput: '*',

}).execSync();

Inputs

then required

'->'
bool

The true/false value to check.

true
orElse

'->'
expectedOutput

An example of the expected output value.

'*'

Exits

error

An unexpected error occurred.

success

OK.

(varies based on provided inputs)