'use strict'

// Expose

module.exports = exports = {
  normalizeWhitespace: normalizeWhitespace,
  trim: trim
}

/**
 * Strips excess of whitespace
 * @param  {string}  inputString  string to be normalized
 * @return {string}               normalized string
 */
function normalizeWhitespace (inputString) {
  return inputString.replace(/\s+/g, ' ')

/**
 * Trims leading or trailing whitespace, or both
 * @param  {string} input         string to be trimmed
 * @param  {string} [side=both]   what side to trim
 * @return {string}               trimed string
 */

function trim (input, side) {
  if ([undefined, 'both', 'left'].some(op => op === side)) {
    input = input.replace(/^\s*/, '')
  }

  if ([undefined, 'both', 'right'].some(op => op === side)) {
    input = input.replace(/\s*$/, '')
  }

  return input
}

@@ -168,22 +168,16 @@
 %7D  input
-String
   string
@@ -222,22 +222,16 @@
         
- 
-     
 normaliz
@@ -244,16 +244,17 @@
 ing%0A */%0A
+%0A
 function
@@ -280,22 +280,16 @@
 e (input
-String
 ) %7B%0A  re
@@ -302,14 +302,8 @@
 nput
-String
 .rep
@@ -319,16 +319,18 @@
 /g, ' ')
+%0A%7D
 %0A%0A/**%0A *

Normalize jsDoc blocks on filters.js