Skip to content

checkExpressionComplexity

function checkExpressionComplexity(tokens, config): {
complexityScore: number;
engineError?: EngineError;
errorMessage?: string;
passed: boolean;
};

Defined in: packages/engine/src/engine/ExpressionEngineSafety.ts:83

Score expression complexity based on token count, function calls, and nesting depth. Returns the complexity score and whether it exceeds the configured maximum.

ParameterType
tokensToken[]
configValidationConfig
{
complexityScore: number;
engineError?: EngineError;
errorMessage?: string;
passed: boolean;
}
complexityScore: number;
optional engineError?: EngineError;
optional errorMessage?: string;
passed: boolean;