@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.
@@ -32134,11 +32134,17 @@ var formatRewards = function formatRewards(rewards) {
32134
32134
  try {
32135
32135
  if (!rewards || !Array.isArray(rewards)) return 'No rewards';
32136
32136
  return rewards.map(function (reward) {
32137
- var _reward$itemKeys;
32138
- return "" + formatText(reward == null ? void 0 : (_reward$itemKeys = reward.itemKeys) == null ? void 0 : _reward$itemKeys.map(function (itemKey) {
32139
- return itemKey + ' x' + (reward == null ? void 0 : reward.qty);
32140
- }).join(', ')) + (reward != null && reward.spellKeys ? ", Spells: " + formatText(reward.spellKeys.join(', ')) : '');
32141
- }).join('; ');
32137
+ var _reward$itemKeys, _reward$spellKeys;
32138
+ var itemKeysFormatted = reward == null ? void 0 : (_reward$itemKeys = reward.itemKeys) == null ? void 0 : _reward$itemKeys.map(function (itemKey) {
32139
+ return itemKey && (reward == null ? void 0 : reward.qty) !== undefined ? itemKey + " x" + reward.qty : '';
32140
+ }).filter(Boolean).join(', ');
32141
+ var spellKeysFormatted = reward == null ? void 0 : (_reward$spellKeys = reward.spellKeys) == null ? void 0 : _reward$spellKeys.filter(Boolean).join(', ');
32142
+ var formattedReward = itemKeysFormatted ? "" + formatText(itemKeysFormatted) : '';
32143
+ if (spellKeysFormatted) {
32144
+ return formattedReward ? formattedReward + ", Spells: " + formatText(spellKeysFormatted) : "Spells: " + formatText(spellKeysFormatted);
32145
+ }
32146
+ return formattedReward || 'No rewards';
32147
+ }).filter(Boolean).join('; ');
32142
32148
  } catch (error) {
32143
32149
  console.error("Error formatting rewards: " + JSON.stringify(rewards) + ":", error);
32144
32150
  return 'Error on rewards';