diff options
author | mat <github@matdoes.dev> | 2022-05-18 19:52:03 +0000 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-05-18 19:52:03 +0000 |
commit | 3fa5d9819476c9da0fc15c6cd90aacf11418b60a (patch) | |
tree | c711b531ff8204a204695f03fe0a4aea27a78e12 | |
parent | 11da86901ccfd3d16445f5defe28bb142564fa0a (diff) | |
download | skyblock-api-3fa5d9819476c9da0fc15c6cd90aacf11418b60a.tar.gz skyblock-api-3fa5d9819476c9da0fc15c6cd90aacf11418b60a.tar.bz2 skyblock-api-3fa5d9819476c9da0fc15c6cd90aacf11418b60a.zip |
better unknown name auction capitalization
-rw-r--r-- | src/cleaners/skyblock/itemId.ts | 1 | ||||
-rw-r--r-- | src/hypixel.ts | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/cleaners/skyblock/itemId.ts b/src/cleaners/skyblock/itemId.ts index 934064f..991d2d0 100644 --- a/src/cleaners/skyblock/itemId.ts +++ b/src/cleaners/skyblock/itemId.ts @@ -37,6 +37,7 @@ const ITEMS = { 'mycel': 'mycelium', 'cocoa': 'cocoa_beans', 'smooth_brick': 'stonebrick', + 'lily_pad': 'waterlily', 'redstone_lamp_off': 'redstone_lamp', 'redstone_comparator': 'comparator', diff --git a/src/hypixel.ts b/src/hypixel.ts index ebe2eea..e0575dd 100644 --- a/src/hypixel.ts +++ b/src/hypixel.ts @@ -469,7 +469,14 @@ async function fetchAuctionItemsUncached() { // if the item in the database isn't in the items api, just set the name to the id for (const item of auctionItemIds) if (!(item in idsToData)) - idsToData[item] = { display: { name: item.toLowerCase().replace(/^./, item[0].toUpperCase()).replace(/_/g, ' ') } } + idsToData[item] = { + display: { + name: (item.toLowerCase().replace(/^./, item[0].toUpperCase()).replace(/_/g, ' ')).replace( + /\w\S*/g, + w => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase() + ) + } + } return idsToData } |