blob: a85b1f30b1e7ac7094bd36deecbe7edc960a9570 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import { cleanSkyblockProfileResponse } from './profile.js';
export function cleanPlayerSkyblockProfiles(rawProfiles) {
let profiles = [];
for (const profile of Object.values(rawProfiles ?? {})) {
profiles.push({
uuid: profile.profile_id,
name: profile.cute_name
});
}
return profiles;
}
/** Convert an array of raw profiles into clean profiles */
export async function cleanSkyblockProfilesResponse(data) {
const promises = [];
for (const profile of data ?? []) {
// let cleanedProfile = await cleanSkyblockProfileResponseLighter(profile)
promises.push(cleanSkyblockProfileResponse(profile));
}
const cleanedProfiles = (await Promise.all(promises)).filter(p => p);
return cleanedProfiles;
}
|