<commit_before>module.exports = function(validatorSet, model) {
  var errors = [];
  var keys = Object.keys(validatorSet);

  for (var i=0; i<keys.length; i++) {
    var validator = validatorSet[keys[i]];
    if (!validator.shouldRun || !validator.shouldRun(model)) continue;

    var result = validator.validate(model);
    if (result === true) continue;
    var errorMsg = (result === false) ? result.msg : result;
    errors.push({
      attribute: keys[i],
      msg: errorMsg
    });
  }

  return errors;
};<commit_msg>Bugfix for Validation runner<commit_after>module.exports = function(validatorSet, model) {
  var errors = [];
  var keys = Object.keys(validatorSet);

  for (var i=0; i<keys.length; i++) {
    var validator = validatorSet[keys[i]];
    if (validator.shouldRun && !validator.shouldRun(model)) continue;

    var result = validator.validate(model);
    if (result === true) continue;
    var errorMsg = (result === false) ? validator.msg : result;
    errors.push({
      attribute: keys[i],
      msg: errorMsg
    });
  }

  return errors;
};
{'fraction_non_alphanumeric': 0.15089034676663543, 'fraction_numerical': 0.0018744142455482662, 'mean_word_length': 3.4873949579831933, 'pattern_counts': {'":': 0, '<': 5, '<?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': '350492', 'n_tokens_mistral': 340, 'n_tokens_neox': 337, 'n_words': 83}