<commit_before>const _ = require('lodash')
const createConsoleTree = require('big-tree-cli')
const lib = require('./')

module.exports = {

  configurePacks (packs) {
    packs.inspect = () => {
      return createConsoleTree(lib.TreeBuilder.getTrailpackTree(packs))
    }

    _.each(packs, pack => {
      pack.inspect = () => {
        return `
      ---------------------------------------------------------------
        Trailpack:
          Name            : ${pack.name}
          Version         : ${pack.pkg.version}
          Description     : ${pack.pkg.description}
      ---------------------------------------------------------------`
      }
    })
  },

  configureApi (api) {
    api.controllers.inspect = () => {
      return createConsoleTree(lib.TreeBuilder.getControllerTree(api.controllers))
    }
    api.services.inspect = () => {
      return createConsoleTree(lib.TreeBuilder.getServiceTree(api.services))
    }
    api.models.inspect = () => {
      return createConsoleTree(lib.TreeBuilder.getModelTree(api.models))
    }
    api.policies.inspect = () => {
      return createConsoleTree(lib.TreeBuilder.getPoliciesTree(api.policies))
    }
    api.inspect = () => {
      return createConsoleTree(lib.TreeBuilder.getApiTree(api))
    }
  },

  configureApp (app) {
    app.inspect = () => {
      return `
      ---------------------------------------------------------------
        Basic Info
          Name              : ${app.pkg.name}
          Version           : ${app.pkg.version}
          Environment       : ${process.env.NODE_ENV}

        API Info
          Models            : ${_.keys(_.omit(app.api.models, 'inspect'))}
          Controllers       : ${_.keys(_.omit(app.api.controllers, 'inspect'))}
          Services          : ${_.keys(_.omit(app.api.services, 'inspect'))}
          Policies          : ${_.keys(_.omit(app.api.policies, 'inspect'))}
      ---------------------------------------------------------------
    `
    }
  }
}
<commit_msg>[fix] set inspect property non-enumerable<commit_after>const _ = require('lodash')
const createConsoleTree = require('big-tree-cli')
const lib = require('./')

module.exports = {

  configurePacks (packs) {
    Object.defineProperty(packs, 'inspect', {
      enumerable: false,
      value () {
        return createConsoleTree(lib.TreeBuilder.getTrailpackTree(packs))

        _.each(packs, pack => {
          Object.defineProperty(pack, 'inspect', {
            enumerable: false,
            value () {
              return `
            ---------------------------------------------------------------
              Trailpack:
                Name            : ${pack.name}
                Version         : ${pack.pkg.version}
                Description     : ${pack.pkg.description}
            ---------------------------------------------------------------`
            }
          })
        })
      }
    })
  },

  configureApi (api) {
    Object.defineProperty(api.controllers, 'inspect', {
      enumerable: false,
      value () {
        return createConsoleTree(lib.TreeBuilder.getControllerTree(api.controllers))
      }
    })
    Object.defineProperty(api.services, 'inspect', {
      enumerable: false,
      value () {
        return createConsoleTree(lib.TreeBuilder.getServiceTree(api.services))
      }
    })
    Object.defineProperty(api.models, 'inspect', {
      enumerable: false,
      value () {
        return createConsoleTree(lib.TreeBuilder.getModelTree(api.models))
      }
    })
    Object.defineProperty(api.policies, 'inspect', {
      enumerable: false,
      value () {
        return createConsoleTree(lib.TreeBuilder.getPoliciesTree(api.policies))
      }
    })
    Object.defineProperty(api, 'inspect', {
      enumerable: false,
      value () {
        return createConsoleTree(lib.TreeBuilder.getApiTree(api))
      }
    })
  },

  configureApp (app) {
    Object.defineProperty(app, 'inspect', {
      enumerable: false,
      value () {
        return `
        ---------------------------------------------------------------
          Basic Info
            Name              : ${app.pkg.name}
            Version           : ${app.pkg.version}
            Environment       : ${process.env.NODE_ENV}

          API Info
            Models            : ${_.keys(app.api.models)}
            Controllers       : ${_.keys(app.api.controllers)}
            Services          : ${_.keys(app.api.services)}
            Policies          : ${_.keys(app.api.policies)}
        ---------------------------------------------------------------
      `
      }
    })
  }
}

{'fraction_non_alphanumeric': 0.22758770030316156, 'fraction_numerical': 0.0, 'mean_word_length': 1.354230377166157, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4575132', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1218, 'n_words': 168}