Skip to content

Commit

Permalink
tried fixing typecheck errors again
Browse files Browse the repository at this point in the history
  • Loading branch information
ghosetuhin committed Dec 4, 2023
1 parent 49703be commit 91dce18
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/desktop-client/src/components/reports/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export function index<T, K extends keyof T>(
field: K,
mapper?: (input: T[K]) => string,
) {
const result: Record<string, T> = {} as Record<string, T>;
const result: Record<string, T> = {};
data.forEach(item => {
result[mapper ? mapper(item[field]) : (item[field] as string)] = item;
result[mapper ? mapper(item[field]) : (item[field] as unknown as string)] = item;

Check warning on line 27 in packages/desktop-client/src/components/reports/util.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `⏎·····`
});
return result;
}
Expand All @@ -34,18 +34,14 @@ export function indexStack<T, K extends keyof T>(
fieldName: K,
field: K,
) {
const result: Record<string, T[K]> = {} as Record<string, T[K]>;
const result: Record<string, T[K]> = {};
data.forEach(item => {
result[item[fieldName] as string] = item[field];
result[item[fieldName] as unknown as string] = item[field];
});
return result;
}

export function indexCashFlow<T, K extends keyof T>(
data,
date: K,
isTransfer: K,
) {
export function indexCashFlow(data, date, isTransfer) {
const results = {};
data.forEach(item => {
let findExisting = results[item.date]
Expand Down

0 comments on commit 91dce18

Please sign in to comment.