feat(backend): De meest recente indiening wordt automatisch ingeladen.

This commit is contained in:
Gerald Schmittinger 2025-04-18 12:37:17 +02:00
parent 1685c518b6
commit 63c3d6aaa0
18 changed files with 406 additions and 263 deletions

View file

@ -0,0 +1,5 @@
export function copyArrayWith<T>(index: number, newValue: T, array: T[]) {
const copy = [...array];
copy[index] = newValue;
return copy;
}

View file

@ -0,0 +1,20 @@
export function deepEquals<T>(a: T, b: T): boolean {
if (a === b) return true;
if (typeof a !== 'object' || typeof b !== 'object' || a == null || b == null)
return false;
if (Array.isArray(a) !== Array.isArray(b)) return false;
if (Array.isArray(a) && Array.isArray(b)) {
if (a.length !== b.length) return false;
return a.every((val, i) => deepEquals(val, b[i]));
}
const keysA = Object.keys(a) as (keyof T)[];
const keysB = Object.keys(b) as (keyof T)[];
if (keysA.length !== keysB.length) return false;
return keysA.every(key => deepEquals(a[key], b[key]));
}