Skip to content

Releases: code4ward/JSOI

Conditional Object Loading

06 Apr 23:56

Choose a tag to compare

Release Notes

Conditional Loading objects with Expressions

JSOI now supports combining conditional loading with expressions. This functionality is supported by combining conditional loading
and expressions. The <-IF(expression) is supported along with <--IF(expression) and support for
<-ELSE.

Example

The examples below highlight this functionality in yaml since it may be easier to read then json.

1️⃣ Consider the following template Object:

Sub:
  "<-IF(({{ FirstN }} == 10) && ({{ SecondN }} != 10))":
    A: 10
    B: '2'
    C:
      D: 'Yes'
  "<-ELSE":
    A: 1

2️⃣ With the following keys:

FirstN: 10
SecondN: 11

3️⃣ When interpolating the following result will be produced:

Sub:
  A: 10
  B: '2'
  C:
    D: 'Yes'

Example

The order of <-IF and <-ELSE within the object will not impact the result.

1️⃣ Consider the following template Object:

Sub:
  "<-ELSE":
    A: 1

  "<-IF(({{ FirstN }} == 10) && ({{ SecondN }} != 10))":
    A: 10
    B: '2'
    C:
      D: 'Yes'

2️⃣ With the following keys:

FirstN: 10
SecondN: 11

3️⃣ When interpolating the following result will be produced:

Sub:
  A: 10
  B: '2'
  C:
    D: 'Yes'

Example

When using string make sure to wrap them in single quotes

1️⃣

Sub:
  "<-IF('{{ DEBUG }}' == 'Yes')":
    A: Debug is on
  "<-ELSE":
    A: Debug is off

2️⃣ With the following keys:

Sub:
  DEBUG: 'Yes'

3️⃣ When interpolating the following result will be produced:

A: Debug is on

v1.0.25

02 Apr 20:04

Choose a tag to compare

Release Notes

This version includes changes to the CI pipeline as well as a few more unit tests.

v1.0.24

02 Apr 04:11

Choose a tag to compare

Release Notes

Update CI build and publish workflow