<commit_before>const _ = require('underscore')

module.exports = function ($metaTags) {
  var extractedMetaTags = {}
  if ($metaTags) {
    _.each($metaTags, function ($meta) {
      if ($meta.attribs && $meta.attribs.name && $meta.attribs.content) {
        extractedMetaTags[$meta.attribs.name] = $meta.attribs.content
      }
      if ($meta.attribs && $meta.attribs.property && $meta.attribs.content) {
        extractedMetaTags[$meta.attribs.property] = $meta.attribs.content
      }
    })
  }
  return extractedMetaTags
}<commit_msg>refactor underscore out of extract-meta-tags<commit_after>module.exports = function ($metaTags) {
  var extracted = {}
  if ($metaTags) {
    Object.keys($metaTags).forEach(function (key, index) {
      if ($metaTags[key].attribs && $metaTags[key].attribs.name && $metaTags[key].attribs.content) {
        extracted[$metaTags[key].attribs.name] = $metaTags[key].attribs.content
      }
      if ($metaTags[key].attribs && $metaTags[key].attribs.property && $metaTags[key].attribs.content) {
        extracted[$metaTags[key].attribs.property] = $metaTags[key].attribs.content
      }
    })
  }
  return extracted
}
{'fraction_non_alphanumeric': 0.16031195840554593, 'fraction_numerical': 0.0, 'mean_word_length': 3.63855421686747, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1746247', 'n_tokens_mistral': 391, 'n_tokens_neox': 392, 'n_words': 54}