{"size": 810, "ext": "js", "max_stars_repo_path": "src/util/ringaEvent.js", "max_stars_repo_name": "jung-digital/ring", "max_stars_repo_stars_event_min_datetime": "2017-12-18T15:08:53.000Z", "max_stars_repo_stars_event_max_datetime": "2019-09-19T02:13:28.000Z", "max_issues_repo_path": "src/util/ringaEvent.js", "max_issues_repo_name": "ringa-js/ringa", "max_issues_repo_issues_event_min_datetime": "2017-01-24T17:54:06.000Z", "max_issues_repo_issues_event_max_datetime": "2017-01-24T18:19:44.000Z", "max_forks_repo_path": "src/util/ringaEvent.js", "max_forks_repo_name": "jung-digital/ring", "max_forks_repo_forks_event_min_datetime": "2017-10-08T14:26:41.000Z", "max_forks_repo_forks_event_max_datetime": "2017-10-08T14:26:41.000Z"}
{"max_stars_count": 5, "max_issues_count": 12, "max_forks_count": 1, "avg_line_length": 36.8181818182, "max_line_length": 110, "alphanum_fraction": 0.6185185185}

export function mergeRingaEventDetails(ringaEvent, detail, warnOnOverwrite = true, assignToRingEvent = true) {
  let nextDetail = Object.assign({}, detail); // Make sure we clone!!
  let prevDetail = ringaEvent.detail || {};
  
  for(var key in prevDetail) {
    if (prevDetail.hasOwnProperty(key)) {
      if (__DEV__ && nextDetail[key]!==undefined && (warnOnOverwrite || ringaEvent.debug)) {
        console.warn(`mergeRingaEventDetails(): overwriting property '${key}' on ${ringaEvent}.\n` +
                     `Old value: ${prevDetail[key]}\n` +
                     `New value: ${nextDetail[key]}\n`);
      }
      if (nextDetail[key]===undefined) {
        nextDetail[key] = prevDetail[key];
      }
    }
  }
  if (assignToRingEvent) {
    ringaEvent.detail = nextDetail;
  }
  return nextDetail;
};