@antv/layout
Version:
graph layout algorithm
13 lines (10 loc) • 416 B
TypeScript
import { ExprContext } from '../types/common.js';
/**
* Evaluate an expression if (and only if) it's a valid string expression.
* - Returns `undefined` when `expression` is not a string, empty, or invalid.
*
* @example
* evaluateExpression('x + y', { x: 10, y: 20 }) // 30
*/
declare function evaluateExpression(expression: unknown, context: ExprContext): unknown | undefined;
export { evaluateExpression };