Comments (5)
What do you think? I can process with the pull request if you agree.
I agree we should support what you expected, but I think a better approach would allow a customizer function to be passed as the last argument so that the user can decide whether or not they want to retain the reference. That would be more consistent with assign
behavior. Does that sound okay?
from assign-deep.
For me "customizer function" sounds a bit strange... How will it work? If it would process each single property from the passed objects (and decide whether or not to clone it) this will slow down the initial implementation. And is the assign
you mentioned corresponds to Object.assign
?
It is hard to tell whether your library should do this by default. Yes, Object.assign
mutates all property values, it's okay for your library to keep the same behavior. In this case, my issue just turns more to a kind of a question :)
from assign-deep.
Actually, after looking at this again, this shouldn't clone, it should only "assign". I think both values in your example should be true
, not false
.
from assign-deep.
@jonschlinkert, my very base case is that as a user, I expected assignDeep
to behave like clone
. In other words, make a 100% clone of the object without mutating any of its properties. If that isn't true, that's okay, however, then I need another library for my case :) Feel free to close this issue.
from assign-deep.
got it, maybe take a look at https://github.com/jonschlinkert/merge-deep, perhaps that's closer to what you need.
from assign-deep.
Related Issues (14)
- Webpack compilation is not compatible HOT 10
- crashes on this object HOT 3
- Difference between this and mixin-deep? HOT 6
- Throw error when string or number passed accidentally? HOT 2
- Functions aren't getting overridden? HOT 6
- cann't assign to an empty object HOT 1
- Is there a way to stop it HOT 1
- v1.0.0 breaks create-react-app build HOT 4
- Changelog HOT 1
- Breaks on arrays HOT 7
- Please upgrade to the latest version to get a critical bugfix
- Multiple arguments overwrites values in arguments HOT 4
- Type definitions HOT 4
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 assign-deep.