ltwlf / json-diff-ts

A diff tool for JavaScript written in TypeScript.
MIT License
77 stars 24 forks source link

Fix issues when old value is array #168

Closed Jaspooky closed 1 month ago

Jaspooky commented 1 month ago

Noticed errors occurring when diffs were created for an object where a value was changing from an array to undefined with treatTypeChangeAsReplace set to false. This MR adds some more guards against different combinations of values. Changes to array handling prevents runtime errors, changes to undefined handling is purely QoL.