<commit_before>module.exports = function(string, length, options) {
  // Initially handle the params
  if (typeof string !== 'string') return '';
  if (typeof length !== 'number' || length < 0) return string;
  if (typeof options !== 'object') options = {};

  // Base settings
  var settings = {
    threshold: length,
    appendix: '…',
  };

  // Overwrite settings with options if they are valid
  if (options.threshold && typeof options.threshold === 'number' && options.threshold > 0) settings.threshold = options.threshold;
  if (typeof options.appendix === 'string') settings.appendix = options.appendix;

  // Check if string is long enough for truncation
  if (string.length > (settings.threshold || length) && string.length > length) {
    var shortenedString = string.substring(0, length);

    return shortenedString + settings.appendix;
  }

  // Otherwise return string as is
  return string;
};<commit_msg>Removed empty line<commit_after>module.exports = function(string, length, options) {
  // Initially handle the params
  if (typeof string !== 'string') return '';
  if (typeof length !== 'number' || length < 0) return string;
  if (typeof options !== 'object') options = {};

  // Base settings
  var settings = {
    threshold: length,
    appendix: '…',
  };

  // Overwrite settings with options if they are valid
  if (options.threshold && typeof options.threshold === 'number' && options.threshold > 0) settings.threshold = options.threshold;
  if (typeof options.appendix === 'string') settings.appendix = options.appendix;

  // Check if string is long enough for truncation
  if (string.length > (settings.threshold || length) && string.length > length) {
    var shortenedString = string.substring(0, length);
    return shortenedString + settings.appendix;
  }

  // Otherwise return string as is
  return string;
};
{'fraction_non_alphanumeric': 0.13095238095238096, 'fraction_numerical': 0.003246753246753247, 'mean_word_length': 3.765463917525773, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7495476', 'n_tokens_mistral': 509, 'n_tokens_neox': 477, 'n_words': 172}