implemented feature

TODOs:
- extract logic to feature file to simplify component
- add unit test
- add end-to-end tests
This commit is contained in:
Chris Kruining 2024-12-02 16:26:00 +01:00
parent 316e3158db
commit 4e98849e07
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
3 changed files with 101 additions and 20 deletions

View file

@ -54,10 +54,10 @@ export enum MutarionKind {
Update = 'updated',
Delete = 'deleted',
}
type Created = { kind: MutarionKind.Create, value: any };
type Updated = { kind: MutarionKind.Update, value: any, original: any };
type Deleted = { kind: MutarionKind.Delete };
export type Mutation = { key: string } & (Created | Updated | Deleted);
export type Created = { kind: MutarionKind.Create, key: string, value: any };
export type Updated = { kind: MutarionKind.Update, key: string, value: any, original: any };
export type Deleted = { kind: MutarionKind.Delete, key: string };
export type Mutation = Created | Updated | Deleted;
export function* deepDiff<T1 extends object, T2 extends object>(a: T1, b: T2, path: string[] = []): Generator<Mutation, void, unknown> {
if (!isIterable(a) || !isIterable(b)) {