<commit_before>function stripWs(s) {
  return s.replace(/\s+/g, '');
}

function createLocals(which, viewsDir, locals) {
  if (!locals) locals = {};
  var opts = {};
  if (which === 'express3') {
    opts.settings = {
      views: viewsDir
    };
    opts.cache = process.env.NODE_ENV === 'production';
    for (var k in locals) {
      if (!locals.hasOwnProperty(k)) continue;
      opts[k] = locals[k];<commit_msg>Added support for express4 in test helpers createLocals<commit_after>function stripWs(s) {
  return s.replace(/\s+/g, '');
}

function createLocals(which, viewsDir, locals) {
  if (!locals) locals = {};
  var opts = {};
  if (which === 'express3' || which === 'express4') {
    opts.settings = {
      views: viewsDir
    };
    opts.cache = process.env.NODE_ENV === 'production';
    for (var k in locals) {
      if (!locals.hasOwnProperty(k)) continue;
      opts[k] = locals[k];
{'fraction_non_alphanumeric': 0.17260579064587972, 'fraction_numerical': 0.004454342984409799, 'mean_word_length': 3.240566037735849, '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': '5168112', 'n_tokens_mistral': 305, 'n_tokens_neox': 302, 'n_words': 72}