Fix empty pairs in js tree-sitter imenu alist (bug#59945)
The current js--treesit-imenu, used by the JavaScript, TypeScript and
TSX tree-sitter modes, would return empty pairs in the imenu alist if
there were none of that type of symbol.
This would break both the built in imenu and also packages like
consult-imenu.
See https://github.com/minad/consult/issues/697 for the discussion
there.