<commit_before>module.exports = function required(schema, tpl) {
  if (!Array.isArray(schema.required)) {
    return;
  }

  tpl('if (typeof %s === \'object\') {', tpl.data);
  schema.required.forEach((name) => {
    const condition = '!%s.hasOwnProperty("%s")';
    const error = tpl.error('required', name);<commit_msg>fix(validator): Add not array required check #44<commit_after>module.exports = function required(schema, tpl) {
  if (!Array.isArray(schema.required)) {
    return;
  }

  tpl('if (typeof %s === \'object\' && !Array.isArray(%s)) {', tpl.data);
  schema.required.forEach((name) => {
    const condition = '!%s.hasOwnProperty("%s")';
    const error = tpl.error('required', name);
{'fraction_non_alphanumeric': 0.2017167381974249, 'fraction_numerical': 0.002861230329041488, 'mean_word_length': 4.384615384615385, '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': '1652288', 'n_tokens_mistral': 233, 'n_tokens_neox': 233, 'n_words': 46}