function(ast) {
      var lastChild = ast.last();
      if (lastChild.is('space')) {
        lastChild.content = trim(lastChild.content)
            .replace(/[ \t]+$/, '')
            .replace(/[\n]+/g, '\n');
      }

      ast.traverseByType('space', function(space) {
        space.content = trim(space.content);
      });
    }
function(ast) {
      var lastChild = ast.last();
      if (lastChild.is('space')) {
        lastChild.content = trim(lastChild.content)
            .replace(/[ \t]+$/, '')
            .replace(/[\n]+/g, '\n');
      }

      ast.traverseByType('space', function(space) {
        space.content = trim(space.content);
      });
    }
function ( ast ) { var lastChild = ast . last ( ) ; if ( lastChild . is ( 'space' ) ) { lastChild . content = trim ( lastChild . content ) . replace ( / [ \t]+$ / , '' ) . replace ( / [\n]+ / g , '\n' ) ; } ast . traverseByType ( 'space' , function ( space ) { space . content = trim ( space . content ) ; } ) ; }
Processes tree node.
@param {node} ast
Processes tree node .