Skip to content

chetbox/jexl-to-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jexl-to-string

Convert a Jexl Abstract Syntax Tree (AST) back to a string expression.

Installation

NPM:

npm install --save jexl-to-string

Yarn:

yarn add jexl-to-string

Example

import { jexlExpressionStringFromAst } from "jexl-to-string";
import { Jexl } from "jexl";

const jexl = new Jexl();
const compiledExpression = jexl.compile(input);
const newExpression = jexlExpressionStringFromAst(
  jexl._grammar,
  compiledExpression._getAst()
);