code: function removeTrailingLinebreaks(text) {
      let linebreak = determineLinebreaks(text);
      if (linebreak === "") return text;
  
      while (text.endsWith(linebreak)) {
          text = text.slice(0, 0 - linebreak.length);
      }
  
      return text;
  }
docs: Remove any trailing empty lines found inside the given text.
  
  @param  {String} text Original text
  @return {String} Trimed text