Skip to content

Commit

Permalink
fix: StatHash should always be a number (#1562)
Browse files Browse the repository at this point in the history
  • Loading branch information
NigelBreslaw authored May 8, 2024
1 parent 38b4870 commit e867075
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions minifier/next_gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ function createMiniDefinition(jsonData: JsonData, uniqueKey: string): ProcessedD
return repeatStringsMap[name].get(s)!;
}

const processedData: ProcessedData = { helpers: {}, items: {}, version: 6, id: uniqueKey };
const processedData: ProcessedData = { helpers: {}, items: {}, version: 7, id: uniqueKey };

const sortedDataKeys = Object.keys(jsonData).sort((a, b) => parseFloat(a) - parseFloat(b));

Expand Down Expand Up @@ -524,7 +524,8 @@ function createMiniDefinition(jsonData: JsonData, uniqueKey: string): ProcessedD
const s: any = {};
const sortedStatKeys = Object.keys(itemStats).sort((a, b) => parseFloat(a) - parseFloat(b));
for (const key of sortedStatKeys) {
s[getRepeatStringIndexMap(RepeatStringsName.StatHash, key)] = itemStats[key].value;
const keyAsNumber = Number(key) as any;
s[getRepeatStringIndexMap(RepeatStringsName.StatHash, keyAsNumber)] = itemStats[key].value;
}

if (Object.keys(s).length > 0) {
Expand Down

0 comments on commit e867075

Please sign in to comment.