@rpg-engine/long-bow 0.6.75 → 0.6.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32132,11 +32132,17 @@ var formatRewards = function formatRewards(rewards) {
32132
32132
  try {
32133
32133
  if (!rewards || !Array.isArray(rewards)) return 'No rewards';
32134
32134
  return rewards.map(function (reward) {
32135
- var _reward$itemKeys;
32136
- return "" + formatText(reward == null ? void 0 : (_reward$itemKeys = reward.itemKeys) == null ? void 0 : _reward$itemKeys.map(function (itemKey) {
32137
- return itemKey + ' x' + (reward == null ? void 0 : reward.qty);
32138
- }).join(', ')) + (reward != null && reward.spellKeys ? ", Spells: " + formatText(reward.spellKeys.join(', ')) : '');
32139
- }).join('; ');
32135
+ var _reward$itemKeys, _reward$spellKeys;
32136
+ var itemKeysFormatted = reward == null ? void 0 : (_reward$itemKeys = reward.itemKeys) == null ? void 0 : _reward$itemKeys.map(function (itemKey) {
32137
+ return itemKey && (reward == null ? void 0 : reward.qty) !== undefined ? itemKey + " x" + reward.qty : '';
32138
+ }).filter(Boolean).join(', ');
32139
+ var spellKeysFormatted = reward == null ? void 0 : (_reward$spellKeys = reward.spellKeys) == null ? void 0 : _reward$spellKeys.filter(Boolean).join(', ');
32140
+ var formattedReward = itemKeysFormatted ? "" + formatText(itemKeysFormatted) : '';
32141
+ if (spellKeysFormatted) {
32142
+ return formattedReward ? formattedReward + ", Spells: " + formatText(spellKeysFormatted) : "Spells: " + formatText(spellKeysFormatted);
32143
+ }
32144
+ return formattedReward || 'No rewards';
32145
+ }).filter(Boolean).join('; ');
32140
32146
  } catch (error) {
32141
32147
  console.error("Error formatting rewards: " + JSON.stringify(rewards) + ":", error);
32142
32148
  return 'Error on rewards';