<commit_before>'use strict';

var path = require('path');
var merge = require('lodash')._.merge;

/**
 * Getter for getting stored values from `verb.env`, a read-only
 * object that stores the project's package.json before it's modified.
 *
 * ```js
 * console.log(verb.env.name);
 * //=> 'my-project'
 * ```
 *
 * @return {*} The value of specified property.
 * @api public
 */

module.exports = function env_(verb) {
  var env = verb.env || verb.option('env') || require(path.resolve('package.json'));
  merge(env, env.verb.data);

  Object.defineProperty(verb, 'env', {
    get: function () {
      return env;
    },
    set: function () {
      console.log('verb.env is read-only and cannot be modified.');
    }
  });
};
<commit_msg>ensure `verb.env.verb` object exists (package.json)<commit_after>'use strict';

var path = require('path');
var merge = require('lodash')._.merge;

/**
 * Getter for getting stored values from `verb.env`, a read-only
 * object that stores the project's package.json before it's modified.
 *
 * ```js
 * console.log(verb.env.name);
 * //=> 'my-project'
 * ```
 *
 * @return {*} The value of specified property.
 * @api public
 */

module.exports = function env_(verb) {
  var env = verb.env || verb.option('env') || require(path.resolve('package.json'));
  merge(env, (env.verb && env.verb.data) || {});

  Object.defineProperty(verb, 'env', {
    get: function () {
      return env;
    },
    set: function () {
      console.log('verb.env is read-only and cannot be modified.');
    }
  });
};

{'fraction_non_alphanumeric': 0.18359375, 'fraction_numerical': 0.0, 'mean_word_length': 3.3295774647887324, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2303707', 'n_tokens_mistral': 495, 'n_tokens_neox': 491, 'n_words': 131}