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