You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At first glance, looks like this could be achieved by simply replacing the extend function you use with one that first creates the "destination" object with Object.create(Object.getPrototypeOf(value)) before assigning the properties to it.
BTW, if you want a test, you can use it npm install https://github.com/Yaojian/ImmutableAssign.git --save before @engineforce merging the pull request.
Activity
peterholak commentedon Feb 2, 2017
At first glance, looks like this could be achieved by simply replacing the
extendfunction you use with one that first creates the "destination" object withObject.create(Object.getPrototypeOf(value))before assigning the properties to it.Yaojian commentedon Apr 15, 2017
in the quickCopy function, using
new obj.constructor()to create instances of ES6 classes.Object.create(Object.getPrototypeOf(value))does not support ES6 collection types (i.e.Map,Set) because they use native constructors.See this stackoverflow question.
BTW, if you want a test, you can use it
npm install https://github.com/Yaojian/ImmutableAssign.git --savebefore @engineforce merging the pull request.