{"size": 820, "ext": "js", "max_stars_repo_path": "src/mixins/GridMixin.js", "max_stars_repo_name": "Pesochenski/vue-crossword", "max_stars_repo_stars_event_min_datetime": "2018-06-20T05:49:36.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-29T10:02:21.000Z", "max_issues_repo_path": "src/mixins/GridMixin.js", "max_issues_repo_name": "Pesochenski/vue-crossword", "max_issues_repo_issues_event_min_datetime": "2019-06-12T22:54:39.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-13T06:24:02.000Z", "max_forks_repo_path": "src/mixins/GridMixin.js", "max_forks_repo_name": "Pesochenski/vue-crossword", "max_forks_repo_forks_event_min_datetime": "2018-05-19T17:07:29.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-15T13:12:42.000Z"}
{"max_stars_count": 60, "max_issues_count": 12, "max_forks_count": 21, "avg_line_length": 25.625, "max_line_length": 70, "alphanum_fraction": 0.5243902439}
export default {
  methods: {
    getNextId (id) {
      const match = id.match(/(\d+):(\d+)/)
      const last = this.active.word[this.active.word.length - 1]
      const next = Number(match[Number(this.active.vertical) + 1]) + 1

      if (next > last.split(':')[Number(this.active.vertical)]) {
        return false
      }

      return this.active.vertical
        ? `${match[1]}:${next}`
        : `${next}:${match[2]}`
    },

    getPrevId (id) {
      const match = id.match(/(\d+):(\d+)/)
      const first = this.active.word[0]
      const prev = Number(match[Number(this.active.vertical) + 1]) - 1

      if (prev < first.split(':')[Number(this.active.vertical)]) {
        return false
      }

      return this.active.vertical
        ? `${match[1]}:${prev}`
        : `${prev}:${match[2]}`
    },
  },
}
