@rpg-engine/long-bow 0.6.72 → 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.
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import { IQuest } from '@rpg-engine/shared';
2
+ import React from 'react';
3
3
  export interface IQuestListProps {
4
4
  quests?: IQuest[];
5
5
  }
@@ -32124,13 +32124,20 @@ var formatObjectives = function formatObjectives(objectives) {
32124
32124
  }
32125
32125
  }).join('; ');
32126
32126
  };
32127
- // Other helper functions remain the same
32127
+ // Updated helper function to format rewards
32128
32128
  var formatRewards = function formatRewards(rewards) {
32129
- return rewards.map(function (reward) {
32130
- return "" + formatText(reward.itemKeys.map(function (itemKey) {
32131
- return itemKey + ' x' + reward.qty;
32132
- }).join(', ')) + (reward.spellKeys ? ", Spells: " + formatText(reward.spellKeys.join(', ')) : '');
32133
- }).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
+ }
32134
32141
  };
32135
32142
  var formatText = function formatText(text) {
32136
32143
  return text.split('-').map(function (word) {