kyrie
    Preparing search index...

    Function paint

    • Paints an AST node with colors and formatting using a specified paint policy

      Parameters

      • node: ASTNode

        The AST node to paint

      • policy: PaintPolicy

        The paint policy to use for color formatting

      • Optionaloptions: Options

        Optional configuration. Defaults will be used for any missing values.

      • depth: number = 0

      Returns string

      The painted string representation of the node

      const ast = parse_string('{"name": "John"}');
      const painted = paint(ast, ansi_policy); // Uses defaults
      console.log(painted);
      const ast = parse_string('{"name": "John"}');
      const options = { palette: forestPalette }; // containers will use default
      const painted = paint(ast, ansi_policy, options);
      console.log(painted);