<commit_before>import { mapState, mapGetters, mapActions } from 'vuex';

export default {
  computed: {
    ...mapState([
      'job',
      'build',
    ]),

    ...mapGetters([
      'active',
      'activeAlt',
      'level',
      'messages',
      'skill',
      'name',
      'meta',
      'techCount',
      'type',
      'attribute',
      'weapons',
      'next',
      'description',
      'nextDescription',
      'altSkills',
      'spTotals',
      'spTotal',
    ]),

    ascendancyReqs() {
      const spTotals = this.spTotals;
      const skill = this.skill;
      const reqs = [];

      skill.ascendancies.forEach((sp, ascendancy) => {
        if (spTotals[ascendancy] < sp) {
          reqs.push({ ascendancy, sp });
        }
      });

      return reqs;
    },

    lackSp() {
      const spTotals = this.spTotals;
      const spTotal = this.spTotal;
      const job = this.skill.job;
      const next = this.next;
      const ascendancies = this.job.ascendancies;
      const maxSp = this.job.sp;

      return spTotals[job] + next.spCost > ascendancies[job].sp
        || spTotal + next.spCost > maxSp;
    },

    showLevelUpReq() {
      return this.level < this.skill.maxLevel
        || this.next.levelReq
        || this.next.parents
        || this.ascendancyReqs.length
        || this.next.spCost;
    },
  },

  methods: {
    ...mapActions([<commit_msg>resolves #42 - parents could be null or an empty array. Empty array = a not false value.<commit_after>import { mapState, mapGetters, mapActions } from 'vuex';

export default {
  computed: {
    ...mapState([
      'job',
      'build',
    ]),

    ...mapGetters([
      'active',
      'activeAlt',
      'level',
      'messages',
      'skill',
      'name',
      'meta',
      'techCount',
      'type',
      'attribute',
      'weapons',
      'next',
      'description',
      'nextDescription',
      'altSkills',
      'spTotals',
      'spTotal',
    ]),

    ascendancyReqs() {
      const spTotals = this.spTotals;
      const skill = this.skill;
      const reqs = [];

      skill.ascendancies.forEach((sp, ascendancy) => {
        if (spTotals[ascendancy] < sp) {
          reqs.push({ ascendancy, sp });
        }
      });

      return reqs;
    },

    lackSp() {
      const spTotals = this.spTotals;
      const spTotal = this.spTotal;
      const job = this.skill.job;
      const next = this.next;
      const ascendancies = this.job.ascendancies;
      const maxSp = this.job.sp;

      return spTotals[job] + next.spCost > ascendancies[job].sp
        || spTotal + next.spCost > maxSp;
    },

    showLevelUpReq() {
      const { next, ascendancyReqs } = this;
      const parents = next.parents ? next.parents.length : 0;

      if (this.level < this.skill.maxLevel) {
        return next.levelReq || parents || ascendancyReqs.length || next.spCost;
      }

      return parents || ascendancyReqs.length;
    },
  },

  methods: {
    ...mapActions([
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.0010107816711590297, 'mean_word_length': 1.9308983218163869, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7525938', 'n_tokens_mistral': 999, 'n_tokens_neox': 971, 'n_words': 197}