estree-toolkit
Version:
Traverser, scope tracker, and more tools for working with ESTree AST
14 lines (13 loc) • 476 B
TypeScript
import { NodePath } from '../nodepath';
/**
* Evaluates the given `path`.
* @returns An object with property `value` if evaluation is successful, otherwise `undefined`
*/
export declare const evaluate: (path: NodePath) => {
value: unknown;
} | undefined;
/**
* Evaluates the given path for truthiness
* @returns `true` or `false` if the evaluation is successful, otherwise `undefined`
*/
export declare const evaluateTruthy: (path: NodePath) => boolean | undefined;