<commit_before>'use strict';

const { transtype, mapValues, mapKeys } = require('../../../utilities');

// Normalize params|settings
const transformValues = function ({ values }) {
  const valuesA = mapValues(values, value => transtype(value));
  const valuesB = mapKeys(valuesA, (value, name) => name.toLowerCase());
  return valuesB;
};

module.exports = {
  transformValues,
};<commit_msg>Simpler boolean settings<commit_after>'use strict';

const { transtype, mapValues, mapKeys } = require('../../../utilities');

// Normalize params|settings
const transformValues = function ({ values }) {
  // Transform e.g. ?settings.mysettings to ?settings.mysettings=true
  const valuesA = mapValues(values, value => (value == null ? true : value));
  // Transform e.g. 'Number' to actual number
  const valuesB = mapValues(valuesA, value => transtype(value));
  // Case-insensitive
  const valuesC = mapKeys(valuesB, (value, name) => name.toLowerCase());
  return valuesC;
};

module.exports = {
  transformValues,
};
{'fraction_non_alphanumeric': 0.1590909090909091, 'fraction_numerical': 0.0, 'mean_word_length': 4.446236559139785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '4038549', 'n_tokens_mistral': 299, 'n_tokens_neox': 300, 'n_words': 78}