ESCalc - v0.0.1-beta.2
    Preparing search index...

    Function format

    • Serialize a LogicalExpression (or expression string) to a canonical string representation.

      Useful for normalising user-provided expressions: whitespace is standardised, parameter names are wrapped in [brackets], and operators are rendered consistently. Parsing followed by formatting acts as a round-trip normaliser.

      Parameters

      Returns string

      The canonical string form of the expression.

      ParserError If expression is a string that cannot be parsed.

      ESCalcError If the AST contains an unrecognised node type.

      import { format } from 'escalc';

      format('1+2'); // => '1 + 2'
      format('[x]*[y]'); // => '[x] * [y]'
      format('a not in (1,2)'); // => '[a] not in 1,2'