<commit_before>var defaults = require('lodash.defaults')
module.exports = function (str, opts) {
  var options = defaults({}, opts, { min: 1, max: 140, ellipsis: '...'})
  return str.split('.').reduce((candidate, sentence) => {
    return (candidate.length < options.min)
           ? candidate.concat(`${sentence}.`)
           : (candidate.length > (options.max + options.ellipsis.length))
             ? candidate.slice(0, options.max) + options.ellipsis
             : candidate.trim()
  }, '')
}<commit_msg>avoid arrow function in favor of ancient JavaScript support<commit_after>var defaults = require('lodash.defaults')
module.exports = function (str, opts) {
  var options = defaults({}, opts, { min: 1, max: 140, ellipsis: '...'})
  return str.split('.').reduce(function (candidate, sentence) {
    return (candidate.length < options.min)
           ? candidate.concat(`${sentence}.`)
           : (candidate.length > (options.max + options.ellipsis.length))
             ? candidate.slice(0, options.max) + options.ellipsis
             : candidate.trim()
  }, '')
}
{'fraction_non_alphanumeric': 0.1691449814126394, 'fraction_numerical': 0.00929368029739777, 'mean_word_length': 3.1264367816091956, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '2379600', 'n_tokens_mistral': 327, 'n_tokens_neox': 312, 'n_words': 69}