From 91dce186764d41675be3ac74725835c530bd59aa Mon Sep 17 00:00:00 2001 From: Tuhin Ghose Date: Mon, 4 Dec 2023 16:18:10 -0500 Subject: [PATCH] tried fixing typecheck errors again --- .../desktop-client/src/components/reports/util.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/desktop-client/src/components/reports/util.ts b/packages/desktop-client/src/components/reports/util.ts index 5ec7daa21a3..22d03e840bb 100644 --- a/packages/desktop-client/src/components/reports/util.ts +++ b/packages/desktop-client/src/components/reports/util.ts @@ -22,9 +22,9 @@ export function index( field: K, mapper?: (input: T[K]) => string, ) { - const result: Record = {} as Record; + const result: Record = {}; 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; }); return result; } @@ -34,18 +34,14 @@ export function indexStack( fieldName: K, field: K, ) { - const result: Record = {} as Record; + const result: Record = {}; data.forEach(item => { - result[item[fieldName] as string] = item[field]; + result[item[fieldName] as unknown as string] = item[field]; }); return result; } -export function indexCashFlow( - data, - date: K, - isTransfer: K, -) { +export function indexCashFlow(data, date, isTransfer) { const results = {}; data.forEach(item => { let findExisting = results[item.date]