caoge c760052ff9 机车状态修改 | il y a 8 mois | |
---|---|---|
.. | ||
dist | il y a 8 mois | |
node_modules | il y a 8 mois | |
README.md | il y a 8 mois | |
license.txt | il y a 8 mois | |
package.json | il y a 8 mois | |
parser.js | il y a 8 mois |
ESQuery is a library for querying the AST output by Esprima for patterns of syntax using a CSS style selector system. Check out the demo:
The following selectors are supported:
ForStatement
*
[attr]
[attr="foo"]
or [attr=123]
[attr=/foo.*/]
or (with flags) [attr=/foo.*/is]
[attr!="foo"]
, [attr>2]
, [attr<3]
, [attr>=2]
, or [attr<=3]
[attr.level2="foo"]
FunctionDeclaration > Identifier.id
:first-child
or :last-child
:nth-child(2)
:nth-last-child(1)
ancestor descendant
parent > child
node ~ sibling
node + adjacent
:not(ForStatement)
:has(ForStatement)
:matches([attr] > :first-child, :last-child)
!IfStatement > [name="foo"]
:statement
, :expression
, :declaration
, :function
, or :pattern