Type cache arguments

This commit is contained in:
Adria Navarro 2023-12-21 15:45:30 +01:00
parent f722ae970c
commit c0a19c2a7e
1 changed files with 12 additions and 11 deletions

View File

@ -18,14 +18,15 @@ export enum TTL {
ONE_DAY = 86400, ONE_DAY = 86400,
} }
function performExport(funcName: string) { export const keys = (...args: Parameters<typeof GENERIC.keys>) =>
// @ts-ignore GENERIC.keys(...args)
return (...args: any) => GENERIC[funcName](...args) export const get = (...args: Parameters<typeof GENERIC.get>) =>
} GENERIC.get(...args)
export const store = (...args: Parameters<typeof GENERIC.store>) =>
export const keys = performExport("keys") GENERIC.store(...args)
export const get = performExport("get") export const destroy = (...args: Parameters<typeof GENERIC.delete>) =>
export const store = performExport("store") GENERIC.delete(...args)
export const destroy = performExport("delete") export const withCache = (...args: Parameters<typeof GENERIC.withCache>) =>
export const withCache = performExport("withCache") GENERIC.withCache(...args)
export const bustCache = performExport("bustCache") export const bustCache = (...args: Parameters<typeof GENERIC.bustCache>) =>
GENERIC.bustCache(...args)