Closed mariaines closed 1 year ago
You mean something like this?
VariableDeclaration[kind=const] > VariableDeclarator[id.type=ArrayPattern] > ArrayPattern[elements.0=null]
Yes, that does it! Please forgive the noob question 🙂 Thank you so much @michaelficarra !
No worries, happy I could help.
Hi there,
I'm trying to write a selector to match an array where the first child is null. This issue showed me how to select the first child, but how do I match against a null element when there are no fields to check? I hope this is possible 🤞🏽
Specifically I'm trying to match against:
I can get this to work:
"VariableDeclaration[kind=const] > VariableDeclarator[id.type=ArrayPattern] > ArrayPattern[elements.length=2] >.elements:nth-child(1)[name=someName]"
against: