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/cleaners/skyblock | |
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/cleaners/skyblock')
-rw-r--r-- | build/cleaners/skyblock/minions.js | 2 | ||||
-rw-r--r-- | build/cleaners/skyblock/profile.js | 5 |
2 files changed, 4 insertions, 3 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 }; |