never ever ever!!! lean on type juggling. laziness has a price...
This commit is contained in:
parent
f86f2a698f
commit
8ac4b0df3a
1 changed files with 2 additions and 2 deletions
|
@ -68,13 +68,13 @@ export function* deepDiff<T1 extends object, T2 extends object>(a: T1, b: T2, pa
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const [[keyA, valueA], [keyB, valueB]] of zip(entriesOf(a), entriesOf(b))) {
|
for (const [[keyA, valueA], [keyB, valueB]] of zip(entriesOf(a), entriesOf(b))) {
|
||||||
if (keyA === undefined && keyB) {
|
if (keyA === undefined && keyB !== undefined) {
|
||||||
yield { key: path.concat(keyB.toString()).join('.'), kind: MutarionKind.Create, value: valueB };
|
yield { key: path.concat(keyB.toString()).join('.'), kind: MutarionKind.Create, value: valueB };
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keyA && keyB === undefined) {
|
if (keyA !== undefined && keyB === undefined) {
|
||||||
yield { key: path.concat(keyA.toString()).join('.'), kind: MutarionKind.Delete, original: valueA };
|
yield { key: path.concat(keyA.toString()).join('.'), kind: MutarionKind.Delete, original: valueA };
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue