Kaizen
Browse modulesRulesrules/sharedFunctions

Function: flattenContext()

function flattenContext<TContext>(context: TContext, mapping: Record<string, string>): ScopeContext;

Defined in: shared/rules/engine.ts:68

Derive a ScopeContext from the evaluation context using a field-path mapping. Each key is a scope type, each value is a dot-path (supports * wildcards) resolved against the context via resolveField.

Single resolved values become strings; multiple values become string arrays.

Type Parameters

Type Parameter
TContext

Parameters

ParameterType
contextTContext
mappingRecord<string, string>

Returns

ScopeContext

On this page