<commit_before>import ExportMap from '../core/getExports'

module.exports = function (context) {
  const defaults = new Set()
      , named = new Map()

  function addNamed(name, node) {
    let nodes = named.get(name)

    if (nodes == null) {
      nodes = new Set()
      named.set(name, nodes)
    }

    nodes.add(node)
  }

  return {
    'ExportDefaultDeclaration': function (node) {
      defaults.add(node)
    },

    'ExportSpecifier': function (node) {
      addNamed(node.exported.name, node.exported)
    },

    'ExportNamedDeclaration': function (node) {
      if (node.declaration == null) return

      if (node.declaration.id != null) {
        addNamed(node.declaration.id.name, node.declaration.id)
      }

      if (node.declaration.declarations != null) {
        for (let declaration of node.declaration.declarations) {
          if (declaration.id == null) continue
          addNamed(declaration.id.name, declaration.id)
        }
      }
    },

    'ExportAllDeclaration': function (node) {
      let remoteExports = new ExportMap(context.settings)
<commit_msg>critical bugfix in export rule<commit_after>import ExportMap from '../core/getExports'

module.exports = function (context) {
  const defaults = new Set()
      , named = new Map()

  function addNamed(name, node) {
    let nodes = named.get(name)

    if (nodes == null) {
      nodes = new Set()
      named.set(name, nodes)
    }

    nodes.add(node)
  }

  return {
    'ExportDefaultDeclaration': function (node) {
      defaults.add(node)
    },

    'ExportSpecifier': function (node) {
      addNamed(node.exported.name, node.exported)
    },

    'ExportNamedDeclaration': function (node) {
      if (node.declaration == null) return

      if (node.declaration.id != null) {
        addNamed(node.declaration.id.name, node.declaration.id)
      }

      if (node.declaration.declarations != null) {
        for (let declaration of node.declaration.declarations) {
          if (declaration.id == null) continue
          addNamed(declaration.id.name, declaration.id)
        }
      }
    },

    'ExportAllDeclaration': function (node) {
      let remoteExports = new ExportMap(context)

{'fraction_non_alphanumeric': 0.12385740402193784, 'fraction_numerical': 0.0, 'mean_word_length': 2.576797385620915, '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': '468728', 'n_tokens_mistral': 681, 'n_tokens_neox': 657, 'n_words': 148}