Files
dsabot/functions/getAttributeLevels.js
TobenderZephyr c6cacdae5e switched nedb to nedb-promises (#37)
* breaking change: switched to nedb-promises
* Linting
* some dev dependencies
* more tests
* updated package version
* bug fixing
* changed isNaN to isString
* (fix) args[0]
2021-05-03 18:39:33 +02:00

14 lines
462 B
JavaScript

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