You use alarms[name] several times in this method. Better to do the lookup only once:
var alarm = alarms[name];
if (!alarm) {
  return;
}