Fix obscure config merge bug.

This commit is contained in:
Dermot Duffy
2024-03-03 18:22:51 -08:00
parent 8f3c6af38f
commit 89ddea69db
4 changed files with 96 additions and 12 deletions
+5
View File
@@ -3,6 +3,7 @@ import differenceInMinutes from 'date-fns/differenceInMinutes';
import differenceInSeconds from 'date-fns/differenceInSeconds';
import format from 'date-fns/format';
import isEqual from 'lodash-es/isEqual';
import mergeWith from 'lodash-es/mergeWith';
import { FrigateCardError } from '../types';
export type ModifyInterface<T, R> = Omit<T, keyof R> & R;
@@ -240,3 +241,7 @@ export const getChildrenFromElement = (parent: HTMLElement): HTMLElement[] => {
: [...parent.children];
return children.filter(isHTMLElement);
};
export const recursivelyMergeObjectsNotArrays = <T>(src1: T, src2: T): T => {
return mergeWith({}, src1, src2, (_a, b) => (Array.isArray(b) ? b : undefined));
};