Giter Club home page Giter Club logo

Comments (5)

jonschlinkert avatar jonschlinkert commented on June 10, 2024

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.

nikitaeverywhere avatar nikitaeverywhere commented on June 10, 2024

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.

jonschlinkert avatar jonschlinkert commented on June 10, 2024

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.

nikitaeverywhere avatar nikitaeverywhere commented on June 10, 2024

@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.

jonschlinkert avatar jonschlinkert commented on June 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.