Skip to content

Feature request: compare jsonpaths #172

Open
@gregorychen3

Description

@gregorychen3

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions