diff --git a/packages/core/src/internal/clients/leaderboard/AbstractLeaderboardClient.ts b/packages/core/src/internal/clients/leaderboard/AbstractLeaderboardClient.ts index afd092591..f6a4984a1 100644 --- a/packages/core/src/internal/clients/leaderboard/AbstractLeaderboardClient.ts +++ b/packages/core/src/internal/clients/leaderboard/AbstractLeaderboardClient.ts @@ -87,7 +87,7 @@ export abstract class AbstractLeaderboardClient implements ILeaderboardClient { /** * Fetch the elements in the given leaderboard by index (rank). - * Note: can fetch a maximum of 8192 elements at a time and rank + * Note: can fetch a maximum of 8192 elements at a time and rank * is 0-based (index begins at 0). * * @param {string} cacheName - The cache containing the leaderboard. @@ -149,7 +149,7 @@ export abstract class AbstractLeaderboardClient implements ILeaderboardClient { /** * Fetch length (number of items) of leaderboard - * + * * @param {string} cacheName - The cache containing the leaderboard. * @param {string} leaderboardName - The leaderboard to fetch the length of. * @returns {Promise} @@ -191,7 +191,7 @@ export abstract class AbstractLeaderboardClient implements ILeaderboardClient { /** * Delete the given leaderboard - * + * * @param {string} cacheName - The cache containing the leaderboard. * @param {string} leaderboardName - The leaderboard to delete. * @returns {Promise} diff --git a/packages/core/src/messages/responses/leaderboard/leaderboard-fetch.ts b/packages/core/src/messages/responses/leaderboard/leaderboard-fetch.ts index 726ba5f3f..b36e38f3d 100644 --- a/packages/core/src/messages/responses/leaderboard/leaderboard-fetch.ts +++ b/packages/core/src/messages/responses/leaderboard/leaderboard-fetch.ts @@ -39,15 +39,14 @@ class _Found extends Response { /** * Returns the elements as an array of objects, each containing an `id`, `score`, and `rank` field. - * The id is a bigint, the score is a number, and the rank is a bigint. - * @returns {{id: bigint, score: number, rank: bigint}[]} + * @returns {{id: bigint, score: number, rank: number}[]} */ - public valueArray(): {id: bigint; score: number; rank: bigint}[] { + public valueArray(): {id: bigint; score: number; rank: number}[] { return this._elements.map(item => { return { id: item.id, score: item.score, - rank: item.rank, + rank: Number(item.rank), }; }); } diff --git a/packages/core/src/messages/responses/leaderboard/leaderboard-get-rank.ts b/packages/core/src/messages/responses/leaderboard/leaderboard-get-rank.ts index e538556dc..6ee33345a 100644 --- a/packages/core/src/messages/responses/leaderboard/leaderboard-get-rank.ts +++ b/packages/core/src/messages/responses/leaderboard/leaderboard-get-rank.ts @@ -49,10 +49,10 @@ class _Found extends Response { /** * Returns the rank of the requested element in the leaderboard - * @returns {bigint} + * @returns {number} */ - public rank(): bigint { - return this._rank; + public rank(): number { + return Number(this._rank); } /** @@ -64,7 +64,7 @@ class _Found extends Response { } public override toString(): string { - return `${super.toString()}: get element rank ${this._rank}`; + return `${super.toString()}: get element rank ${Number(this._rank)}`; } }