<commit_before>var Joi = require('joi');

var JoiValidationStrategy = {
  validate: function(joiSchema, data, key) {
    joiSchema = joiSchema === undefined ? {} : joiSchema;
    data = data === undefined ? {} : data;
    var errors = this.format(Joi.validate(data, joiSchema, {
      abortEarly: false,
      allowUnknown: true,
    }));
    if (key === undefined) {
      Object.keys(joiSchema).forEach(function(key) {
        errors[key] = errors[key] || [];
      });
      Object.keys(data).forEach(function(key) {
        errors[key] = errors[key] || [];
      });
      return errors;
    } else {
      return errors[key] || [];
    }
  },

  format: function(joiResult) {
    if (joiResult.error !== null) {
      return joiResult.error.details.reduce(function(memo, detail) {
        if (!Array.isArray(memo[detail.path])) {
          memo[detail.path] = [];<commit_msg>Explicitly defined joi options<commit_after>var Joi = require('joi');

var JoiValidationStrategy = {
  validate: function(joiSchema, data, key) {
    joiSchema = joiSchema || {};
    data = data || {};
    var joiOptions = {
      abortEarly: false,
      allowUnknown: true,
    };

    var errors = this.format(Joi.validate(data, joiSchema, joiOptions));
    if (key === undefined) {
      Object.keys(joiSchema).forEach(function(key) {
        errors[key] = errors[key] || [];
      });
      Object.keys(data).forEach(function(key) {
        errors[key] = errors[key] || [];
      });
      return errors;
    } else {
      return errors[key] || [];
    }
  },

  format: function(joiResult) {
    if (joiResult.error !== null) {
      return joiResult.error.details.reduce(function(memo, detail) {
        if (!Array.isArray(memo[detail.path])) {
          memo[detail.path] = [];
{'fraction_non_alphanumeric': 0.16534541336353342, 'fraction_numerical': 0.0, 'mean_word_length': 2.767590618336887, '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': '3480472', 'n_tokens_mistral': 567, 'n_tokens_neox': 568, 'n_words': 102}