diff options
author | mat <27899617+mat-1@users.noreply.github.com> | 2021-02-13 15:11:55 -0600 |
---|---|---|
committer | mat <27899617+mat-1@users.noreply.github.com> | 2021-02-13 15:11:55 -0600 |
commit | 55bebce01352854368d5ccb57d0b51390d808f78 (patch) | |
tree | 28afc9185bd68b25cb87fddea4edff7d8f6e4fce /build | |
parent | d6d478d6165d7c17124dda64008b749cfb6b5c97 (diff) | |
download | skyblock-api-55bebce01352854368d5ccb57d0b51390d808f78.tar.gz skyblock-api-55bebce01352854368d5ccb57d0b51390d808f78.tar.bz2 skyblock-api-55bebce01352854368d5ccb57d0b51390d808f78.zip |
change compile target to es2019
Diffstat (limited to 'build')
-rw-r--r-- | build/cleaners/skyblock/minions.js | 2 | ||||
-rw-r--r-- | build/cleaners/skyblock/profile.js | 5 | ||||
-rw-r--r-- | build/cleaners/socialmedia.js | 5 | ||||
-rw-r--r-- | build/hypixel.js | 6 |
4 files changed, 10 insertions, 8 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; diff --git a/build/hypixel.js b/build/hypixel.js index e72ab8c..61a8518 100644 --- a/build/hypixel.js +++ b/build/hypixel.js @@ -101,9 +101,9 @@ async function fetchUser({ user, uuid, username }, included = ['player']) { } } return { - player: playerData ?? null, - profiles: profilesData ?? basicProfilesData, - activeProfile: includeProfiles ? activeProfile?.uuid : undefined, + player: playerData !== null && playerData !== void 0 ? playerData : null, + profiles: profilesData !== null && profilesData !== void 0 ? profilesData : basicProfilesData, + activeProfile: includeProfiles ? activeProfile === null || activeProfile === void 0 ? void 0 : activeProfile.uuid : undefined, online: includeProfiles ? lastOnline > (Date.now() - exports.saveInterval) : undefined }; } |