Skip to content

Feature Request: Add a method for converting a selector object to a string #144

@StyleShit

Description

@StyleShit

Currently, the parsing is a one-way ticket, you can take a string and convert it to a selector object.
I propose that we'll have a way to go the other way around - taking a selector and converting it to a string.

Roughly something like this:

const filter = 'MethodDefinition[value.typeParameters]';
const selector = esquery.parse(filter);
const unparsed = esquery.unparse(selector);

filter === unparsed; // true

(not sure about the name though)

I'm willing to send a PR for this if this is something that you think can be done properly by someone who's unfamiliar with the codebase (yet 😄)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions