aboutsummaryrefslogtreecommitdiff
path: root/build/cleaners/player.js
diff options
context:
space:
mode:
Diffstat (limited to 'build/cleaners/player.js')
-rw-r--r--build/cleaners/player.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/build/cleaners/player.js b/build/cleaners/player.js
new file mode 100644
index 0000000..25ae1f2
--- /dev/null
+++ b/build/cleaners/player.js
@@ -0,0 +1,19 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.cleanPlayerResponse = void 0;
+const hypixel_1 = require("../hypixel");
+const socialmedia_1 = require("./socialmedia");
+const rank_1 = require("./rank");
+const util_1 = require("../util");
+async function cleanPlayerResponse(data) {
+ // Cleans up a 'player' api response
+ console.log('cleanPlayerResponse', data.stats.SkyBlock.profiles);
+ return {
+ uuid: util_1.undashUuid(data.uuid),
+ username: data.displayname,
+ rank: rank_1.parseRank(data),
+ socials: socialmedia_1.parseSocialMedia(data.socialMedia),
+ profiles: hypixel_1.cleanPlayerSkyblockProfiles(data.stats.SkyBlock.profiles)
+ };
+}
+exports.cleanPlayerResponse = cleanPlayerResponse;