electrode-io / electrode-confippet

node.js environment aware application configuration
Other
108 stars 18 forks source link

Union merging arrays? #16

Closed wmertens closed 7 years ago

wmertens commented 7 years ago

I tried using union merge on an array by prepending + to the key, but it turns out that both the source and the target array need to have the + in the key name. That is surprising. Should it not be possible to append to arrays without requiring the original array key to start with a +?

I also noticed that there are still several calls to util.merge instead of util.uMerge in the code, and I wonder if that is correct?

jchip commented 7 years ago

+ is part of the key name. confippet is just doing a little extra if the key name starts with +.

It's been a while, but the merge and uMerge should be working as expected. If you have more specific findings, please open a new issue with that. thanks.

wmertens commented 7 years ago

Yes, I understand that that's the mechanism now, but it is surprising that plugin authors have to change all their array names to + so they can be added to…

With _.mergeDeep it is easy to make a visitor that looks at the keyname and merges into an array without the +…

On Wed, Jun 7, 2017, 6:53 AM Joel Chen notifications@github.com wrote:

  • is part of the key name. confippet is just doing a little extra if the key name starts with +.

It's been a while, but the merge and uMerge should be working as expected. If you have more specific findings, please open a new issue with that. thanks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/electrode-io/electrode-confippet/issues/16#issuecomment-306686188, or mute the thread https://github.com/notifications/unsubscribe-auth/AADWlunkODF_FilA8Iq2l_s0ZvqPLfolks5sBizLgaJpZM4Nv39S .