diff options
author | mat <27899617+mat-1@users.noreply.github.com> | 2021-02-13 14:35:58 -0600 |
---|---|---|
committer | mat <27899617+mat-1@users.noreply.github.com> | 2021-02-13 14:35:58 -0600 |
commit | 68c07e7a5ab8acf5ba7785eed594497e05467061 (patch) | |
tree | bf29688d541e817ea1d7e1dbdb0c83233a643530 /build/cleaners/skyblock/profiles.js | |
parent | f1c18020d5d86aac6119c842e6a108d99fae6e51 (diff) | |
download | skyblock-api-68c07e7a5ab8acf5ba7785eed594497e05467061.tar.gz skyblock-api-68c07e7a5ab8acf5ba7785eed594497e05467061.tar.bz2 skyblock-api-68c07e7a5ab8acf5ba7785eed594497e05467061.zip |
create member, profile, and profiles cleaners
Diffstat (limited to 'build/cleaners/skyblock/profiles.js')
-rw-r--r-- | build/cleaners/skyblock/profiles.js | 26 |
1 files changed, 26 insertions, 0 deletions
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; |