Setting a property on a child object does not work #3

Open
wants to merge 1 commit into from

1 participant

@raoulmillais

This commit adds a failing test for setting a property on a nested object. I apologise if I am submitting this bug in the wrong project. I've spent this morning trying to figure out where this bug is happening, but grokking the interplay between burrito, traverse and jsup is thusfar eluding me. I'll keep plugging away and see if I can find the source and add a fix to this request or to the appropriate project, but you may be able to point me in the right direction or identify the source quicker.

Thanks,

@raoulmillais raoulmillais Demonstrate nested object bug
- Setting a property on a nested object throws an exception
- Add a failing test to demonstrate
9c4d712
@raoulmillais

I've spent today looking at this but the depth first annotation traversal and my lack of experience with burrito is making the learning curve quite steep. My use-case is fairly simple (updating a single property on a nested object in a config json) and so I'm going to drop back to a simple string replace for now. I'll revisit it if my needs become more complex.

In case it helps and anyone wants to look into this issue further, this also fails:

jsup('{ "a": [ { "b": "c" } ]}').set([ 'a', 0, 'b' ], 'd');
@boennemann boennemann referenced this pull request in greenkeeperio/greenkeeper Oct 16, 2015
Closed

Update package.json in-place, preserve formatting/comments #49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment