Skip to content

Commit

Permalink
Fixed usage of any
Browse files Browse the repository at this point in the history
  • Loading branch information
PsychoSanchez committed Nov 7, 2024
1 parent 61b8576 commit 6809ace
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared/db/sync-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const getCurrentHostTime = async (host: string): Promise<number> => {
const store = await getTotalActivity();
const currentDate = getIsoDate(new Date());

return (store[currentDate] as any)?.[host] ?? 0;
return store[currentDate]?.[host as HostName] ?? 0;
};

export const setTotalDailyHostTime = async ({
Expand Down
2 changes: 2 additions & 0 deletions src/shared/utils/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const getTimeWithoutSeconds = (number: number) => {
const DEFAULT_DATE_TRANSFORMER = (date: Date) => new Date(date);

export const generatePrior7DaysDates = <
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- T is a generic
T extends (date: Date) => any = (date: Date) => Date,
>(
date: Date,
Expand All @@ -93,6 +94,7 @@ export const generatePrior7DaysDates = <
});

export const rangeDaysAgo = <
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- T is a generic
DateTransformer extends (date: Date) => any = (date: Date) => Date,
>({
from: date,
Expand Down

0 comments on commit 6809ace

Please sign in to comment.