Skip to content

Commit 5f75429

Browse files
committed
⬆️ improvement: more flexible helper
1 parent 7cdcae2 commit 5f75429

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/helpers/mapNullFieldsToUndefined.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,8 @@
5757
* ```
5858
*/
5959
export function mapNullFieldsToUndefined<T extends object>(
60-
obj: T,
61-
): {
62-
[K in keyof T]: T[K] extends null ? undefined : Exclude<T[K], null>;
63-
};
64-
export function mapNullFieldsToUndefined(obj: undefined | null): undefined;
65-
export function mapNullFieldsToUndefined<T extends object>(obj?: T) {
60+
obj?: T | null | undefined,
61+
) {
6662
if (!obj) {
6763
return undefined;
6864
}

0 commit comments

Comments
 (0)