diff --git a/src/core/base.ts b/src/core/base.ts index 6d61fe38..3605a8a0 100644 --- a/src/core/base.ts +++ b/src/core/base.ts @@ -21,27 +21,27 @@ export function* reversedItemAndIndex(arr: T[]): Iterable<[T, number]> { } } -export function* entries(obj: Record): Iterable<[K, V]> { +export function* entries(obj: Record): Iterable<[string, V]> { for (const key in obj) { if (!Object.prototype.hasOwnProperty.call(obj, key)) { continue; } - yield [key, obj[key]] as [K, V]; + yield [key, obj[key]] as [string, V]; } } -export function* keys(obj: Record): Iterable { +export function* keys(obj: Record): Iterable { for (const key in obj) { if (!Object.prototype.hasOwnProperty.call(obj, key)) { continue; } - yield key as K; + yield key; } } -export function* keysIfValueEquals(obj: Record, value: V): Iterable { +export function* keysIfValueEquals(obj: Record, value: V): Iterable { for (const key in obj) { if (!Object.prototype.hasOwnProperty.call(obj, key)) { continue; @@ -51,7 +51,7 @@ export function* keysIfValueEquals(obj: R continue; } - yield key as K; + yield key; } } diff --git a/src/lib/category.ts b/src/lib/category.ts index 1ccf1aa2..6049dee9 100644 --- a/src/lib/category.ts +++ b/src/lib/category.ts @@ -395,9 +395,9 @@ export function containsAvailableCategory(allTransactionCategories: Record 0; + result[parseInt(type)] = categoryType.allCategories && categoryType.allCategories.length > 0; } else { - result[type] = categoryType.allVisibleCategoryCount > 0; + result[parseInt(type)] = categoryType.allVisibleCategoryCount > 0; } }