@orisomething/reconcile-utils
v0.0.2
Published
A library that contains a single utility (in the future maybe more) called `reconcile` which merges two data structures, by returning a new data structure that reflects the changes from the new object while preserving references to unchanged parts of the
Downloads
4
Readme
Reconcile Utils
A library that contains a single utility (in the future maybe more) called reconcile which merges two data structures,
by returning a new data structure that reflects the changes from the new object while preserving references to unchanged parts of the first object.
Usage
const current = { x: {} };
const next = { x: {}, y: {} };
const result = reconcile(current, next);
result.x === current.x; // -> trueSupported data structures
- Primitives -
boolean,number,bigint,string,symbol,null, andundefined - Plain objects
DateSet- supporting only values of type primitivesMap- supporting only keys of type primitives
Installing
pnpm install @orisomething/reconcile-utils