<commit_before>(function () {
  'use strict';

  exports = module.exports = function (val) {
    if (val instanceof Date) {
      // Val is already a date
      return val;
    }

    if (val === 'now') {
      return new Date();
    }

    if (typeof val === 'number' || typeof val === 'string') {
      // Get date from timestamp
      return new Date(val);
    }

    return null;
  };
})();<commit_msg>getDate() helper now accepts a function<commit_after>(function () {
  'use strict';

  exports = module.exports = function (val) {
    if (val instanceof Date) {
      // Val is already a date
      return val;
    }

    if (val === 'now') {
      return new Date();
    }

    if (typeof val === 'number' || typeof val === 'string') {
      // Get date from timestamp
      return new Date(val);
    }

    if (typeof val === 'function') {
      return val();
    }

    return null;
  };
})();
{'fraction_non_alphanumeric': 0.1574279379157428, 'fraction_numerical': 0.0, 'mean_word_length': 2.0924657534246576, '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': '2321516', 'n_tokens_mistral': 278, 'n_tokens_neox': 268, 'n_words': 91}