Skip to main content

Module expression

Module expression 

Source
Expand description

Expression evaluation using exprimo

Supports JavaScript-like expressions in bindings:

  • ${state.selected ? '#FFA7E1' : '#374151'}
  • ${item.count > 10 ? 'many' : 'few'}
  • ${state.user.name + ' (' + state.user.role + ')'}

Functionsยง

build_expression_context
Build a context for expression evaluation from state, optional item, and data sources
build_expression_context_with_data_sources
Build a context for expression evaluation with optional data sources
evaluate_expression
Evaluate an expression string with the given context
evaluate_template_string
Evaluate a template string that may contain expressions
evaluate_template_string_full
Evaluate a template string with full context including data sources
extract_bindings_from_expression
Extract all state, item, and data source bindings from an expression string
is_expression
Check if a string contains an expression (not just a simple path)