mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix(server): skip smtp validation if unchanged (#12111)
* fix(server): skip smtp validation if unchanged * update comparison + convert config to plain object
This commit is contained in:
parent
d08a20bd57
commit
74f18a4523
4 changed files with 29 additions and 3 deletions
15
server/src/utils/object.ts
Normal file
15
server/src/utils/object.ts
Normal file
|
|
@ -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));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue