Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save steinathan/0e077c438f20d8ed6aef5420bc9b424f to your computer and use it in GitHub Desktop.
Save steinathan/0e077c438f20d8ed6aef5420bc9b424f to your computer and use it in GitHub Desktop.
// Deep-merges arrays without duplicate values
const mergeCustomizer = (objValue: any, srcValue: any) => {
if (Array.isArray(objValue) && Array.isArray(srcValue)) {
return uniqWith(
[...srcValue, ...objValue],
(a, b) => a === b || isEqual(a, b),
);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment