@rpg-engine/long-bow 0.6.73 → 0.6.74

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.
@@ -32126,12 +32126,18 @@ var formatObjectives = function formatObjectives(objectives) {
32126
32126
  };
32127
32127
  // Updated helper function to format rewards
32128
32128
  var formatRewards = function formatRewards(rewards) {
32129
- if (!rewards) return 'No rewards';
32130
- return rewards.map(function (reward) {
32131
- return "" + formatText(reward.itemKeys.map(function (itemKey) {
32132
- return itemKey + ' x' + reward.qty;
32133
- }).join(', ')) + (reward.spellKeys ? ", Spells: " + formatText(reward.spellKeys.join(', ')) : '');
32134
- }).join('; ');
32129
+ try {
32130
+ if (!rewards || !Array.isArray(rewards)) return 'No rewards';
32131
+ return rewards.map(function (reward) {
32132
+ var _reward$itemKeys;
32133
+ return "" + formatText(reward == null ? void 0 : (_reward$itemKeys = reward.itemKeys) == null ? void 0 : _reward$itemKeys.map(function (itemKey) {
32134
+ return itemKey + ' x' + (reward == null ? void 0 : reward.qty);
32135
+ }).join(', ')) + (reward != null && reward.spellKeys ? ", Spells: " + formatText(reward.spellKeys.join(', ')) : '');
32136
+ }).join('; ');
32137
+ } catch (error) {
32138
+ console.error("Error formatting rewards: " + JSON.stringify(rewards) + ":", error);
32139
+ return 'Error on rewards';
32140
+ }
32135
32141
  };
32136
32142
  var formatText = function formatText(text) {
32137
32143
  return text.split('-').map(function (word) {