Skip to content
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

Feature request: compare jsonpaths #172

Open
gregorychen3 opened this issue Jun 18, 2022 · 0 comments
Open

Feature request: compare jsonpaths #172

gregorychen3 opened this issue Jun 18, 2022 · 0 comments
Labels

Comments

@gregorychen3
Copy link

Motivation

General purpose feature

Current behavior

N/A

Desired behavior

It could be nice to be able check if a jsonpath is "selected" by another jsonpath. In other words, checking if one jsonpath is the superset of another:

E.g.,

const jp1 = new JsonPath("$.foo.*")
const jp2 = new JsonPath("$.foo.[0]")
jp1.isSupersetOf(jp2) // true

An isEqual feature would be nice as well:

```javascript
const jp1 = new JsonPath("$.foo.0")
const jp2 = new JsonPath("$.foo.[0]")
jp1.isEqual(jp2) // true

Alternatives considered

There doesn't seem to be any other libraries supporting this feature in javascript or typescript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant