-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Add getAsCollection() method #8
Comments
May need to supplement this with |
Nice proposal, Alex went through this a couple of days ago if I'm not wrong. It's just a matter of personal taste but what do you think about:
Perhaps |
I like |
I mean you can also do |
Good point, maybe a tad less elegant though, personally I like the idea of having an alternative method like |
Yeah the problem with I think you were right with |
When you call
get('some.node')
if the node doesn't exist you getnull
(or pass a default value) .Suggest adding
getAsCollection()
to ensure a collection is always returned regardless of whether the node exists, or if the node is an item/collection. This is useful due to chaining.Example:
The text was updated successfully, but these errors were encountered: