aboutsummaryrefslogtreecommitdiff
path: root/build/cleaners/player.js
blob: 565ed70b406fe4ea4ec33e044bd67e870c2bc49d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cleanPlayerResponse = void 0;
const socialmedia_1 = require("./socialmedia");
const rank_1 = require("./rank");
const util_1 = require("../util");
const profiles_1 = require("./skyblock/profiles");
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: profiles_1.cleanPlayerSkyblockProfiles(data.stats.SkyBlock.profiles)
    };
}
exports.cleanPlayerResponse = cleanPlayerResponse;