This is to tidy up the `author-packagse`, which currently duplicates a lot of the configuration in the main packages. We need to DRY this up so that we don't fall foul of a change in one being missed in the other.
		
			
				
	
	
		
			15 lines
		
	
	
		
			369 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			369 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
module.exports = function() {
 | 
						|
  return {
 | 
						|
    name: 'trimBlankLines',
 | 
						|
    process: function(str) {
 | 
						|
      var lines = str.split(/\r?\n/);
 | 
						|
      while (lines.length && (lines[0].trim() === '')) {
 | 
						|
        lines.shift();
 | 
						|
      }
 | 
						|
      while (lines.length && (lines[lines.length - 1].trim() === '')) {
 | 
						|
        lines.pop();
 | 
						|
      }
 | 
						|
      return lines.join('\n');
 | 
						|
    }
 | 
						|
  };
 | 
						|
}; |