From d39b514a6432e812a5cbe41be3055e65e098f9b9 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Sat, 6 Nov 2021 14:53:14 +0000 Subject: [PATCH] use bigint type --- src/cache.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cache.ts b/src/cache.ts index 34b56941c..feb865d4b 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -108,7 +108,7 @@ export interface AsyncCache { } function createTable(_table: TableNames): CacheHandler { - const table = new Collection(); + const table = new Collection(); return { clear: () => table.clear(), delete: (key) => table.delete(key), @@ -125,27 +125,27 @@ export interface CacheHandler { /** Completely empty this table. */ clear(): void; /** Delete the data related to this key from table. */ - delete(key: BigInt): boolean; + delete(key: bigint): boolean; /** Check if there is data assigned to this key. */ - has(key: BigInt): boolean; + has(key: bigint): boolean; /** Check how many items are stored in this table. */ size(): number; /** Store new data to this table. */ - set(key: BigInt, data: T): boolean; + set(key: bigint, data: T): boolean; /** Get a stored item from the table. */ - get(key: BigInt): T | undefined; + get(key: bigint): T | undefined; // TODO: maybe its possible to stringify the function and send it to the custom cache handler :thinking: /** * Loop over each entry and execute callback function. * @important This function NOT optimised and will force load everything when using custom cache. */ - forEach(callback: (value: T, key: BigInt) => unknown): void; + forEach(callback: (value: T, key: bigint) => unknown): void; // TODO: maybe its possible to stringify the function and send it to the custom cache handler :thinking: /** * Loop over each entry and execute callback function. * @important This function NOT optimised and will force load everything when using custom cache. */ - filter(callback: (value: T, key: BigInt) => boolean): Collection; + filter(callback: (value: T, key: bigint) => boolean): Collection; } export type AsyncCacheHandler = {