Skip to content

Home > vue-metamorph > astHelpers > findAll

astHelpers.findAll() function

Finds all nodes in an AST that match a partial node

Signature:

typescript
export declare function findAll<M extends Matcher<namedTypes.ASTNode | AST.Node>>(ast: AST.Node | namedTypes.ASTNode, matcher: M): (AST.Node & {
    type: M['type'];
})[];

Parameters

Parameter

Type

Description

ast

AST.Node | namedTypes.ASTNode

The node to traverse

matcher

M

Partial object to match against

**Returns:**

(AST.Node & { type: M['type']; })[]

  • All matching nodes