Skip to content

Commit

Permalink
Fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Redm4x committed Mar 19, 2024
1 parent 0a188e6 commit e32695f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions api/src/caching/memoryCacheEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@ export default class MemoryCacheEngine {
* Used to retrieve data from memcache
* @param {*} key
*/
getFromCache = (key: string) => {
getFromCache(key: string) {
const cachedBody = mcache.get(key);
if (cachedBody) {
return cachedBody;
}
return false;
};
}

/**
* Used to store data in a memcache
* @param {*} key
* @param {*} data
* @param {*} duration
*/
storeInCache = (key: string, data: any, duration?: number) => {
storeInCache<T>(key: string, data: T, duration?: number) {
mcache.put(key, data, duration);
};
}
/**
* Used to delete all keys in a memcache
*/
clearAllKeyInCache = () => {
clearAllKeyInCache() {
mcache.clear();
};
}
/**
* Used to delete specific key from memcache
* @param {*} key
*/
clearKeyInCache = (key: string) => {
clearKeyInCache(key: string) {
mcache.del(key);
};
}
}
4 changes: 2 additions & 2 deletions api/src/services/db/statsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ export const AuthorizedGraphDataNames = [

type AuthorizedGraphDataName = (typeof AuthorizedGraphDataNames)[number];

export function isValidGraphDataName(x: any): x is AuthorizedGraphDataName {
return AuthorizedGraphDataNames.includes(x);
export function isValidGraphDataName(x: string): x is AuthorizedGraphDataName {
return AuthorizedGraphDataNames.includes(x as AuthorizedGraphDataName);
}

export async function getGraphData(dataName: AuthorizedGraphDataName): Promise<GraphData> {
Expand Down

0 comments on commit e32695f

Please sign in to comment.