Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mosesoak/626d256c63a0d29e338c7e125aa989f9 to your computer and use it in GitHub Desktop.
Save mosesoak/626d256c63a0d29e338c7e125aa989f9 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