UNPKG

boolean-expressions

Version:

Boolean expression parser and evaluator. Makes use of the Ohm grammar package with grammar rules found [here](https://github.com/avadavat/boolean-expressions/blob/master/src/grammar/grammarRules.ts).

16 lines (15 loc) 477 B
declare class BooleanExpressions { private variableNames; private evaluateFunc; constructor(exp: string); /** * Returns a list of all the unique variable names in the boolean expression. */ getVariableNames(): string[]; /** * Evaluates the given boolean expression with the given variables set to true * and the omitted variables set to false. */ evaluate(variables: string[]): boolean; } export default BooleanExpressions;