`get` does not deep pick. Syntactically pleasing workaround?
See original GitHub issueAllow me to speak in code:
var obj = {
family: 'Fosters',
person : {
name : 'Hank',
data : {
id : 2,
checked : false
}
}
};
var amend = {
person : {
data : {
checked : true
}
}
};
var fam = Lazy(obj).assign(amend);
fam.get('family');
// 'Fosters'
fam.get('family.person.data.checked');
// undefined
// EXPECTED: true
Can I do this in a syntactically pleasant way?
Perhaps get
should be extended so we can do something like:
fam.get(['family', 'person', 'data', 'checked'])
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
rust-rfcs/0243-trait-based-exception-handling.md at master · nox/rust ...
This solution is simple, well-behaved, and easy to understand, ... operator itself is suggestive, syntactically lightweight enough to not be bothersome, ...
Read more >rhetorical strategies: any device used to analyze the interplay
Anticipating and addressing counter-arguments: When making the argument, the author, aware of what points his or her opponents will likely take exception to, ......
Read more >Rhetorical Devices Quiz Flashcards - Quizlet
Study with Quizlet and memorize flashcards containing terms like Alliteration, Antithesis, Climax and more.
Read more >Regional Multi-scale Approach for Visually Pleasing Explanations of ...
Thus, this paper proposes a region-based approach that estimates feature importance in terms of appropriately segmented regions. By fusing the saliency maps ...
Read more >Thematic Proto-Roles and Argument Selection - JSTOR
As a novel attack on the perennially vexing questions of the theoretical status of thematic roles and the inventory of possible roles, this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m on the fence on this one. On the one hand, I’m not sure deep-picking really falls under the purview of this library. Lazy.js is about dealing with sequences; I never envisioned it as a do-everything utility belt. On the other hand, I have historically compared it directly to Underscore and Lodash, which describe themselves as utility libraries. So maybe it’s only fair to expect this.
I’ll have a think on it.
@nicemaker That’s be nice considering that is how Lodash does it (so newcomers (like me!) would feel right at home), however I second @Redsandro that an array would be faster than parsing/splitting a string.
I was under the impression that the following would work, but it doesn’t and I’m not sure why: