<commit_before>
/*jslint browser:true, node:true*/

'use strict';

/**
 * Module Dependencies
 */


var View = require('./view');
var store = require('./store');

/**
 * Creates and registers a
 * FruitMachine view constructor.
 *
 * @param  {Object|View}
 * @return {View}
 */
module.exports = function(props) {
  var module = props.module || 'undefined';
  var view;

  // Remove the module key
  delete props.module;
  props._module = module;

  // If an existing FruitMachine.View
  // has been passed in, use that.
  // If just an object literal has
  // been passed in then we extend the
  // default FruitMachine.View prototype
  // with the properties passed in.
  view = (props.__super__)
    ? props
    : View.extend(props);

  // Store the module by module type
  // so that module can be referred to
  // by just a string in layout definitions
  return store.modules[module] = view;
};

/**
 * Removes a module
 * from the module store.
 *
 * If no module key is passed
 * the entire store is cleared.
 *
 * @param  {String|undefined} module
 * @api public
 */
module.exports.clear = function(module) {
  if (module) delete store.modules[module];
  else store.modules = {};
};<commit_msg>Remove API to clear stored modules<commit_after>
/*jslint browser:true, node:true*/

'use strict';

/**
 * Module Dependencies
 */

var View = require('./view');
var store = require('./store');

/**
 * Creates and registers a
 * FruitMachine view constructor.
 *
 * @param  {Object|View}
 * @return {View}
 */
module.exports = function(props) {
  var module = props.module || 'undefined';
  var view;

  // Move the module key
  delete props.module;
  props._module = module;

  // If an existing FruitMachine.View
  // has been passed in, use that.
  // If just an object literal has
  // been passed in then we extend the
  // default FruitMachine.View prototype
  // with the properties passed in.
  view = (props.__super__)
    ? props
    : View.extend(props);

  // Store the module by module type
  // so that module can be referred to
  // by just a string in layout definitions
  return store.modules[module] = view;
};
{'fraction_non_alphanumeric': 0.12447158290277126, 'fraction_numerical': 0.0, 'mean_word_length': 3.0037593984962405, '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': '7078015', 'n_tokens_mistral': 636, 'n_tokens_neox': 620, 'n_words': 234}