From 68c07e7a5ab8acf5ba7785eed594497e05467061 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sat, 13 Feb 2021 14:35:58 -0600 Subject: create member, profile, and profiles cleaners --- build/cleaners/skyblock/profiles.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 build/cleaners/skyblock/profiles.js (limited to 'build/cleaners/skyblock/profiles.js') diff --git a/build/cleaners/skyblock/profiles.js b/build/cleaners/skyblock/profiles.js new file mode 100644 index 0000000..b79fc56 --- /dev/null +++ b/build/cleaners/skyblock/profiles.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.cleanSkyblockProfilesResponse = exports.cleanPlayerSkyblockProfiles = void 0; +const profile_1 = require("./profile"); +function cleanPlayerSkyblockProfiles(rawProfiles) { + let profiles = []; + for (const profile of Object.values(rawProfiles)) { + profiles.push({ + uuid: profile.profile_id, + name: profile.cute_name + }); + } + console.log('cleanPlayerSkyblockProfiles', profiles); + return profiles; +} +exports.cleanPlayerSkyblockProfiles = cleanPlayerSkyblockProfiles; +/** Convert an array of raw profiles into clean profiles */ +async function cleanSkyblockProfilesResponse(data) { + const cleanedProfiles = []; + for (const profile of data) { + let cleanedProfile = await profile_1.cleanSkyblockProfileResponseLighter(profile); + cleanedProfiles.push(cleanedProfile); + } + return cleanedProfiles; +} +exports.cleanSkyblockProfilesResponse = cleanSkyblockProfilesResponse; -- cgit