<commit_before>import _ from 'lodash';

export default function autoHtml(templateParts, ...values) {
  const parts = new Array(templateParts.length*2-1);
  parts[0] = templateParts[0];
  for (let i=0, len=values.length; i<len; i++) {
    const value = values[i];
    parts[2*i+1] = value.__html ? value.__html : _.escape(value);
    parts[2*i+2] = templateParts[i+1];
  }
  return parts.join('');
}<commit_msg>Import lodash's escape function directly.<commit_after>import escape from "lodash/string/escape";

export default function autoHtml(templateParts, ...values) {
  const parts = new Array(templateParts.length*2-1);
  parts[0] = templateParts[0];
  for (let i=0, len=values.length; i<len; i++) {
    const value = values[i];
    parts[2*i+1] = value.__html ? value.__html : escape(value);
    parts[2*i+2] = templateParts[i+1];
  }
  return parts.join('');
}
{'fraction_non_alphanumeric': 0.1699421965317919, 'fraction_numerical': 0.023121387283236993, 'mean_word_length': 4.515923566878981, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1591113', 'n_tokens_mistral': 303, 'n_tokens_neox': 298, 'n_words': 67}