microdiff
microdiff copied to clipboard
feat: add shallow comparison option to ignore nested objects and arrays
Add new 'shallow' option to diff function that performs shallow comparison by only comparing primitive values at the first level and ignoring nested objects and arrays. This is useful when you only need to track changes in top-level primitive properties without recursing into complex structures.
Changes:
- Add 'shallow' boolean option to Options interface
- Skip objects/arrays in REMOVE, CHANGE, and CREATE operations when shallow mode is enabled
- Update test data with simplified car examples instead of provider data
- Add comprehensive tests for shallow vs deep comparison modes