<commit_before>'use strict';

var _ = require('lodash');

/**
* Format where expression.
*
* @param {string[]|string} keys
*/

module.exports = function (keys, query, jsonkeys) {
  var where = _.omit(query, keys);
  where = _.omit(where, function(value, key) {
    var omit = true;
    _.each(jsonkeys, function(jsonkey) {
      if (jsonkey + '.' == key.substring(0, jsonkey.length + 1)) {
        omit = false;
      }
    });
    return omit;
  });

  var whereRaw = '';
  _.each(where, function(value, key) {
    var tab = key.split('.');

    if (!whereRaw) {
      whereRaw = tab[0] + "->>'" + tab[1] + "' = '" + value + "'";
    } else {
      whereRaw += ' AND ' + tab[0] + "->>'" + tab[1] + "' = '" + value + "'";
    }
  });

  return whereRaw;
};<commit_msg>Modif if with ===<commit_after>'use strict';

var _ = require('lodash');

/**
* Format where expression.
*
* @param {string[]|string} keys
*/

module.exports = function (keys, query, jsonkeys) {
  var where = _.omit(query, keys);
  where = _.omit(where, function(value, key) {
    var omit = true;
    _.each(jsonkeys, function(jsonkey) {
      if (jsonkey + '.' === key.substring(0, jsonkey.length + 1)) {
        omit = false;
      }
    });
    return omit;
  });

  var whereRaw = '';
  _.each(where, function(value, key) {
    var tab = key.split('.');

    if (!whereRaw) {
      whereRaw = tab[0] + "->>'" + tab[1] + "' = '" + value + "'";
    } else {
      whereRaw += ' AND ' + tab[0] + "->>'" + tab[1] + "' = '" + value + "'";
    }
  });

  return whereRaw;
};
{'fraction_non_alphanumeric': 0.21933809214795588, 'fraction_numerical': 0.007787151200519144, 'mean_word_length': 2.552995391705069, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1976235', 'n_tokens_mistral': 569, 'n_tokens_neox': 550, 'n_words': 121}