formatBase(base) {
    if (!base) return '';
    if (base.charAt(0) != '/') base = '/' + base;
    if (base.charAt(base.length - 1) == '/') base = base.substr(0, base.length - 1);
    return encodeURI(base);
  }
/**
   * Takes in the base the user input, checks to make sure first char is / and that there isn't a trailing /
   * then encodes the base to URI just in case. For internal use only.
   * @param {string} base the raw base string that the user passed in
   * @returns {string} formatted base string
   */
Takes in the base the user input, checks to make sure first char is / and that there isn't a trailing
then encodes the base to URI just in case. For internal use only.
@param {string} base the raw base string that the user passed in
@returns {string} formatted base string
Takes in the base the user input checks to make sure first char is / and that there isn ' t a trailing then encodes the base to URI just in case . For internal use only . @param { string } base the raw base string that the user passed in @returns { string } formatted base string
formatBase(base) {
    if (!base) return '';
    if (base.charAt(0) != '/') base = '/' + base;
    if (base.charAt(base.length - 1) == '/') base = base.substr(0, base.length - 1);
    return encodeURI(base);
  }
formatBase ( base ) { if ( ! base ) return '' ; if ( base . charAt ( 0 ) != '/' ) base = '/' + base ; if ( base . charAt ( base . length - 1 ) == '/' ) base = base . substr ( 0 , base . length - 1 ) ; return encodeURI ( base ) ; }
Takes in the base the user input, checks to make sure first char is / and that there isn't a trailing
 then encodes the base to URI just in case.
Takes in the base the user input checks to make sure first char is / and that there isn ' t a trailing then encodes the base to URI just in case .