Skip to content

Commit

Permalink
console log
Browse files Browse the repository at this point in the history
  • Loading branch information
Glazelf committed Sep 29, 2023
1 parent 686918d commit 6307309
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/helpers/monsterDataHelper.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
// @ts-ignore
import monsters from '../../objects/monsters';
import synthesis from '../../util/synthesis';

const monsterKeys = Object.keys(monsters).sort();

const getMonsterListByParent = (parent: string) => {
console.log(parent)
if (parent && parent.indexOf('_') === 0) {

const familyKeys = monsterKeys.filter((monsterName) => monsters[monsterName].family === parent);
return familyKeys.map((monster_key) => monsters[monster_key].name);
} else {
const parentData = monsters[parent];
return parentData ? [parentData.name] : undefined;
}
}
};
};

const monsterNames = () => monsterKeys.map((monster_key) => monsters[monster_key].name);

const getMonsterByName = (name: string) => {
const key = monsterKeys.filter((monsterName) => monsters[monsterName].name === name)[0];
return monsters[key];
}
};

export { getMonsterByName, getMonsterListByParent, monsterNames };

0 comments on commit 6307309

Please sign in to comment.