jev / devtoolsDocumentation

API reference

Expressions & conditions

Reference typed values and compose inspectable decisions.

References are values for later#

FlowExpression<T> represents a typed value that will be resolved during a run. Obtain one from flow.input, a task result, an answer field, or a joined operation. You usually do not construct the class directly.

ts · API help
const message = flow..("message");
const answer = classification.("team").;
const isBilling = answer.("billing");

API reference: flow.input · expression.get() · answer.choice · expression.eq()

Example walkthrough: get("message") selects the input message. answer("team").choice selects a previous Choice answer. .eq("billing") describes a Boolean comparison that will be evaluated when the flow runs.

This fragment assumes a flow input with message and an earlier request named classification with a Choice question team. See the complete flow example.

Select and compare#

Method Meaning
.get(key) Select an existing field, including nested fields.
.eq(value) Compare matching scalar types for equality.
.lt(value) Strictly less than; finite numeric values only.
.gt(value) Strictly greater than; finite numeric values only.
.gte(value) Greater than or equal; finite numeric values only.

Each comparison accepts a literal or compatible expression. Optional or nullable numeric fields must be resolved to valid numbers before comparison. Missing fields are execution errors. There is no .lte() method; express an inclusive upper bound with not(value.gt(limit)) when the value is a valid number.

Return interfaces#

Method Return type Resolved value
get(key) FlowExpression<T[K]> Value of the selected field.
eq, lt, gt, gte FlowExpression<boolean> The result of the comparison.

Combine conditions#

Import all, any, and not from jev-devtools/flow:

ts · API help
const shouldReview = (
  eligibility.("eligible")..(0.9),
  (risk.("risky")..(0.2)),
);

API reference: all() · answer.noul · expression.gte() · not() · expression.gt()

Example walkthrough: .gte(0.9) checks the eligibility threshold. .gt(0.2) checks the risk threshold, and not() inverts that second condition. all() requires both conditions to hold. These thresholds are explicitly authored application policy.

This fragment assumes earlier requests named eligibility and risk. The thresholds are example application policy, not TypeSafe defaults. all requires every condition, any requires at least one, and not inverts one Boolean expression.

All operands are evaluated. A missing reference remains an error even when another operand would normally short-circuit JavaScript evaluation. There is no arbitrary predicate callback or eval in the expression API.

Return interfaces#

Helper Return type Resolved value
all(...conditions) FlowExpression<boolean> True when every condition is true.
any(...conditions) FlowExpression<boolean> True when at least one condition is true.
not(condition) FlowExpression<boolean> The inverse of the condition.

Respect scope#

A reference belongs to its definition and available execution scope. Do not use a reference from another flow, an untaken branch, or a sibling parallel lane. Return a value from if or parallel to make it available after the join. Pass explicit context into map and loop programs.

Jev DevTools is an independent, open-source community project. It is not affiliated with TypeSafe AI.