aboutsummaryrefslogtreecommitdiff
path: root/build/cleaners
diff options
context:
space:
mode:
Diffstat (limited to 'build/cleaners')
-rw-r--r--build/cleaners/skyblock/minions.js2
-rw-r--r--build/cleaners/skyblock/profile.js5
-rw-r--r--build/cleaners/socialmedia.js5
3 files changed, 7 insertions, 5 deletions
diff --git a/build/cleaners/skyblock/minions.js b/build/cleaners/skyblock/minions.js
index 8ffa9c1..289da1a 100644
--- a/build/cleaners/skyblock/minions.js
+++ b/build/cleaners/skyblock/minions.js
@@ -8,7 +8,7 @@ const hypixel_1 = require("../../hypixel");
*/
function cleanMinions(minionsRaw) {
const minions = [];
- for (const minionRaw of minionsRaw ?? []) {
+ for (const minionRaw of minionsRaw !== null && minionsRaw !== void 0 ? minionsRaw : []) {
// do some regex magic to get the minion name and level
// examples of potential minion names: CLAY_11, PIG_1, MAGMA_CUBE_4
const minionName = minionRaw.split(/_\d/)[0].toLowerCase();
diff --git a/build/cleaners/skyblock/profile.js b/build/cleaners/skyblock/profile.js
index f7d9e8b..fe6a8f2 100644
--- a/build/cleaners/skyblock/profile.js
+++ b/build/cleaners/skyblock/profile.js
@@ -23,6 +23,7 @@ async function cleanSkyblockProfileResponseLighter(data) {
exports.cleanSkyblockProfileResponseLighter = cleanSkyblockProfileResponseLighter;
/** This function is somewhat costly and shouldn't be called often. Use cleanSkyblockProfileResponseLighter if you don't need all the data */
async function cleanSkyblockProfileResponse(data) {
+ var _a, _b, _c, _d;
const cleanedMembers = [];
for (const memberUUID in data.members) {
const memberRaw = data.members[memberUUID];
@@ -41,9 +42,9 @@ async function cleanSkyblockProfileResponse(data) {
name: data.cute_name,
members: cleanedMembers,
bank: {
- balance: data?.banking?.balance ?? 0,
+ balance: (_b = (_a = data === null || data === void 0 ? void 0 : data.banking) === null || _a === void 0 ? void 0 : _a.balance) !== null && _b !== void 0 ? _b : 0,
// TODO: make transactions good
- history: data?.banking?.transactions ?? []
+ history: (_d = (_c = data === null || data === void 0 ? void 0 : data.banking) === null || _c === void 0 ? void 0 : _c.transactions) !== null && _d !== void 0 ? _d : []
},
minions
};
diff --git a/build/cleaners/socialmedia.js b/build/cleaners/socialmedia.js
index fb0bcfd..84ebfd5 100644
--- a/build/cleaners/socialmedia.js
+++ b/build/cleaners/socialmedia.js
@@ -2,9 +2,10 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseSocialMedia = void 0;
function parseSocialMedia(socialMedia) {
+ var _a, _b;
return {
- discord: socialMedia?.links?.DISCORD || null,
- forums: socialMedia?.links?.HYPIXEL || null
+ discord: ((_a = socialMedia === null || socialMedia === void 0 ? void 0 : socialMedia.links) === null || _a === void 0 ? void 0 : _a.DISCORD) || null,
+ forums: ((_b = socialMedia === null || socialMedia === void 0 ? void 0 : socialMedia.links) === null || _b === void 0 ? void 0 : _b.HYPIXEL) || null
};
}
exports.parseSocialMedia = parseSocialMedia;