Files
dsabot/functions/getAttributeLevels.js
TobenderZephyr 924fca5b90 add more tests (#26)
* added more tests

* (fix) no cpu profile.
2021-04-29 19:42:51 +00:00

15 lines
535 B
JavaScript

const globals = require('../globals');
const getAttributeLevels = (Attributes = [], Character = {}) => {
let AttributeId;
let AttributeLevel;
let AttributeList = [];
for (let Attribute of Attributes) {
AttributeId = globals.Werte.find(att => att.kuerzel === Attribute).id;
AttributeLevel = Character.attributes.find(att => att.id === AttributeId).level;
AttributeList.push({ Name: Attribute, Level: AttributeLevel });
}
return AttributeList;
};
module.exports = { getAttributeLevels };