{"size": 1230, "ext": "js", "max_stars_repo_path": "src/query/browser.js", "max_stars_repo_name": "jsa-research/jsblocks", "max_stars_repo_stars_event_min_datetime": "2015-03-05T08:08:36.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-21T22:15:41.000Z", "max_issues_repo_path": "src/query/browser.js", "max_issues_repo_name": "digitalcrafted/jsblocks", "max_issues_repo_issues_event_min_datetime": "2015-04-23T13:35:02.000Z", "max_issues_repo_issues_event_max_datetime": "2017-05-10T06:39:26.000Z", "max_forks_repo_path": "src/query/browser.js", "max_forks_repo_name": "digitalcrafted/jsblocks", "max_forks_repo_forks_event_min_datetime": "2015-04-23T15:28:24.000Z", "max_forks_repo_forks_event_max_datetime": "2021-01-30T16:50:57.000Z"}
{"max_stars_count": 3208, "max_issues_count": 140, "max_forks_count": 175, "avg_line_length": 30.75, "max_line_length": 136, "alphanum_fraction": 0.5796747967}
define([
  '../core'
], function (blocks) {
  var browser = {};

  function parseVersion(matches) {
    if (matches) {
      return parseFloat(matches[1]);
    }
    return undefined;
  }

  if (typeof document !== 'undefined') {
    blocks.extend(browser, {
      IE: document && (function () {
        var version = 3;
        var div = document.createElement('div');
        var iElems = div.getElementsByTagName('i');

        /* jshint noempty: false */
        // Disable JSHint error: Empty block
        // Keep constructing conditional HTML blocks until we hit one that resolves to an empty fragment
        while (
          div.innerHTML = '<!--[if gt IE ' + (++version) + ']><i></i><![endif]-->',
          iElems[0]
          ) { }
        return version > 4 ? version : undefined;
      }()),

      Opera: (window && window.navigator && window.opera && window.opera.version && parseInt(window.opera.version(), 10)) || undefined,

      Safari: window && window.navigator && parseVersion(window.navigator.userAgent.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),

      Firefox: window && window.navigator && parseVersion(window.navigator.userAgent.match(/Firefox\/([^ ]*)/))
    });
  }

  return browser;
});
