{"size": 582, "ext": "js", "max_stars_repo_path": "olico-match/src/olico-timewindow.js", "max_stars_repo_name": "argifood/OLICO", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "olico-match/src/olico-timewindow.js", "max_issues_repo_name": "argifood/OLICO", "max_issues_repo_issues_event_min_datetime": "2019-04-08T15:44:25.000Z", "max_issues_repo_issues_event_max_datetime": "2019-04-09T19:08:06.000Z", "max_forks_repo_path": "olico-match/src/olico-timewindow.js", "max_forks_repo_name": "argifood/OLICO", "max_forks_repo_forks_event_min_datetime": "2019-04-08T16:05:50.000Z", "max_forks_repo_forks_event_max_datetime": "2019-04-09T11:25:19.000Z"}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": 2, "avg_line_length": 29.1, "max_line_length": 68, "alphanum_fraction": 0.6924398625}

const OlicoTimewindow = function OlicoTimeWindow(option){
  typeof option.validate === 'function' && (option.validate(option))
  this.provide = option.provide
  this.consume = option.consume
  this.hook = option.hook
}

const timewindowFactory = function timewindowFactoryOlico(option){
  const opt = option || {}
  !opt.provide && (opt.provide = {from: new Date(), to: new Date()})
  !opt.consume && (opt.consume = {from: new Date(), to: new Date()})
  !opt.hook && (opt.hook = [])
  return new OlicoTimewindow(opt)
}

module.exports = {
  timewindowFactory: timewindowFactory
};
