<commit_before>import ASTVisitor from "./ASTVisitor"

/**
  * @example
  * const visitor = new ExportNamedDeclarationVisitor(nestedVisitors)
  * @see https://github.com/babel/babel/blob/master/doc/ast/spec.md#exportnameddeclaration
  * @see https://github.com/babel/babel/tree/master/packages/babel-types#texportnameddeclarationdeclaration-specifiers-source
  * @see https://github.com/babel/babel/blob/master/packages/babel-types/src/definitions/es2015.js#L133
  */
export default class ExportNamedDeclarationVisitor extends ASTVisitor {

  /** Create an instance of ExportNamedDeclarationVisitor
    * @param {Object} nestedVisitors
    */
  constructor(...args) {
    super(...args)
    /** @type {Object} */

  }

  /** Visit path
    * @abstract
    * @param {Object} path
    * @param {Object} state
    */
  enter(path, state) {
    path.traverse(this.nestedVisitors, state)
  }

  /** Leave path
    * @abstract
    * @param {Object} path
    * @param {Object} state
    */
  exit(path, state) {

  }
}<commit_msg>#4 extending NestedVisitor<commit_after>import NestedVisitor from './NestedVisitor'

/**
  * @example
  * const visitor = new ExportNamedDeclarationVisitor(nestedVisitors)
  * @see https://github.com/babel/babel/blob/master/doc/ast/spec.md#exportnameddeclaration
  * @see https://github.com/babel/babel/tree/master/packages/babel-types#texportnameddeclarationdeclaration-specifiers-source
  * @see https://github.com/babel/babel/blob/master/packages/babel-types/src/definitions/es2015.js#L133
  */
export default class ExportNamedDeclarationVisitor extends NestedVisitor {

  /** Visit Program node
    * @param {Object} path
    * @param {Object} state
    */
  enter(path, state) {
    super.enter(path, state)

    switch(true) {
      case path.parent.type !== 'Program':
        throw(new Error('Invalid `path.parent`'))
        break
    }

    if(Object.keys(this.nestedVisitors).length) {
      path.traverse(this.nestedVisitors, state)
    }
  }

}
{'fraction_non_alphanumeric': 0.13643254168772107, 'fraction_numerical': 0.007579585649317837, 'mean_word_length': 3.5517241379310347, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, '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': '2393185', 'n_tokens_mistral': 651, 'n_tokens_neox': 608, 'n_words': 104}