Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function aptitudeValue(
aptitudes: [HashedString, number][],
aptitudeName: string
): number {
const hash = getHashedString(aptitudeName).hash;
const aptitude = find(aptitudes, x => x[0].hash === hash);
if (!aptitude) {
return 0;
}
return aptitude[1];
}
function removeAptitude(aptitudeName: string) {
const hashStr = getHashedString(aptitudeName);
const index = findIndex(
AptitudeBySkillGroup,
x => x[0].hash === hashStr.hash
);
if (index === -1) {
return;
}
onTemplateDataModify({
AptitudeBySkillGroup: [
...AptitudeBySkillGroup.slice(0, index),
...AptitudeBySkillGroup.slice(index + 1)
]
});
}