aboutsummaryrefslogtreecommitdiff
path: root/build/cleaners/skyblock/profiles.js
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2021-02-13 14:35:58 -0600
committermat <27899617+mat-1@users.noreply.github.com>2021-02-13 14:35:58 -0600
commit68c07e7a5ab8acf5ba7785eed594497e05467061 (patch)
treebf29688d541e817ea1d7e1dbdb0c83233a643530 /build/cleaners/skyblock/profiles.js
parentf1c18020d5d86aac6119c842e6a108d99fae6e51 (diff)
downloadskyblock-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.js26
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;