<commit_before>var eventBuilder = require('./event-builder');
var idGeneratorDate = require('./id-generator-date');
var inMemoryStore = require('./in-memory-store');

module.exports = function(options){
  options = options || {};
  var store = options.store || inMemoryStore;
  var idGenerator = options.idGenerator || idGeneratorDate;

  function storeEvent(eventData){
    var event = eventBuilder(eventData).validate().withId(idGenerator).build();
    store.save(event);
  }<commit_msg>add id before validate<commit_after>var eventBuilder = require('./event-builder');
var idGeneratorDate = require('./id-generator-date');
var inMemoryStore = require('./in-memory-store');

module.exports = function(options){
  options = options || {};
  var store = options.store || inMemoryStore;
  var idGenerator = options.idGenerator || idGeneratorDate;

  function storeEvent(eventData){
    var event = eventBuilder(eventData).withId(idGenerator).validate().build();
    store.save(event);
  }
{'fraction_non_alphanumeric': 0.14994934143870314, 'fraction_numerical': 0.0, 'mean_word_length': 5.253164556962025, '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': '6219658', 'n_tokens_mistral': 270, 'n_tokens_neox': 266, 'n_words': 57}