Paints an AST node with colors and formatting using a specified paint policy
The AST node to paint
The paint policy to use for color formatting
Optional
Optional configuration. Defaults will be used for any missing values.
The painted string representation of the node
const ast = parse_string('{"name": "John"}');const painted = paint(ast, ansi_policy); // Uses defaultsconsole.log(painted); Copy
const ast = parse_string('{"name": "John"}');const painted = paint(ast, ansi_policy); // Uses defaultsconsole.log(painted);
const ast = parse_string('{"name": "John"}');const options = { palette: forestPalette }; // containers will use defaultconst painted = paint(ast, ansi_policy, options);console.log(painted); Copy
const ast = parse_string('{"name": "John"}');const options = { palette: forestPalette }; // containers will use defaultconst painted = paint(ast, ansi_policy, options);console.log(painted);
Paints an AST node with colors and formatting using a specified paint policy