-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(server): skip smtp validation if unchanged (#12111)
* fix(server): skip smtp validation if unchanged * update comparison + convert config to plain object
- Loading branch information
1 parent
d08a20b
commit 74f18a4
Showing
4 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { isEqual, isPlainObject } from 'lodash'; | ||
|
||
/** | ||
* Deeply clones and converts a class instance to a plain object. | ||
*/ | ||
export function toPlainObject<T extends object>(obj: T): T { | ||
return isPlainObject(obj) ? obj : structuredClone(obj); | ||
} | ||
|
||
/** | ||
* Performs a deep comparison between objects, converting them to plain objects first if needed. | ||
*/ | ||
export function isEqualObject(value: object, other: object): boolean { | ||
return isEqual(toPlainObject(value), toPlainObject(other)); | ||
} |