<commit_before>const mimeTypeRegex = /^[\w+-\.]+\/[\w+-\.]+/;

export function getContentType(value = '') {
  const contentType = value.match(mimeTypeRegex);

  return contentType ? contentType[0] : null;
}

export function getHighlightedText(text, term) {
  if (!term) {
    return text;
  }

  const regex = new RegExp(term, 'ig');

  return text.replace(regex, `<span style="background-color: #f7f2d7; padding: 2px 0;">$&</span>`);
}

export function convertDelayToSeconds(delay) {
  return `${(delay / 1000).toFixed(2)}s`;
}
<commit_msg>Add default value to convertDelayToSeconds<commit_after>const mimeTypeRegex = /^[\w+-\.]+\/[\w+-\.]+/;

export function getContentType(value = '') {
  const contentType = value.match(mimeTypeRegex);

  return contentType ? contentType[0] : null;
}

export function getHighlightedText(text, term) {
  if (!term) {
    return text;
  }

  const regex = new RegExp(term, 'ig');

  return text.replace(regex, `<span style="background-color: #f7f2d7; padding: 2px 0;">$&</span>`);
}

export function convertDelayToSeconds(delay = 0) {
  return `${(delay / 1000).toFixed(2)}s`;
}

{'fraction_non_alphanumeric': 0.18026905829596412, 'fraction_numerical': 0.02062780269058296, 'mean_word_length': 4.497536945812808, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4496514', 'n_tokens_mistral': 411, 'n_tokens_neox': 385, 'n_words': 85}