lib/server.js
function sanatize(str) {
        return str
          .replace(/\.\w+$/, '')     // remove .html
          .replace(/%[\dA-Z]+/g, '') // remove %20
          .replace(/\ban?\b/g, '')   // ignore a/an
          .replace(/\bthe\b/g, '')   // ignore the
          .replace(/\bof\b/g, '')    // ignore of
          .replace(/[^a-z0-9]/g, '') // remove non-alphanumerics
          ;
      }
function sanatize(str) {
        return str
          .replace(/\.\w+$/, '')     // remove .html
          .replace(/%[\dA-Z]+/g, '') // remove %20
          .replace(/\ban?\b/g, '')   // ignore a/an
          .replace(/\bthe\b/g, '')   // ignore the
          .replace(/\bof\b/g, '')    // ignore of
          .replace(/[^a-z0-9]/g, '') // remove non-alphanumerics
          ;
      }
function sanatize ( str ) { return str . replace ( / \.\w+$ / , '' ) // remove .html . replace ( / %[\dA-Z]+ / g , '' ) // remove %20 . replace ( / \ban?\b / g , '' ) // ignore a/an . replace ( / \bthe\b / g , '' ) // ignore the . replace ( / \bof\b / g , '' ) // ignore of . replace ( / [^a-z0-9] / g , '' ) // remove non-alphanumerics ; }
console.log('pathPart', pathPart);
console . log ( pathPart pathPart ) ;