Skip to content

Commit

Permalink
Version bump + code smell fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakeyzer committed Apr 28, 2023
1 parent 5fd031a commit d19dff7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.12.1",
"version": "2.13.0",
"name": "harmless_key",
"description": "A Dungeons and Dragons Combat Tracker",
"productName": "Harmless Key",
Expand Down
7 changes: 4 additions & 3 deletions src/components/npcs/SpellCasting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@
<script>
import { abilities } from "src/utils/generalConstants";
import CopyContent from "src/components/CopyContent";
import _ from "lodash";
export default {
name: "npc-SpellCasting",
Expand Down Expand Up @@ -316,8 +315,10 @@ export default {
this.$delete(this.npc[`${category}_spells`], key);
},
orderedSpells(spell_list, category) {
const key = category === "caster" ? "level" : "limit";
const sorted = Object.entries(spell_list).sort((a, b) => a[1][key] - b[1][key]);
const category_key = category === "caster" ? "level" : "limit";
const sorted = Object.entries(spell_list).sort(
(a, b) => a[1][category_key] - b[1][category_key]
);
return sorted.reduce((acc, [key, spell]) => ({ ...acc, [key]: spell }), {});
},
},
Expand Down

0 comments on commit d19dff7

Please sign in to comment.