Comments (10)
Yeah, that intuitively seems like a change that would bite some people.
I'd be more worried about it, except nobody seems to have ever been bothered by the root object always being freshly created every time, which seems like the case that would matter most. ¯\_(ツ)_/¯
from deepmerge.
If there aren't any reviews, I'll merge/release next week.
from deepmerge.
Version 2.0.0 has been published! Open new issues for anything you notice that seems off.
from deepmerge.
So long as we clearly document the change at the top of the npm page + provide an example of how users can easily switch back to the old behavior I don't see too much of a problem. obviously cloning would be a bad way of dealing with certain things because people may not expect it... for example a user using a object based module system probably does not want their modules cloned as calling methods from the cloned vs uncloned objects would have different internal state...
from deepmerge.
I could see a lot more people using the library on objects that contain classes vs on classes themselves, but I definitely agree that cloning everything is probably a better way to avoid unexpected behavior in the majority of cases. Along with clear documentation on how to reverse the behavior I see no problem with it.
from deepmerge.
+1
But, we should of course document the changes
from deepmerge.
I think
clone
should default totrue
Exactly this
from deepmerge.
Agree strongly with all of your suggestions, they would make it much better
from deepmerge.
I've opened a pull request - reviews of #77 would be appreciated!
from deepmerge.
I'll have the opportunity to put it through its paces pretty intensively soon, merging multiple nodes with complex models from a graph
from deepmerge.
Related Issues (20)
- Is it possible to deepmerge an HTML dom object? HOT 3
- is this library no longer maintained ? HOT 1
- [feature request] more contextual info customMerge HOT 2
- is-mergeable-object is a devDependency HOT 4
- Deepmerge deletes values of ArrayBuffer and replaces to an empty object HOT 4
- How to use one object as target HOT 8
- Deno? HOT 7
- High CPU usage with large object merge HOT 1
- use recursive partial for type definitions HOT 1
- Will we ever see the v5? HOT 4
- When a particular property of the source object is undefined while the target one has a value, the value will be override by undefined HOT 2
- How to delete an element from an array with deepmerge. HOT 1
- How to avoid array concatenation HOT 18
- `is-mergeable-object` is a `devDependency` but used in `index.js` HOT 7
- An error occuren when merge axios config: config.signal.addEventListener is not a function HOT 3
- add ESM, support for module and browser HOT 5
- Possible to remove duplicate objects in arrays? HOT 1
- deepmerge_1.default) is not a function (No Webpack) HOT 4
- A class instance in an array in an object get formed into an object.
- It need filter on merge
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepmerge.