Skip to content

This site describes solve-engine 2.44.0, the version npm installs.

checkExpressionComplexity

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

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

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;
engineError?: EngineError;
errorMessage?: string;
passed: boolean;