Skip to content

Add `uniqueArrayItems` option + update dependencies

Choose a tag to compare

@voodoocreation voodoocreation released this 19 Jun 22:24
· 11 commits to master since this release

Changes

This version includes a new option - uniqueArrayItems. If you provide it with false it will allow duplicate array items:

import merge from "ts-deepmerge";

const objA = { array: ["a", "b"] };
const objB = { array: ["b", "c"] };

merge.withOptions({ uniqueArrayItems: false }, objA, objB);

The result of the above example would be:

{ array: ["a", "b", "b", "c"] }

Thanks to @KlutzyBubbles for raising an issue (#27) asking for this feature🙏