aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/database.ts4
-rw-r--r--test/test.js6
2 files changed, 7 insertions, 3 deletions
diff --git a/src/database.ts b/src/database.ts
index fd3f52b..e3affc4 100644
--- a/src/database.ts
+++ b/src/database.ts
@@ -195,8 +195,8 @@ interface StringNumber {
[name: string]: number
}
-function createUuid(uuid: string): Binary {
- return new Binary(Buffer.from((uuid).replace(/-/g, ''), 'hex'), Binary.SUBTYPE_UUID)
+export function createUuid(uuid: string): Binary {
+ return new Binary(Buffer.from(uuid.replace(/-/g, ''), 'hex'), Binary.SUBTYPE_UUID)
}
function getMemberCollectionAttributes(member: CleanMember): StringNumber {
diff --git a/test/test.js b/test/test.js
index 6d30993..baf2d6f 100644
--- a/test/test.js
+++ b/test/test.js
@@ -5,6 +5,7 @@ const { levelForSkillXp } = await import('../build/cleaners/skyblock/skills.js')
const hypixelCached = await import('../build/hypixelCached.js')
const hypixelApi = await import('../build/hypixelApi.js')
const constants = await import('../build/constants.js')
+const database = await import('../build/database.js')
const hypixel = await import('../build/hypixel.js')
const mojang = await import('../build/mojang.js')
const util = await import('../build/util.js')
@@ -12,7 +13,6 @@ const assert = await import('assert')
const path = await import('path')
const fs = await import('fs')
-
const cachedJsonData = {}
let requestsSent = 0
@@ -178,5 +178,9 @@ describe('Individual utility things', () => {
it('94450 xp is level 25 (max 25)', () => assert.strictEqual(levelForSkillXp(94450, 25), 25))
it('99999 xp is level 25 (max 25)', () => assert.strictEqual(levelForSkillXp(99999, 25), 25))
})
+
+ describe('#createUuid', () => {
+ it('createUuid works', () => assert.strictEqual(database.createUuid('6536bfed869548fd83a1ecd24cf2a0fd').toString('hex'), '6536bfed869548fd83a1ecd24cf2a0fd'))
+ })
})