unclechu / node-deep-extend

Recursive extend module
MIT License
202 stars 53 forks source link

README: Fixing a mistake in the example code #43

Closed panphora closed 5 years ago

panphora commented 5 years ago

When I was reading over the docs last night I was confused when the example code didn't copy a property from the second object into the first object. After trying out the code myself, however, I figured out it was just a small issue with the README.

unclechu commented 5 years ago

@panphora Thanks for noticing that. But please replace \t (tab symbol) with spaces.

unclechu commented 5 years ago

@panphora Oh, sorry, I just haven't paying enough attention, the c is actually there but not in alphabetical order, it comes after g. It is covered in tests the same way. And it is also exact result of the deepExtend function, because in JavaScript keys of an Object does not have alphabetical order constraint:

const ob = {a:1,c:3}; ob.b = 2;
console.log(ob); // Object { a: 1, c: 3, b: 2 }