aboutsummaryrefslogtreecommitdiff
path: root/build/cleaners/skyblock/member.js
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-06-29 17:54:50 -0500
committermat <github@matdoes.dev>2021-06-29 17:54:50 -0500
commit49ff24343e1c964b6cb82fdf76957ffd2f27d049 (patch)
tree820a3668e21dffc7eefa53630944412d9d97a129 /build/cleaners/skyblock/member.js
parent758ca15277daa11ce1ec86ce7f07ea7beee9eb8f (diff)
parentc0c534dafb54ebf9f95a5054f576ad99de29f232 (diff)
downloadskyblock-api-49ff24343e1c964b6cb82fdf76957ffd2f27d049.tar.gz
skyblock-api-49ff24343e1c964b6cb82fdf76957ffd2f27d049.tar.bz2
skyblock-api-49ff24343e1c964b6cb82fdf76957ffd2f27d049.zip
Merge branch 'main' of https://github.com/skyblockstats/skyblock-api into main
Diffstat (limited to 'build/cleaners/skyblock/member.js')
-rw-r--r--build/cleaners/skyblock/member.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/build/cleaners/skyblock/member.js b/build/cleaners/skyblock/member.js
index 8e72be8..cc66488 100644
--- a/build/cleaners/skyblock/member.js
+++ b/build/cleaners/skyblock/member.js
@@ -31,8 +31,10 @@ const zones_1 = require("./zones");
const skills_1 = require("./skills");
const cached = __importStar(require("../../hypixelCached"));
const constants = __importStar(require("../../constants"));
-async function cleanSkyBlockProfileMemberResponseBasic(member, included = null) {
+async function cleanSkyBlockProfileMemberResponseBasic(member) {
const player = await cached.fetchPlayer(member.uuid);
+ if (!player)
+ return null;
return {
uuid: member.uuid,
username: player.username,
@@ -43,13 +45,13 @@ async function cleanSkyBlockProfileMemberResponseBasic(member, included = null)
}
exports.cleanSkyBlockProfileMemberResponseBasic = cleanSkyBlockProfileMemberResponseBasic;
/** Cleans up a member (from skyblock/profile) */
-async function cleanSkyBlockProfileMemberResponse(member, included = null) {
+async function cleanSkyBlockProfileMemberResponse(member, included = undefined) {
var _a;
// profiles.members[]
- const inventoriesIncluded = included === null || included.includes('inventories');
+ const inventoriesIncluded = included === undefined || included.includes('inventories');
const player = await cached.fetchPlayer(member.uuid);
if (!player)
- return;
+ return null;
const fairySouls = fairysouls_1.cleanFairySouls(member);
const { max_fairy_souls: maxFairySouls } = await constants.fetchConstantValues();
if (fairySouls.total > (maxFairySouls !== null && maxFairySouls !== void 0 ? maxFairySouls : 0))