-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ⭐ dict.recurse( .. ) Recurse through an arbitrary dict (JSON/YAML/...) structure and find entries that match a search criteria. For example, you can set up a data structure like this: ```json { "users": [ {"name": "bob"} ], "owners": { "admins": [ {"name": "joy", "isOwner": true} ] } } ``` Finding any user in this list is difficult with traditional mechanisms, since you'd have to understand the data structure and where to search. With `recurse` it is made much easier: ```coffee jdata.recurse( name != empty ) ``` ``` [ 0: { name: "bob" } 1: { isOwner: true name: "joy" } ] ``` You could then just grab the names and continue: ```coffee jdata.recurse( name != empty ).map(name) ``` ``` [ 0: "bob" 1: "joy" ] ``` Signed-off-by: Dominik Richter <[email protected]> * 🟢 fix test for updated dummy.json Signed-off-by: Dominik Richter <[email protected]> --------- Signed-off-by: Dominik Richter <[email protected]>
- Loading branch information
Showing
6 changed files
with
159 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters