Conversation
Merging upstream
|
@developit Any chance you could take a look at this PR? It would be very helpful! |
|
Just use |
|
Indeed - any reason |
|
I do use the existing methods, and they work fine. This would just be a convenience thing when using libraries like redux-form where you get dot-and-bracket paths like: |
|
Gotcha. The solution of splitting on non-word characters is really clever, but it breaks for a bunch of property names: dlv(obj, 'foo.some property') // should be equivalent to obj.foo['some property'] |
|
Are you open to modifications to the PR to add more flexibility/account for the edge cases or do you not feel like it's worth the added complexity at this point? |
|
@developit @ajoslin The more I've tried to find a suitable pattern/workaround for this problem the more I realize that's terribly hard and won't stay tiny. Thanks for entertaining the idea. |
Huge thanks to @bwendt-mylo for writing this previously in developit#24
I'm often needing to drill into arrays within nested objects and have paths like the following:
values.conditions[1].operatorThis PR adds the ability for
dlvto accept these types of paths, doing a greedy split on word boundaries instead of splitting on dot. Minimal increase in size to 132b.cc @developit