Skip to content

Commit

Permalink
Fix strict type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Feb 21, 2025
1 parent 2df61f4 commit b81f1f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/loot-core/src/server/budget/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,8 @@ async function createCategory({
}: {
name: CategoryEntity['name'];
groupId: CategoryGroupEntity['id'];
isIncome: CategoryEntity['is_income'];
hidden: CategoryEntity['hidden'];
isIncome?: CategoryEntity['is_income'] | undefined;
hidden?: CategoryEntity['hidden'] | undefined;
}): Promise<CategoryEntity['id']> {
if (!groupId) {
throw APIError('Creating a category: groupId is required');
Expand Down Expand Up @@ -957,8 +957,8 @@ async function createCategoryGroup({
hidden,
}: {
name: CategoryGroupEntity['name'];
isIncome: CategoryGroupEntity['is_income'];
hidden: CategoryGroupEntity['hidden'];
isIncome?: CategoryGroupEntity['is_income'] | undefined;
hidden?: CategoryGroupEntity['hidden'] | undefined;
}): Promise<CategoryGroupEntity['id']> {
return await db.insertCategoryGroup({
name,
Expand Down
8 changes: 4 additions & 4 deletions packages/loot-core/src/shared/async.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-strict-ignore
import { type HandlerFunctions } from '../types/handlers';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AnyFunction = (...args: any[]) => any;

export function sequential<T extends HandlerFunctions>(
export function sequential<T extends AnyFunction>(
fn: T,
): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>> {
const sequenceState: {
Expand Down Expand Up @@ -47,7 +47,7 @@ export function sequential<T extends HandlerFunctions>(
};
}

export function once<T extends HandlerFunctions>(
export function once<T extends AnyFunction>(
fn: T,
): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>> | null {
let promise: Promise<Awaited<ReturnType<T>>> | null = null;
Expand Down

0 comments on commit b81f1f7

Please sign in to comment.