implemented feature
TODOs: - extract logic to feature file to simplify component - add unit test - add end-to-end tests
This commit is contained in:
parent
316e3158db
commit
4e98849e07
3 changed files with 101 additions and 20 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue