<commit_before>'use strict';

var utils = require('../utils');

/**
 * Add a `renameKey` function to the given `app` instance.
 */

module.exports = function() {
  return function(app) {
    app.define('renameKey', function renameKey(key, view, fn) {
      if (typeof view === 'function') {
        fn = view;
        view = {path: key};
      }
      if (typeof key === 'function') {
        fn = key;
        key = null;
      }
      if (typeof fn !== 'function') {
        fn = this.option('renameKey') || utils.identity;
      }
      this.options.renameKey = fn;
      if (typeof key === 'string') {
        return fn.call(this, key, view);
      }
      return this;
    }.bind(app));
  };
};
<commit_msg>formatting for clarity<commit_after>'use strict';

var utils = require('../utils');

/**
 * Add a `renameKey` function to the given `app` instance.
 */

module.exports = function() {
  return function(app) {
    app.define('renameKey', function renameKey(key, view, fn) {
      if (typeof view === 'function') {
        fn = view;
        view = { path: key };
      }
      if (typeof key === 'function') {
        fn = key;
        key = null;
      }
      if (typeof fn !== 'function') {
        fn = this.option('renameKey') || utils.identity;
      }

      this.options.renameKey = function(key, view) {
        return fn(key, view);
      };

      if (typeof key === 'string') {
        return fn.call(this, key, view);
      }
      return this;
    }.bind(app));
  };
};

{'fraction_non_alphanumeric': 0.16934404283801874, 'fraction_numerical': 0.0, 'mean_word_length': 2.0952380952380953, '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': '2065832', 'n_tokens_mistral': 469, 'n_tokens_neox': 474, 'n_words': 126}