lib/cmsTxtToIntObj.js
function cleanUpTitle(rawTitleString) {
    /*dashChar is most commonly the dash of the title string, or a
  the first repeating character surrounding the title */
    var dashChar = rawTitleString.charAt(0);
    //beginning and ending index of the dash
    var dashBegIndex = 0;
    var dashEndIndex = rawTitleString.lastIndexOf(dashChar);

    //loop through to find indicies without continous dashes
    while (rawTitleString.charAt(dashBegIndex) === (dashChar || '\n')) {
        dashBegIndex++;
    }
    while (rawTitleString.charAt(dashEndIndex) === (dashChar || '\n')) {
        dashEndIndex--;
    }

    var titleString = rawTitleString.slice(dashBegIndex + 1, dashEndIndex - 1);
    titleString = trimStringEnds(titleString, ['\n', '-']);
    return titleString;
}
function cleanUpTitle(rawTitleString) {
    /*dashChar is most commonly the dash of the title string, or a
  the first repeating character surrounding the title */
    var dashChar = rawTitleString.charAt(0);
    //beginning and ending index of the dash
    var dashBegIndex = 0;
    var dashEndIndex = rawTitleString.lastIndexOf(dashChar);

    //loop through to find indicies without continous dashes
    while (rawTitleString.charAt(dashBegIndex) === (dashChar || '\n')) {
        dashBegIndex++;
    }
    while (rawTitleString.charAt(dashEndIndex) === (dashChar || '\n')) {
        dashEndIndex--;
    }

    var titleString = rawTitleString.slice(dashBegIndex + 1, dashEndIndex - 1);
    titleString = trimStringEnds(titleString, ['\n', '-']);
    return titleString;
}
function cleanUpTitle ( rawTitleString ) { /*dashChar is most commonly the dash of the title string, or a
  the first repeating character surrounding the title */ var dashChar = rawTitleString . charAt ( 0 ) ; //beginning and ending index of the dash var dashBegIndex = 0 ; var dashEndIndex = rawTitleString . lastIndexOf ( dashChar ) ; //loop through to find indicies without continous dashes while ( rawTitleString . charAt ( dashBegIndex ) === ( dashChar || '\n' ) ) { dashBegIndex ++ ; } while ( rawTitleString . charAt ( dashEndIndex ) === ( dashChar || '\n' ) ) { dashEndIndex -- ; } var titleString = rawTitleString . slice ( dashBegIndex + 1 , dashEndIndex - 1 ) ; titleString = trimStringEnds ( titleString , [ '\n' , '-' ] ) ; return titleString ; }
cleans up the title string obtained from the regular expression
cleans up the title string obtained from the regular expression