{"size": 547, "ext": "js", "max_stars_repo_path": "src/components/availableScreenResolution.js", "max_stars_repo_name": "markogresak/fingerprintjs2", "max_stars_repo_stars_event_min_datetime": "2021-05-15T21:26:13.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-06T02:23:20.000Z", "max_issues_repo_path": "src/components/availableScreenResolution.js", "max_issues_repo_name": "markogresak/fingerprintjs2", "max_issues_repo_issues_event_min_datetime": "2021-05-10T16:48:33.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-01T23:51:56.000Z", "max_forks_repo_path": "src/components/availableScreenResolution.js", "max_forks_repo_name": "rkostko/fingerprint", "max_forks_repo_forks_event_min_datetime": "2021-02-03T12:08:38.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-06T02:23:04.000Z"}
{"max_stars_count": 3, "max_issues_count": 2, "max_forks_count": 3, "avg_line_length": 23.7826086957, "max_line_length": 73, "alphanum_fraction": 0.7257769653}
import { NOT_AVAILABLE } from '../constants'

const getAvailableScreenResolution = (options) => {
  if (window.screen.availWidth && window.screen.availHeight) {
    var available = [window.screen.availHeight, window.screen.availWidth]
    if (options.screen.detectScreenOrientation) {
      available.sort().reverse()
    }
    return available
  }
  // headless browsers
  return NOT_AVAILABLE
}

function getData (done, options) {
  done(getAvailableScreenResolution(options))
}

export default {
  key: 'availableScreenResolution',
  getData
}
