Skip to content

Commit da42318

Browse files
committed
restore merge config guard
1 parent c75d246 commit da42318

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

src/hooks/useNotification.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,15 @@ function mergeConfig<T>(...objList: Partial<T>[]): T {
5353
const clone = {} as T;
5454

5555
objList.forEach((obj) => {
56-
if (!obj) {
57-
return;
58-
}
59-
60-
Object.keys(obj).forEach((key) => {
61-
const value = obj[key as keyof T];
56+
if (obj) {
57+
Object.keys(obj).forEach((key) => {
58+
const value = obj[key as keyof T];
6259

63-
if (value !== undefined) {
64-
clone[key as keyof T] = value;
65-
}
66-
});
60+
if (value !== undefined) {
61+
clone[key as keyof T] = value;
62+
}
63+
});
64+
}
6765
});
6866

6967
return clone;

0 commit comments

Comments
 (0)