{"size": 625, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "vl-fom/brackets", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/index.js", "max_issues_repo_name": "vl-fom/brackets", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/index.js", "max_forks_repo_name": "vl-fom/brackets", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.8947368421, "max_line_length": 120, "alphanum_fraction": 0.5344}
module.exports = function check(str, bracketsConfig) {
  br = bracketsConfig.flat();
  let stack = [];
  for (i of str) {
    if (stack.length === 0) {
      stack.push(i);
    } else if (br.indexOf(i) % 2 === 0 && br.indexOf(i) === br.lastIndexOf(i)) {
      stack.push(i);
    } else if (br.indexOf(i) % 2 === 0 && br.indexOf(i) + 1 === br.lastIndexOf(i) && stack.slice(-1).toString() !== i) {
      stack.push(i);
    } else if (br.lastIndexOf(i) % 2 === 1 && br.indexOf(stack.slice(-1).toString()) + 1 !== br.lastIndexOf(i)) {
      stack.push(i);
    } else {
      stack.pop();
    }
  }
  return stack.length === 0;
}
