Skip to content

Instantly share code, notes, and snippets.

View kaichii's full-sized avatar
🏠
Working from home

kâichi kaichii

🏠
Working from home
View GitHub Profile
@kaichii
kaichii / deepDiffObj.js
Created September 27, 2021 02:17 — forked from tennox/deepDiffObj.js
Deep diff between two object, using lodash
import _ from 'lodash';
/**
* Deep diff between two objects - i.e. an object with the new value of new & changed fields.
* Removed fields will be set as undefined on the result.
* Only plain objects will be deeply compared (@see _.isPlainObject)
*
* Inspired by: https://gist.github.com/Yimiprod/7ee176597fef230d1451#gistcomment-2565071
* This fork: https://gist.github.com/TeNNoX/5125ab5770ba287012316dd62231b764/
*