refactor: Migrate config schema from Zod v3 to Zod v4 (#2357)
This commit is contained in:
+6
-6
@@ -247,16 +247,16 @@ export const getChildrenFromElement = (parent: HTMLElement): HTMLElement[] => {
|
||||
return children.filter(isHTMLElement);
|
||||
};
|
||||
|
||||
export const recursivelyMergeObjectsNotArrays = <T>(target: T, src1: T, src2: T): T => {
|
||||
return mergeWith(target, src1, src2, (_a, b) => (Array.isArray(b) ? b : undefined));
|
||||
export const recursivelyMergeObjectsNotArrays = <T>(
|
||||
...srcs: (Partial<T> | undefined | null)[]
|
||||
): T => {
|
||||
return mergeWith({}, ...srcs, (_a, b) => (Array.isArray(b) ? b : undefined));
|
||||
};
|
||||
|
||||
export const recursivelyMergeObjectsConcatenatingArraysUniquely = <T>(
|
||||
target: T,
|
||||
src1: T,
|
||||
src2: T,
|
||||
...srcs: (Partial<T> | undefined | null)[]
|
||||
): T => {
|
||||
return mergeWith(target, src1, src2, (a, b) =>
|
||||
return mergeWith({}, ...srcs, (a, b) =>
|
||||
Array.isArray(a) ? uniq(a.concat(b)) : undefined,
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user