aboutsummaryrefslogtreecommitdiff
path: root/src/hypixelCached.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/hypixelCached.ts')
-rw-r--r--src/hypixelCached.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts
index bf3124a..f98f6d6 100644
--- a/src/hypixelCached.ts
+++ b/src/hypixelCached.ts
@@ -8,6 +8,7 @@ import * as hypixel from './hypixel'
import { CleanPlayer } from './cleaners/player'
import { undashUuid } from './util'
import { CleanProfile, CleanFullProfile, CleanBasicProfile } from './cleaners/skyblock/profile'
+import { cleanProfileStats } from './cleaners/skyblock/stats'
// cache usernames for 4 hours
@@ -100,7 +101,11 @@ export async function fetchPlayer(user: string): Promise<CleanPlayer> {
path: 'player',
args: { uuid: playerUuid }
})
- playerCache.set(playerUuid, cleanPlayer)
+
+ // clone in case it gets modified somehow later
+ const cleanPlayerClone = Object.assign({}, cleanPlayer)
+ playerCache.set(playerUuid, cleanPlayerClone)
+
return cleanPlayer
}