{"size": 360, "ext": "js", "max_stars_repo_path": "javascript-unit-testing-with-mocha/03-async-callback/controllers/login.controller.js", "max_stars_repo_name": "learning-zone/JS-Unit-Testing", "max_stars_repo_stars_event_min_datetime": "2020-06-08T05:07:18.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-14T14:20:10.000Z", "max_issues_repo_path": "javascript-unit-testing-with-mocha/03-async-callback/controllers/login.controller.js", "max_issues_repo_name": "learning-zone/JS-Unit-Testing", "max_issues_repo_issues_event_min_datetime": "2020-03-24T17:05:20.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-08T20:34:52.000Z", "max_forks_repo_path": "javascript-unit-testing-with-mocha/03-async-callback/controllers/login.controller.js", "max_forks_repo_name": "learning-zone/JS-Unit-Testing", "max_forks_repo_forks_event_min_datetime": "2020-07-13T12:42:37.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-26T05:56:39.000Z"}
{"max_stars_count": 25, "max_issues_count": 21, "max_forks_count": 17, "avg_line_length": 17.1428571429, "max_line_length": 57, "alphanum_fraction": 0.6666666667}
function LoginController() {

  function isValidUserId(userList, user) {
    return userList.indexOf(user) >= 0;
  }

  function isValidUserIdAsync(userList, user, callback) {
    setTimeout(function(){
      callback(userList.indexOf(user) >= 0)
    }, 1);
  }

  return {
    isValidUserId,
    isValidUserIdAsync
  }

}

module.exports = LoginController();
