Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Implement wildcard matcher for arrays #13

Merged
merged 1 commit into from
Oct 1, 2020

Conversation

mkmik
Copy link
Member

@mkmik mkmik commented Oct 1, 2020

Spec https://jsonpath-standard.github.io/internet-draft/#section-2.6.1

A dot child name consisting of a single asterisk is a wild card. It selects all the values of any object node. It also selects all the elements of any array node. It selects no nodes from number, string, or literal nodes.

Spec https://jsonpath-standard.github.io/internet-draft/#section-2.6.1

```
A dot child name consisting of a single asterisk is a wild card. It selects all the values of any object node. It also selects all the elements of any array node. It selects no nodes from number, string, or literal nodes.
```
@mkmik mkmik requested a review from glyn October 1, 2020 11:53
@@ -75,3 +75,25 @@ impl Matcher for Union {
Box::new(self.elements.iter().flat_map(move |it| it.select(node)))
}
}

#[cfg(test)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Love it!

Copy link
Contributor

@glyn glyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff.

@glyn glyn merged commit a29cc74 into jsonpath-standard:main Oct 1, 2020
@mkmik mkmik deleted the wildcard branch October 1, 2020 11:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants