<commit_before>var async = require('async');
var passport = require('passport');
var utils = require('prana').utils;

var rest = module.exports;

/**
 * The route() hook.
 */
rest.route = function(routes, callback) {
  var application = this.application;
  var newRoutes = {};

  var validationResponseCallback = function(callback) {
    return function(error, item, errors) {
      if (error) {
        // Application error.
        return callback(error);
      }
      if (errors && errors.length > 0) {
        // Validation errors.
        return callback(null, errors, 400);
      }
      // Validation passed.
      callback(null, item);
    };
  };

  async.each(Object.keys(application.types), function(typeName, next) {
    var type = application.types[typeName];
    var typeModel = application.type(typeName);

    // Default path to type name.
    if (!type.path) {
      type.path = '/' + typeName;
    }<commit_msg>Added name attribute in types elements<commit_after>var async = require('async');
var passport = require('passport');
var utils = require('prana').utils;

var rest = module.exports;

/**
 * The route() hook.
 */
rest.route = function(routes, callback) {
  var application = this.application;
  var newRoutes = {};

  var validationResponseCallback = function(callback) {
    return function(error, item, errors) {
      if (error) {
        // Application error.
        return callback(error);
      }
      if (errors && errors.length > 0) {
        // Validation errors.
        return callback(null, errors, 400);
      }
      // Validation passed.
      callback(null, item);
    };
  };

  async.each(Object.keys(application.types), function(typeName, next) {
    var type = application.types[typeName];
    var typeModel = application.type(typeName);

    // Default path to type name.
    if (!type.path) {
      type.path = '/' + typeName;
    }
    
    // Added default name
    type.name = typeName;
{'fraction_non_alphanumeric': 0.1364572605561277, 'fraction_numerical': 0.004119464469618949, 'mean_word_length': 2.6869070208728654, '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': '2225078', 'n_tokens_mistral': 574, 'n_tokens_neox': 555, 'n_words': 146}