Releases: voodoocreation/ts-deepmerge
Update dependencies
7.0.2 fix ESLint config
Update dependencies
7.0.1 update dependencies
Use named export instead of default
Changes
This version moves from using a default export for the merge function, to exporting it as a named function. This is to avoid some issues that some native ESM TypeScript projects were facing where it couldn't resolve the types correctly.
Update dependencies
This version just updates the dev dependencies of the project.
Add `allowUndefinedOverrides` option + update dependencies
Changes
This version includes a new option - allowUndefinedOverrides
. If you provide it with false
it will prevent explicitly-provided properties with a value of undefined
from overwriting existing values:
import merge from "ts-deepmerge";
const objA = { value: 1 };
const objB = { value: 2 };
const objC = { value: undefined };
merge.withOptions({ allowUndefinedOverrides: false }, objA, objB, objC);
The result of the above example would be:
{ value: 2 }
Thanks to @norahmaria for raising an issue (#28) asking for this feature🙏
Add `uniqueArrayItems` option + update dependencies
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🙏
Update dependencies
6.0.3 update dependencies
Ensure cjs subfolder package.json is packed
6.0.2 ensure cjs subfolder package.json is packed
Fix `types` path in `package.json`
6.0.1 fix types path
Add support for both ESM and CommonJS
6.0.0 migrate to support both ESM and CommonJS