Skip to content

Commit

Permalink
fix(server): type errors failing production build
Browse files Browse the repository at this point in the history
  • Loading branch information
p-98 committed Jun 5, 2024
1 parent e8773b6 commit b045103
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/src/modules/electoralOffice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export async function createVote(
});
}

export async function deleteVote(ctx: IAppContext, id: string) {
export async function deleteVote(ctx: IAppContext, id: string): Promise<void> {
const { knex, session } = ctx;
assertRole(ctx, session.userSignature, "POLITICS");
return knex.transaction(async (trx) => {
Expand Down
2 changes: 1 addition & 1 deletion server/src/util/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const compute = <T>(f: () => T): T => f();
/** Apply a function if value is not null */
export const mapNullableC =
<T, U>(f: (_x: T) => U) =>
(x: TNullable<T>) =>
(x: TNullable<T>): TNullable<U> =>
isNull(x) ? null : f(x);

/* * Haskell-style logging functions * */
Expand Down
2 changes: 1 addition & 1 deletion types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export function inOperator<K extends PropertyKey, O>(
key: K,
obj: O
): obj is O & Record<K, unknown> {
return key in obj;
return typeof obj === "object" && obj !== null && key in obj;
}

export function checkPropertyType<K extends PropertyKey, O, T>(
Expand Down

0 comments on commit b045103

Please sign in to comment.