runtime_library/module.js
// Slice the given string to the last instance of the regex (inclusive)
Slice the given string to the last instance of the regex (inclusive)
Slice the given string to the last instance of the regex ( inclusive )
function truncateToLastInstance(string, regex) {
    var regex = new RegExp(regex.source, 'ig');
    var exec_result = execToLastInstance(string, regex);
    if (!exec_result) {
      return string;
    }
    var end_index_of_last_instance = string.lastIndexOf(exec_result[1]) + exec_result[1].length;
    var to_last_result = string.slice(0, end_index_of_last_instance);
    return to_last_result;
  }
function truncateToLastInstance ( string , regex ) { var regex = new RegExp ( regex . source , 'ig' ) ; var exec_result = execToLastInstance ( string , regex ) ; if ( ! exec_result ) { return string ; } var end_index_of_last_instance = string . lastIndexOf ( exec_result [ 1 ] ) + exec_result [ 1 ] . length ; var to_last_result = string . slice ( 0 , end_index_of_last_instance ) ; return to_last_result ; }
Slice the given string to the last instance of the regex (inclusive)
Slice the given string to the last instance of the regex ( inclusive )