Skip to content

Commit

Permalink
refactor: simplify typing
Browse files Browse the repository at this point in the history
  • Loading branch information
cpvalente committed Feb 15, 2025
1 parent 897f57c commit 174586e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/server/src/utils/parserUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ export function mergeObject<T extends object>(a: T, b: Partial<T>): T {
* @param {object} obj
*/
export const removeUndefined = <T extends Record<string, unknown>>(obj: T): Partial<T> => {
return Object.keys(obj).reduce((patched, key) => {
return Object.keys(obj).reduce<Partial<T>>((patched, key) => {
if (typeof obj[key] !== 'undefined') {
// @ts-expect-error -- not sure how to type this
patched[key] = obj[key];
}
return patched;
}, {} as Partial<T>);
}, {});
};

0 comments on commit 174586e

Please sign in to comment.