From 23227fe22e6fa26e1b317b1c0ae5a7eca43460c7 Mon Sep 17 00:00:00 2001 From: Joel Bradshaw Date: Wed, 13 Oct 2021 13:30:46 -0700 Subject: [PATCH] Export getPath This is a useful utility function outside the library, and folks who are doing selectors (like me) will often want to do something like this without having to build up a whole selector. I think it's useful enough and simple enough to make part of the public API. --- esquery.js | 1 + 1 file changed, 1 insertion(+) diff --git a/esquery.js b/esquery.js index b451ad6..b00e70f 100644 --- a/esquery.js +++ b/esquery.js @@ -467,6 +467,7 @@ function query(ast, selector, options) { return match(ast, parse(selector), options); } +query.getPath = getPath; query.parse = parse; query.match = match; query.traverse = traverse;