Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{
return 5 - raw;
},
top: 0,
};
},
};
for (const key in checks)
{
advice[key] = checks[key](match, pm);
const val = advice[key];
val.display = util.format('%s: <b>%s</b>, expected <b>%s</b>', val.name, Number(val.value ? val.value.toFixed(2) : ''), Number(val.top.toFixed(2)));
val.display += (val.suffix ? ` ${val.suffix}` : '');
val.pct = val.score(val.value) / val.score(val.top);
delete val.score;
pm.desc = [constants.lane_role[pm.lane_role], isSupport(pm) ? 'Support' : 'Core'].join('/');
}
return advice;
function isSupport(pm)
{
return getObsWardsPlaced(pm) >= 2 && pm.lh_t && pm.lh_t[10] < 20;
}
function getObsWardsPlaced(pm)
{
if (!pm.obs_log)
{
return 0;
}
return pm.obs_log.filter((l) => {
return !l.entityleft;