{"size": 298, "ext": "js", "max_stars_repo_path": "src/indexOf.js", "max_stars_repo_name": "oprogramador/indexof-limited", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/indexOf.js", "max_issues_repo_name": "oprogramador/indexof-limited", "max_issues_repo_issues_event_min_datetime": "2019-02-18T21:23:41.000Z", "max_issues_repo_issues_event_max_datetime": "2021-03-31T16:01:48.000Z", "max_forks_repo_path": "src/indexOf.js", "max_forks_repo_name": "oprogramador/indexof-limited", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 24.8333333333, "max_line_length": 63, "alphanum_fraction": 0.7348993289}
function indexOf(longtext, substring, initialLimit, endLimit) {
  if (typeof endLimit === 'undefined') {
    return longtext.indexOf(substring, initialLimit);
  }

  const shorter = longtext.substring(0, endLimit + 1);

  return shorter.indexOf(substring, initialLimit);
}

export default indexOf;
