Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NodePath<T>

Type parameters

  • T

Hierarchy

  • NodePath

Index

Constructors

Properties

Methods

Constructors

constructor

  • Parameters

    Returns NodePath

Properties

container

container: object | object[]

context

contexts

contexts: TraversalContext[]

data

data: object

hub

hub: Hub

inList

inList: boolean

key

key: string | number

listKey

listKey: string

node

node: T

opts

opts: object

parent

parent: Node

parentKey

parentKey: string

parentPath

parentPath: NodePath

removed

removed: boolean

scope

scope: Scope

shouldSkip

shouldSkip: boolean

shouldStop

shouldStop: boolean

skipKeys

skipKeys: object

state

state: any

type

type: T extends undefined | null ? string | null : string

typeAnnotation

typeAnnotation: object

Methods

addComment

  • addComment(type: string, content: string, line?: undefined | false | true): void
  • Parameters

    • type: string
    • content: string
    • Optional line: undefined | false | true

    Returns void

addComments

  • addComments(type: string, comments: any[]): void
  • Give node comments of the specified type.

    Parameters

    • type: string
    • comments: any[]

    Returns void

assertAnyTypeAnnotation

  • assertAnyTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertArrayExpression

  • assertArrayExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertArrayPattern

  • assertArrayPattern(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertArrayTypeAnnotation

  • assertArrayTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertArrowFunctionExpression

  • assertArrowFunctionExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertAssignmentExpression

  • assertAssignmentExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertAssignmentPattern

  • assertAssignmentPattern(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertAwaitExpression

  • assertAwaitExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertBinary

  • assertBinary(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertBinaryExpression

  • assertBinaryExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertBindExpression

  • assertBindExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertBlock

  • assertBlock(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertBlockParent

  • assertBlockParent(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertBlockStatement

  • assertBlockStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertBooleanLiteral

  • assertBooleanLiteral(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertBooleanLiteralTypeAnnotation

  • assertBooleanLiteralTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertBooleanTypeAnnotation

  • assertBooleanTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertBreakStatement

  • assertBreakStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertCallExpression

  • assertCallExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertCatchClause

  • assertCatchClause(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertClass

  • assertClass(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertClassBody

  • assertClassBody(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertClassDeclaration

  • assertClassDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertClassExpression

  • assertClassExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertClassImplements

  • assertClassImplements(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertClassMethod

  • assertClassMethod(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertClassProperty

  • assertClassProperty(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertCompletionStatement

  • assertCompletionStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertConditional

  • assertConditional(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertConditionalExpression

  • assertConditionalExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertContinueStatement

  • assertContinueStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDebuggerStatement

  • assertDebuggerStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDeclaration

  • assertDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDeclareClass

  • assertDeclareClass(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDeclareFunction

  • assertDeclareFunction(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDeclareInterface

  • assertDeclareInterface(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDeclareModule

  • assertDeclareModule(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDeclareTypeAlias

  • assertDeclareTypeAlias(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDeclareVariable

  • assertDeclareVariable(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDecorator

  • assertDecorator(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDirective

  • assertDirective(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDirectiveLiteral

  • assertDirectiveLiteral(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDoExpression

  • assertDoExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertDoWhileStatement

  • assertDoWhileStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertEmptyStatement

  • assertEmptyStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertExistentialTypeParam

  • assertExistentialTypeParam(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertExportAllDeclaration

  • assertExportAllDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertExportDeclaration

  • assertExportDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertExportDefaultDeclaration

  • assertExportDefaultDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertExportDefaultSpecifier

  • assertExportDefaultSpecifier(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertExportNamedDeclaration

  • assertExportNamedDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertExportNamespaceSpecifier

  • assertExportNamespaceSpecifier(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertExportSpecifier

  • assertExportSpecifier(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertExpression

  • assertExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertExpressionStatement

  • assertExpressionStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertExpressionWrapper

  • assertExpressionWrapper(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertFile

  • assertFile(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertFlow

  • assertFlow(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertFlowBaseAnnotation

  • assertFlowBaseAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertFlowDeclaration

  • assertFlowDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertFor

  • assertFor(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertForInStatement

  • assertForInStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertForOfStatement

  • assertForOfStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertForStatement

  • assertForStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertForXStatement

  • assertForXStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertFunction

  • assertFunction(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertFunctionDeclaration

  • assertFunctionDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertFunctionExpression

  • assertFunctionExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertFunctionParent

  • assertFunctionParent(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertFunctionTypeAnnotation

  • assertFunctionTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertFunctionTypeParam

  • assertFunctionTypeParam(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertGenericTypeAnnotation

  • assertGenericTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertIdentifier

  • assertIdentifier(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertIfStatement

  • assertIfStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertImmutable

  • assertImmutable(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertImportDeclaration

  • assertImportDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertImportDefaultSpecifier

  • assertImportDefaultSpecifier(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertImportNamespaceSpecifier

  • assertImportNamespaceSpecifier(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertImportSpecifier

  • assertImportSpecifier(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertInterfaceDeclaration

  • assertInterfaceDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertInterfaceExtends

  • assertInterfaceExtends(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertIntersectionTypeAnnotation

  • assertIntersectionTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertJSX

  • assertJSX(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertJSXAttribute

  • assertJSXAttribute(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertJSXClosingElement

  • assertJSXClosingElement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertJSXElement

  • assertJSXElement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertJSXEmptyExpression

  • assertJSXEmptyExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertJSXExpressionContainer

  • assertJSXExpressionContainer(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertJSXIdentifier

  • assertJSXIdentifier(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertJSXMemberExpression

  • assertJSXMemberExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertJSXNamespacedName

  • assertJSXNamespacedName(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertJSXOpeningElement

  • assertJSXOpeningElement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertJSXSpreadAttribute

  • assertJSXSpreadAttribute(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertJSXText

  • assertJSXText(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertLVal

  • assertLVal(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertLabeledStatement

  • assertLabeledStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertLiteral

  • assertLiteral(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertLogicalExpression

  • assertLogicalExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertLoop

  • assertLoop(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertMemberExpression

  • assertMemberExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertMetaProperty

  • assertMetaProperty(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertMethod

  • assertMethod(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertMixedTypeAnnotation

  • assertMixedTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertModuleDeclaration

  • assertModuleDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertModuleSpecifier

  • assertModuleSpecifier(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertNewExpression

  • assertNewExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertNoop

  • assertNoop(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertNullLiteral

  • assertNullLiteral(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertNullLiteralTypeAnnotation

  • assertNullLiteralTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertNullableTypeAnnotation

  • assertNullableTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertNumberLiteral

  • assertNumberLiteral(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertNumberTypeAnnotation

  • assertNumberTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertNumericLiteral

  • assertNumericLiteral(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertNumericLiteralTypeAnnotation

  • assertNumericLiteralTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertObjectExpression

  • assertObjectExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertObjectMember

  • assertObjectMember(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertObjectMethod

  • assertObjectMethod(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertObjectPattern

  • assertObjectPattern(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertObjectProperty

  • assertObjectProperty(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertObjectTypeAnnotation

  • assertObjectTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertObjectTypeCallProperty

  • assertObjectTypeCallProperty(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertObjectTypeIndexer

  • assertObjectTypeIndexer(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertObjectTypeProperty

  • assertObjectTypeProperty(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertParenthesizedExpression

  • assertParenthesizedExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertPattern

  • assertPattern(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertProgram

  • assertProgram(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertProperty

  • assertProperty(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertPureish

  • assertPureish(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertQualifiedTypeIdentifier

  • assertQualifiedTypeIdentifier(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertRegExpLiteral

  • assertRegExpLiteral(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertRegexLiteral

  • assertRegexLiteral(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertRestElement

  • assertRestElement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertRestProperty

  • assertRestProperty(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertReturnStatement

  • assertReturnStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertScopable

  • assertScopable(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertSequenceExpression

  • assertSequenceExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertSpreadElement

  • assertSpreadElement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertSpreadProperty

  • assertSpreadProperty(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertStatement

  • assertStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertStringLiteral

  • assertStringLiteral(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertStringLiteralTypeAnnotation

  • assertStringLiteralTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertStringTypeAnnotation

  • assertStringTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertSuper

  • assertSuper(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertSwitchCase

  • assertSwitchCase(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertSwitchStatement

  • assertSwitchStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertTaggedTemplateExpression

  • assertTaggedTemplateExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertTemplateElement

  • assertTemplateElement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertTemplateLiteral

  • assertTemplateLiteral(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertTerminatorless

  • assertTerminatorless(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertThisExpression

  • assertThisExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertThisTypeAnnotation

  • assertThisTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertThrowStatement

  • assertThrowStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertTryStatement

  • assertTryStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertTupleTypeAnnotation

  • assertTupleTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertTypeAlias

  • assertTypeAlias(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertTypeAnnotation

  • assertTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertTypeCastExpression

  • assertTypeCastExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertTypeParameterDeclaration

  • assertTypeParameterDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertTypeParameterInstantiation

  • assertTypeParameterInstantiation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertTypeofTypeAnnotation

  • assertTypeofTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertUnaryExpression

  • assertUnaryExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertUnaryLike

  • assertUnaryLike(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertUnionTypeAnnotation

  • assertUnionTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertUpdateExpression

  • assertUpdateExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertUserWhitespacable

  • assertUserWhitespacable(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertVariableDeclaration

  • assertVariableDeclaration(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertVariableDeclarator

  • assertVariableDeclarator(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertVoidTypeAnnotation

  • assertVoidTypeAnnotation(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertWhile

  • assertWhile(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertWhileStatement

  • assertWhileStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertWithStatement

  • assertWithStatement(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

assertYieldExpression

  • assertYieldExpression(opts?: undefined | object): void
  • Parameters

    • Optional opts: undefined | object

    Returns void

baseTypeStrictlyMatches

  • baseTypeStrictlyMatches(right: NodePath): boolean
  • Parameters

    Returns boolean

buildCodeFrameError

  • buildCodeFrameError<TError>(msg: string, Error?: undefined | {}): TError
  • Type parameters

    Parameters

    • msg: string
    • Optional Error: undefined | {}

    Returns TError

call

  • call(key: string): boolean
  • Parameters

    • key: string

    Returns boolean

canHaveVariableDeclarationOrExpression

  • canHaveVariableDeclarationOrExpression(): boolean
  • This checks whether or not we're in one of the following positions:

    for (KEY in right); for (KEY;;);

    This is because these spots allow VariableDeclarations AND normal expressions so we need to tell the path replacement that it's ok to replace this with an expression.

    Returns boolean

canSwapBetweenExpressionAndStatement

  • canSwapBetweenExpressionAndStatement(replacement: Node): boolean
  • This checks whether we are swapping an arrow function's body between an expression and a block statement (or vice versa).

    This is because arrow functions may implicitly return an expression, which is the same as containing a block statement.

    Parameters

    Returns boolean

couldBeBaseType

  • couldBeBaseType(name: string): boolean
  • Parameters

    • name: string

    Returns boolean

debug

  • debug(buildMessage: () => string): void
  • Parameters

    • buildMessage: () => string
        • (): string
        • Returns string

    Returns void

equals

  • equals(key: string, value: any): boolean
  • Check whether the path node key strict equals value.

    Parameters

    • key: string
    • value: any

    Returns boolean

evaluate

  • evaluate(): { confident: boolean; value: any }
  • Walk the input node and statically evaluate it.

    Returns an object in the form { confident, value }. confident indicates whether or not we had to drop out of evaluating the expression because of hitting an unknown node that we couldn't confidently find the value of.

    Example:

    t.evaluate(parse("5 + 5")) // { confident: true, value: 10 } t.evaluate(parse("!true")) // { confident: true, value: false } t.evaluate(parse("foo + foo")) // { confident: false, value: undefined }

    Returns { confident: boolean; value: any }

    • confident: boolean
    • value: any

evaluateTruthy

  • evaluateTruthy(): boolean
  • Walk the input node and statically evaluate if it's truthy.

    Returning true when we're sure that the expression will evaluate to a truthy value, false if we're sure that it will evaluate to a falsy value and undefined if we aren't sure. Because of this please do not rely on coercion when using this method and check with === if it's false.

    Returns boolean

find

  • Parameters

    Returns NodePath

findParent

  • Call the provided callback with the NodePaths of all the parents. When the callback returns a truthy value, we return that node path.

    Parameters

    Returns NodePath

get

  • get<K>(key: K, context?: boolean | TraversalContext): T[K] extends Array<Node | null | undefined> ? Array<NodePath<T[K][number]>> : T[K] extends Node | null | undefined ? NodePath<T[K]> : never
  • get(key: string, context?: boolean | TraversalContext): NodePath | NodePath[]
  • Type parameters

    • K: keyof T

    Parameters

    Returns T[K] extends Array<Node | null | undefined> ? Array<NodePath<T[K][number]>> : T[K] extends Node | null | undefined ? NodePath<T[K]> : never

  • Parameters

    Returns NodePath | NodePath[]

getAllNextSiblings

  • Returns NodePath[]

getAllPrevSiblings

  • Returns NodePath[]

getAncestry

  • Build an array of node paths containing the entire ancestry of the current node path.

    NOTE: The current node path is included in this.

    Returns NodePath[]

getBindingIdentifiers

  • getBindingIdentifiers(duplicates?: undefined | false | true): Node[]
  • Parameters

    • Optional duplicates: undefined | false | true

    Returns Node[]

getCompletionRecords

  • Returns NodePath[]

getData

  • getData(key: string, def?: any): any
  • Parameters

    • key: string
    • Optional def: any

    Returns any

getDeepestCommonAncestorFrom

  • Get the earliest path in the tree where the provided paths intersect.

    Parameters

    Returns NodePath

getEarliestCommonAncestorFrom

  • Get the deepest common ancestor and then from it, get the earliest relationship path to that ancestor.

    Earliest is defined as being "before" all the other nodes in terms of list container position and visiting key.

    Parameters

    Returns NodePath[]

getFunctionParent

  • getFunctionParent(): NodePath<t.Function>
  • Get the parent function of the current path.

    Returns NodePath<t.Function>

getOpposite

  • Returns NodePath

getOuterBindingIdentifiers

  • getOuterBindingIdentifiers(duplicates?: undefined | false | true): Node[]
  • Parameters

    • Optional duplicates: undefined | false | true

    Returns Node[]

getPathLocation

  • getPathLocation(): string
  • Returns string

getScope

  • Parameters

    Returns Scope

getSibling

  • getSibling(key: string | number): NodePath
  • Parameters

    • key: string | number

    Returns NodePath

getSource

  • getSource(): string
  • Get the source code associated with this node.

    Returns string

getStatementParent

  • getStatementParent(): NodePath<t.Statement>
  • Walk up the tree until we hit a parent node path in a list.

    Returns NodePath<t.Statement>

getTypeAnnotation

  • getTypeAnnotation(): t.FlowType
  • Infer the type of the current NodePath.

    Returns t.FlowType

has

  • has(key: string): boolean
  • Check whether we have the input key. If the key references an array then we check if the array has any items, otherwise we just check if it's falsy.

    Parameters

    • key: string

    Returns boolean

hoist

  • hoist(scope: Scope): void
  • Hoist the current node to the highest scope possible and return a UID referencing it.

    Parameters

    Returns void

inType

  • inType(...candidateTypes: string[]): boolean
  • Parameters

    • Rest ...candidateTypes: string[]

    Returns boolean

insertAfter

  • insertAfter(nodes: Node | Node[]): any
  • Insert the provided nodes after the current one. When inserting nodes after an expression, ensure that the completion record is correct by pushing the current node.

    Parameters

    Returns any

insertBefore

  • insertBefore(nodes: Node | Node[]): any
  • Insert the provided nodes before the current one.

    Parameters

    Returns any

is

  • is(key: string): boolean
  • Alias of has.

    Parameters

    • key: string

    Returns boolean

isAnyTypeAnnotation

  • isAnyTypeAnnotation(opts?: undefined | object): this is NodePath<AnyTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<AnyTypeAnnotation>

isArrayExpression

  • isArrayExpression(opts?: undefined | object): this is NodePath<ArrayExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ArrayExpression>

isArrayPattern

  • isArrayPattern(opts?: undefined | object): this is NodePath<ArrayPattern>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ArrayPattern>

isArrayTypeAnnotation

  • isArrayTypeAnnotation(opts?: undefined | object): this is NodePath<ArrayTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ArrayTypeAnnotation>

isArrowFunctionExpression

  • isArrowFunctionExpression(opts?: undefined | object): this is NodePath<ArrowFunctionExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ArrowFunctionExpression>

isAssignmentExpression

  • isAssignmentExpression(opts?: undefined | object): this is NodePath<AssignmentExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<AssignmentExpression>

isAssignmentPattern

  • isAssignmentPattern(opts?: undefined | object): this is NodePath<AssignmentPattern>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<AssignmentPattern>

isAwaitExpression

  • isAwaitExpression(opts?: undefined | object): this is NodePath<AwaitExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<AwaitExpression>

isBaseType

  • isBaseType(baseName: string, soft?: undefined | false | true): boolean
  • Parameters

    • baseName: string
    • Optional soft: undefined | false | true

    Returns boolean

isBinary

  • isBinary(opts?: undefined | object): this is NodePath<t.Binary>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Binary>

isBinaryExpression

  • isBinaryExpression(opts?: undefined | object): this is NodePath<BinaryExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<BinaryExpression>

isBindExpression

  • isBindExpression(opts?: undefined | object): this is NodePath<BindExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<BindExpression>

isBindingIdentifier

  • isBindingIdentifier(opts?: undefined | object): this is NodePath<Identifier>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<Identifier>

isBlacklisted

  • isBlacklisted(): boolean
  • Returns boolean

isBlock

  • isBlock(opts?: undefined | object): this is NodePath<t.Block>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Block>

isBlockParent

  • isBlockParent(opts?: undefined | object): this is NodePath<t.BlockParent>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.BlockParent>

isBlockScoped

  • isBlockScoped(opts?: undefined | object): this is NodePath<FunctionDeclaration | ClassDeclaration | VariableDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<FunctionDeclaration | ClassDeclaration | VariableDeclaration>

isBlockStatement

  • isBlockStatement(opts?: undefined | object): this is NodePath<BlockStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<BlockStatement>

isBooleanLiteral

  • isBooleanLiteral(opts?: undefined | object): this is NodePath<BooleanLiteral>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<BooleanLiteral>

isBooleanLiteralTypeAnnotation

  • isBooleanLiteralTypeAnnotation(opts?: undefined | object): this is NodePath<BooleanLiteralTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<BooleanLiteralTypeAnnotation>

isBooleanTypeAnnotation

  • isBooleanTypeAnnotation(opts?: undefined | object): this is NodePath<BooleanTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<BooleanTypeAnnotation>

isBreakStatement

  • isBreakStatement(opts?: undefined | object): this is NodePath<BreakStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<BreakStatement>

isCallExpression

  • isCallExpression(opts?: undefined | object): this is NodePath<CallExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<CallExpression>

isCatchClause

  • isCatchClause(opts?: undefined | object): this is NodePath<CatchClause>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<CatchClause>

isClass

  • isClass(opts?: undefined | object): this is NodePath<t.Class>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Class>

isClassBody

  • isClassBody(opts?: undefined | object): this is NodePath<ClassBody>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ClassBody>

isClassDeclaration

  • isClassDeclaration(opts?: undefined | object): this is NodePath<ClassDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ClassDeclaration>

isClassExpression

  • isClassExpression(opts?: undefined | object): this is NodePath<ClassExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ClassExpression>

isClassImplements

  • isClassImplements(opts?: undefined | object): this is NodePath<ClassImplements>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ClassImplements>

isClassMethod

  • isClassMethod(opts?: undefined | object): this is NodePath<ClassMethod>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ClassMethod>

isClassProperty

  • isClassProperty(opts?: undefined | object): this is NodePath<ClassProperty>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ClassProperty>

isCompletionRecord

  • isCompletionRecord(allowInsideFunction?: undefined | false | true): boolean
  • Check whether the current path references a completion record

    Parameters

    • Optional allowInsideFunction: undefined | false | true

    Returns boolean

isCompletionStatement

  • isCompletionStatement(opts?: undefined | object): this is NodePath<t.CompletionStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.CompletionStatement>

isConditional

  • isConditional(opts?: undefined | object): this is NodePath<t.Conditional>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Conditional>

isConditionalExpression

  • isConditionalExpression(opts?: undefined | object): this is NodePath<ConditionalExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ConditionalExpression>

isContinueStatement

  • isContinueStatement(opts?: undefined | object): this is NodePath<ContinueStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ContinueStatement>

isDebuggerStatement

  • isDebuggerStatement(opts?: undefined | object): this is NodePath<DebuggerStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<DebuggerStatement>

isDeclaration

  • isDeclaration(opts?: undefined | object): this is NodePath<t.Declaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Declaration>

isDeclareClass

  • isDeclareClass(opts?: undefined | object): this is NodePath<DeclareClass>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<DeclareClass>

isDeclareFunction

  • isDeclareFunction(opts?: undefined | object): this is NodePath<DeclareFunction>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<DeclareFunction>

isDeclareInterface

  • isDeclareInterface(opts?: undefined | object): this is NodePath<DeclareInterface>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<DeclareInterface>

isDeclareModule

  • isDeclareModule(opts?: undefined | object): this is NodePath<DeclareModule>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<DeclareModule>

isDeclareTypeAlias

  • isDeclareTypeAlias(opts?: undefined | object): this is NodePath<DeclareTypeAlias>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<DeclareTypeAlias>

isDeclareVariable

  • isDeclareVariable(opts?: undefined | object): this is NodePath<DeclareVariable>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<DeclareVariable>

isDecorator

  • isDecorator(opts?: undefined | object): this is NodePath<Decorator>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<Decorator>

isDirective

  • isDirective(opts?: undefined | object): this is NodePath<Directive>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<Directive>

isDirectiveLiteral

  • isDirectiveLiteral(opts?: undefined | object): this is NodePath<DirectiveLiteral>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<DirectiveLiteral>

isDoExpression

  • isDoExpression(opts?: undefined | object): this is NodePath<DoExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<DoExpression>

isDoWhileStatement

  • isDoWhileStatement(opts?: undefined | object): this is NodePath<DoWhileStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<DoWhileStatement>

isEmptyStatement

  • isEmptyStatement(opts?: undefined | object): this is NodePath<EmptyStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<EmptyStatement>

isExportAllDeclaration

  • isExportAllDeclaration(opts?: undefined | object): this is NodePath<ExportAllDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ExportAllDeclaration>

isExportDeclaration

  • isExportDeclaration(opts?: undefined | object): this is NodePath<t.ExportDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.ExportDeclaration>

isExportDefaultDeclaration

  • isExportDefaultDeclaration(opts?: undefined | object): this is NodePath<ExportDefaultDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ExportDefaultDeclaration>

isExportDefaultSpecifier

  • isExportDefaultSpecifier(opts?: undefined | object): this is NodePath<ExportDefaultSpecifier>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ExportDefaultSpecifier>

isExportNamedDeclaration

  • isExportNamedDeclaration(opts?: undefined | object): this is NodePath<ExportNamedDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ExportNamedDeclaration>

isExportNamespaceSpecifier

  • isExportNamespaceSpecifier(opts?: undefined | object): this is NodePath<ExportNamespaceSpecifier>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ExportNamespaceSpecifier>

isExportSpecifier

  • isExportSpecifier(opts?: undefined | object): this is NodePath<ExportSpecifier>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ExportSpecifier>

isExpression

  • isExpression(opts?: undefined | object): this is NodePath<t.Expression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Expression>

isExpressionStatement

  • isExpressionStatement(opts?: undefined | object): this is NodePath<ExpressionStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ExpressionStatement>

isExpressionWrapper

  • isExpressionWrapper(opts?: undefined | object): this is NodePath<t.ExpressionWrapper>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.ExpressionWrapper>

isFile

  • isFile(opts?: undefined | object): this is NodePath<File>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<File>

isFlow

  • isFlow(opts?: undefined | object): this is NodePath<t.Flow>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Flow>

isFlowBaseAnnotation

  • isFlowBaseAnnotation(opts?: undefined | object): this is NodePath<t.FlowBaseAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.FlowBaseAnnotation>

isFlowDeclaration

  • isFlowDeclaration(opts?: undefined | object): this is NodePath<t.FlowDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.FlowDeclaration>

isFor

  • isFor(opts?: undefined | object): this is NodePath<t.For>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.For>

isForInStatement

  • isForInStatement(opts?: undefined | object): this is NodePath<ForInStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ForInStatement>

isForOfStatement

  • isForOfStatement(opts?: undefined | object): this is NodePath<ForOfStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ForOfStatement>

isForStatement

  • isForStatement(opts?: undefined | object): this is NodePath<ForStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ForStatement>

isForXStatement

  • isForXStatement(opts?: undefined | object): this is NodePath<t.ForXStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.ForXStatement>

isFunction

  • isFunction(opts?: undefined | object): this is NodePath<t.Function>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Function>

isFunctionDeclaration

  • isFunctionDeclaration(opts?: undefined | object): this is NodePath<FunctionDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<FunctionDeclaration>

isFunctionExpression

  • isFunctionExpression(opts?: undefined | object): this is NodePath<FunctionExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<FunctionExpression>

isFunctionParent

  • isFunctionParent(opts?: undefined | object): this is NodePath<t.FunctionParent>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.FunctionParent>

isFunctionTypeAnnotation

  • isFunctionTypeAnnotation(opts?: undefined | object): this is NodePath<FunctionTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<FunctionTypeAnnotation>

isFunctionTypeParam

  • isFunctionTypeParam(opts?: undefined | object): this is NodePath<FunctionTypeParam>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<FunctionTypeParam>

isGenerated

  • isGenerated(opts?: undefined | object): boolean
  • Parameters

    • Optional opts: undefined | object

    Returns boolean

isGenericType

  • isGenericType(genericName: string): boolean
  • Parameters

    • genericName: string

    Returns boolean

isGenericTypeAnnotation

  • isGenericTypeAnnotation(opts?: undefined | object): this is NodePath<GenericTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<GenericTypeAnnotation>

isIdentifier

  • isIdentifier(opts?: undefined | object): this is NodePath<Identifier>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<Identifier>

isIfStatement

  • isIfStatement(opts?: undefined | object): this is NodePath<IfStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<IfStatement>

isImmutable

  • isImmutable(opts?: undefined | object): this is NodePath<t.Immutable>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Immutable>

isImportDeclaration

  • isImportDeclaration(opts?: undefined | object): this is NodePath<ImportDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ImportDeclaration>

isImportDefaultSpecifier

  • isImportDefaultSpecifier(opts?: undefined | object): this is NodePath<ImportDefaultSpecifier>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ImportDefaultSpecifier>

isImportNamespaceSpecifier

  • isImportNamespaceSpecifier(opts?: undefined | object): this is NodePath<ImportNamespaceSpecifier>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ImportNamespaceSpecifier>

isImportSpecifier

  • isImportSpecifier(opts?: undefined | object): this is NodePath<ImportSpecifier>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ImportSpecifier>

isInterfaceDeclaration

  • isInterfaceDeclaration(opts?: undefined | object): this is NodePath<InterfaceDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<InterfaceDeclaration>

isInterfaceExtends

  • isInterfaceExtends(opts?: undefined | object): this is NodePath<InterfaceExtends>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<InterfaceExtends>

isIntersectionTypeAnnotation

  • isIntersectionTypeAnnotation(opts?: undefined | object): this is NodePath<IntersectionTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<IntersectionTypeAnnotation>

isJSX

  • isJSX(opts?: undefined | object): this is NodePath<t.JSX>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.JSX>

isJSXAttribute

  • isJSXAttribute(opts?: undefined | object): this is NodePath<JSXAttribute>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<JSXAttribute>

isJSXClosingElement

  • isJSXClosingElement(opts?: undefined | object): this is NodePath<JSXClosingElement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<JSXClosingElement>

isJSXElement

  • isJSXElement(opts?: undefined | object): this is NodePath<JSXElement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<JSXElement>

isJSXEmptyExpression

  • isJSXEmptyExpression(opts?: undefined | object): this is NodePath<JSXEmptyExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<JSXEmptyExpression>

isJSXExpressionContainer

  • isJSXExpressionContainer(opts?: undefined | object): this is NodePath<JSXExpressionContainer>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<JSXExpressionContainer>

isJSXIdentifier

  • isJSXIdentifier(opts?: undefined | object): this is NodePath<JSXIdentifier>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<JSXIdentifier>

isJSXMemberExpression

  • isJSXMemberExpression(opts?: undefined | object): this is NodePath<JSXMemberExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<JSXMemberExpression>

isJSXNamespacedName

  • isJSXNamespacedName(opts?: undefined | object): this is NodePath<JSXNamespacedName>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<JSXNamespacedName>

isJSXOpeningElement

  • isJSXOpeningElement(opts?: undefined | object): this is NodePath<JSXOpeningElement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<JSXOpeningElement>

isJSXSpreadAttribute

  • isJSXSpreadAttribute(opts?: undefined | object): this is NodePath<JSXSpreadAttribute>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<JSXSpreadAttribute>

isJSXText

  • isJSXText(opts?: undefined | object): this is NodePath<JSXText>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<JSXText>

isLVal

  • isLVal(opts?: undefined | object): this is NodePath<t.LVal>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.LVal>

isLabeledStatement

  • isLabeledStatement(opts?: undefined | object): this is NodePath<LabeledStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<LabeledStatement>

isLiteral

  • isLiteral(opts?: undefined | object): this is NodePath<t.Literal>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Literal>

isLogicalExpression

  • isLogicalExpression(opts?: undefined | object): this is NodePath<LogicalExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<LogicalExpression>

isLoop

  • isLoop(opts?: undefined | object): this is NodePath<t.Loop>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Loop>

isMemberExpression

  • isMemberExpression(opts?: undefined | object): this is NodePath<MemberExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<MemberExpression>

isMetaProperty

  • isMetaProperty(opts?: undefined | object): this is NodePath<MetaProperty>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<MetaProperty>

isMethod

  • isMethod(opts?: undefined | object): this is NodePath<t.Method>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Method>

isMixedTypeAnnotation

  • isMixedTypeAnnotation(opts?: undefined | object): this is NodePath<MixedTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<MixedTypeAnnotation>

isModuleDeclaration

  • isModuleDeclaration(opts?: undefined | object): this is NodePath<t.ModuleDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.ModuleDeclaration>

isModuleSpecifier

  • isModuleSpecifier(opts?: undefined | object): this is NodePath<t.ModuleSpecifier>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.ModuleSpecifier>

isNewExpression

  • isNewExpression(opts?: undefined | object): this is NodePath<NewExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<NewExpression>

isNodeType

  • isNodeType(type: string): boolean
  • Check the type against our stored internal type of the node. This is handy when a node has been removed yet we still internally know the type and need it to calculate node replacement.

    Parameters

    • type: string

    Returns boolean

isNoop

  • isNoop(opts?: undefined | object): this is NodePath<Noop>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<Noop>

isNullLiteral

  • isNullLiteral(opts?: undefined | object): this is NodePath<NullLiteral>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<NullLiteral>

isNullLiteralTypeAnnotation

  • isNullLiteralTypeAnnotation(opts?: undefined | object): this is NodePath<NullLiteralTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<NullLiteralTypeAnnotation>

isNullableTypeAnnotation

  • isNullableTypeAnnotation(opts?: undefined | object): this is NodePath<NullableTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<NullableTypeAnnotation>

isNumberLiteral

  • isNumberLiteral(opts?: undefined | object): this is NodePath<NumericLiteral>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<NumericLiteral>

isNumberTypeAnnotation

  • isNumberTypeAnnotation(opts?: undefined | object): this is NodePath<NumberTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<NumberTypeAnnotation>

isNumericLiteral

  • isNumericLiteral(opts?: undefined | object): this is NodePath<NumericLiteral>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<NumericLiteral>

isObjectExpression

  • isObjectExpression(opts?: undefined | object): this is NodePath<ObjectExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ObjectExpression>

isObjectMember

  • isObjectMember(opts?: undefined | object): this is NodePath<t.ObjectMember>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.ObjectMember>

isObjectMethod

  • isObjectMethod(opts?: undefined | object): this is NodePath<ObjectMethod>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ObjectMethod>

isObjectPattern

  • isObjectPattern(opts?: undefined | object): this is NodePath<ObjectPattern>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ObjectPattern>

isObjectProperty

  • isObjectProperty(opts?: undefined | object): this is NodePath<ObjectProperty>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ObjectProperty>

isObjectTypeAnnotation

  • isObjectTypeAnnotation(opts?: undefined | object): this is NodePath<ObjectTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ObjectTypeAnnotation>

isObjectTypeCallProperty

  • isObjectTypeCallProperty(opts?: undefined | object): this is NodePath<ObjectTypeCallProperty>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ObjectTypeCallProperty>

isObjectTypeIndexer

  • isObjectTypeIndexer(opts?: undefined | object): this is NodePath<ObjectTypeIndexer>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ObjectTypeIndexer>

isObjectTypeProperty

  • isObjectTypeProperty(opts?: undefined | object): this is NodePath<ObjectTypeProperty>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ObjectTypeProperty>

isParenthesizedExpression

  • isParenthesizedExpression(opts?: undefined | object): this is NodePath<ParenthesizedExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ParenthesizedExpression>

isPattern

  • isPattern(opts?: undefined | object): this is NodePath<t.Pattern>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Pattern>

isProgram

  • isProgram(opts?: undefined | object): this is NodePath<Program>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<Program>

isProperty

  • isProperty(opts?: undefined | object): this is NodePath<t.Property>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Property>

isPure

  • isPure(opts?: undefined | object): boolean
  • Parameters

    • Optional opts: undefined | object

    Returns boolean

isPureish

  • isPureish(opts?: undefined | object): this is NodePath<t.Pureish>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Pureish>

isQualifiedTypeIdentifier

  • isQualifiedTypeIdentifier(opts?: undefined | object): this is NodePath<QualifiedTypeIdentifier>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<QualifiedTypeIdentifier>

isReferenced

  • isReferenced(opts?: undefined | object): boolean
  • Parameters

    • Optional opts: undefined | object

    Returns boolean

isReferencedIdentifier

  • isReferencedIdentifier(opts?: undefined | object): this is NodePath<Identifier | JSXIdentifier>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<Identifier | JSXIdentifier>

isReferencedMemberExpression

  • isReferencedMemberExpression(opts?: undefined | object): this is NodePath<MemberExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<MemberExpression>

isRegExpLiteral

  • isRegExpLiteral(opts?: undefined | object): this is NodePath<RegExpLiteral>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<RegExpLiteral>

isRegexLiteral

  • isRegexLiteral(opts?: undefined | object): this is NodePath<RegExpLiteral>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<RegExpLiteral>

isRestElement

  • isRestElement(opts?: undefined | object): this is NodePath<RestElement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<RestElement>

isRestProperty

  • isRestProperty(opts?: undefined | object): this is NodePath<t.RestProperty>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.RestProperty>

isReturnStatement

  • isReturnStatement(opts?: undefined | object): this is NodePath<ReturnStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ReturnStatement>

isScopable

  • isScopable(opts?: undefined | object): this is NodePath<t.Scopable>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Scopable>

isScope

  • isScope(opts?: undefined | object): this is NodePath<t.Scopable>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Scopable>

isSequenceExpression

  • isSequenceExpression(opts?: undefined | object): this is NodePath<SequenceExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<SequenceExpression>

isSpreadElement

  • isSpreadElement(opts?: undefined | object): this is NodePath<SpreadElement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<SpreadElement>

isSpreadProperty

  • isSpreadProperty(opts?: undefined | object): this is NodePath<t.SpreadProperty>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.SpreadProperty>

isStatement

  • isStatement(opts?: undefined | object): this is NodePath<t.Statement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Statement>

isStatementOrBlock

  • isStatementOrBlock(): boolean
  • Check whether or not the current key allows either a single statement or block statement so we can explode it if necessary.

    Returns boolean

isStatic

  • isStatic(): boolean
  • Returns boolean

isStringLiteral

  • isStringLiteral(opts?: undefined | object): this is NodePath<StringLiteral>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<StringLiteral>

isStringLiteralTypeAnnotation

  • isStringLiteralTypeAnnotation(opts?: undefined | object): this is NodePath<StringLiteralTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<StringLiteralTypeAnnotation>

isStringTypeAnnotation

  • isStringTypeAnnotation(opts?: undefined | object): this is NodePath<StringTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<StringTypeAnnotation>

isSuper

  • isSuper(opts?: undefined | object): this is NodePath<Super>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<Super>

isSwitchCase

  • isSwitchCase(opts?: undefined | object): this is NodePath<SwitchCase>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<SwitchCase>

isSwitchStatement

  • isSwitchStatement(opts?: undefined | object): this is NodePath<SwitchStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<SwitchStatement>

isTaggedTemplateExpression

  • isTaggedTemplateExpression(opts?: undefined | object): this is NodePath<TaggedTemplateExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<TaggedTemplateExpression>

isTemplateElement

  • isTemplateElement(opts?: undefined | object): this is NodePath<TemplateElement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<TemplateElement>

isTemplateLiteral

  • isTemplateLiteral(opts?: undefined | object): this is NodePath<TemplateLiteral>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<TemplateLiteral>

isTerminatorless

  • isTerminatorless(opts?: undefined | object): this is NodePath<t.Terminatorless>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.Terminatorless>

isThisExpression

  • isThisExpression(opts?: undefined | object): this is NodePath<ThisExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ThisExpression>

isThisTypeAnnotation

  • isThisTypeAnnotation(opts?: undefined | object): this is NodePath<ThisTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ThisTypeAnnotation>

isThrowStatement

  • isThrowStatement(opts?: undefined | object): this is NodePath<ThrowStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<ThrowStatement>

isTryStatement

  • isTryStatement(opts?: undefined | object): this is NodePath<TryStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<TryStatement>

isTupleTypeAnnotation

  • isTupleTypeAnnotation(opts?: undefined | object): this is NodePath<TupleTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<TupleTypeAnnotation>

isTypeAlias

  • isTypeAlias(opts?: undefined | object): this is NodePath<TypeAlias>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<TypeAlias>

isTypeAnnotation

  • isTypeAnnotation(opts?: undefined | object): this is NodePath<TypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<TypeAnnotation>

isTypeCastExpression

  • isTypeCastExpression(opts?: undefined | object): this is NodePath<TypeCastExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<TypeCastExpression>

isTypeParameterDeclaration

  • isTypeParameterDeclaration(opts?: undefined | object): this is NodePath<TypeParameterDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<TypeParameterDeclaration>

isTypeParameterInstantiation

  • isTypeParameterInstantiation(opts?: undefined | object): this is NodePath<TypeParameterInstantiation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<TypeParameterInstantiation>

isTypeofTypeAnnotation

  • isTypeofTypeAnnotation(opts?: undefined | object): this is NodePath<TypeofTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<TypeofTypeAnnotation>

isUnaryExpression

  • isUnaryExpression(opts?: undefined | object): this is NodePath<UnaryExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<UnaryExpression>

isUnaryLike

  • isUnaryLike(opts?: undefined | object): this is NodePath<t.UnaryLike>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.UnaryLike>

isUnionTypeAnnotation

  • isUnionTypeAnnotation(opts?: undefined | object): this is NodePath<UnionTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<UnionTypeAnnotation>

isUpdateExpression

  • isUpdateExpression(opts?: undefined | object): this is NodePath<UpdateExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<UpdateExpression>

isUser

  • isUser(opts?: undefined | object): boolean
  • Parameters

    • Optional opts: undefined | object

    Returns boolean

isUserWhitespacable

  • isUserWhitespacable(opts?: undefined | object): this is NodePath<t.UserWhitespacable>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.UserWhitespacable>

isVar

  • isVar(opts?: undefined | object): this is NodePath<VariableDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<VariableDeclaration>

isVariableDeclaration

  • isVariableDeclaration(opts?: undefined | object): this is NodePath<VariableDeclaration>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<VariableDeclaration>

isVariableDeclarator

  • isVariableDeclarator(opts?: undefined | object): this is NodePath<VariableDeclarator>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<VariableDeclarator>

isVoidTypeAnnotation

  • isVoidTypeAnnotation(opts?: undefined | object): this is NodePath<VoidTypeAnnotation>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<VoidTypeAnnotation>

isWhile

  • isWhile(opts?: undefined | object): this is NodePath<t.While>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<t.While>

isWhileStatement

  • isWhileStatement(opts?: undefined | object): this is NodePath<WhileStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<WhileStatement>

isWithStatement

  • isWithStatement(opts?: undefined | object): this is NodePath<WithStatement>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<WithStatement>

isYieldExpression

  • isYieldExpression(opts?: undefined | object): this is NodePath<YieldExpression>
  • Parameters

    • Optional opts: undefined | object

    Returns this is NodePath<YieldExpression>

isnt

  • isnt(key: string): boolean
  • Opposite of has.

    Parameters

    • key: string

    Returns boolean

matchesPattern

  • matchesPattern(pattern: string, allowPartial?: undefined | false | true): boolean
  • Match the current node if it matches the provided pattern.

    For example, given the match React.createClass it would match the parsed nodes of React.createClass and React["createClass"].

    Parameters

    • pattern: string
    • Optional allowPartial: undefined | false | true

    Returns boolean

popContext

  • popContext(): void
  • Returns void

pushContainer

  • pushContainer(listKey: string, nodes: Node | Node[]): void
  • Insert child nodes at the end of the current node.

    Parameters

    • listKey: string

      The key at which the child nodes are stored (usually body).

    • nodes: Node | Node[]

      the nodes to insert.

    Returns void

pushContext

  • Parameters

    Returns void

referencesImport

  • referencesImport(moduleSource: string, importName: string): boolean
  • Check if the currently assigned path references the importName of moduleSource.

    Parameters

    • moduleSource: string
    • importName: string

    Returns boolean

remove

  • remove(): void
  • Returns void

replaceExpressionWithStatements

  • replaceExpressionWithStatements(nodes: Node[]): Node
  • This method takes an array of statements nodes and then explodes it into expressions. This method retains completion records which is extremely important to retain original semantics.

    Parameters

    Returns Node

replaceInline

  • replaceInline(nodes: Node | Node[]): void
  • Parameters

    Returns void

replaceWith

  • Replace the current node with another.

    Parameters

    Returns void

replaceWithMultiple

  • replaceWithMultiple(nodes: Node[]): void
  • Replace a node with an array of multiple. This method performs the following steps:

    • Inherit the comments of first provided node with that of the current node.
    • Insert the provided nodes after the current node.
    • Remove the current node.

    Parameters

    Returns void

replaceWithSourceString

  • replaceWithSourceString(replacement: any): void
  • Parse a string as an expression and replace the current node with the result.

    NOTE: This is typically not a good idea to use. Building source strings when transforming ASTs is an antipattern and SHOULD NOT be encouraged. Even if it's easier to use, your transforms will be extremely brittle.

    Parameters

    • replacement: any

    Returns void

set

  • set(key: string, node: Node): void
  • Parameters

    • key: string
    • node: Node

    Returns void

setContext

  • Parameters

    Returns NodePath<T>

setData

  • setData(key: string, val: any): any
  • Parameters

    • key: string
    • val: any

    Returns any

setScope

  • setScope(): void
  • Returns void

shareCommentsWithSiblings

  • shareCommentsWithSiblings(): void
  • Share comments amongst siblings.

    Returns void

skip

  • skip(): void
  • Returns void

skipKey

  • skipKey(key: string): void
  • Parameters

    • key: string

    Returns void

stop

  • stop(): void
  • Returns void

traverse

  • traverse<T>(visitor: Visitor<T>, state: T): void
  • traverse(visitor: Visitor): void
  • Type parameters

    • T

    Parameters

    Returns void

  • Parameters

    Returns void

unshiftContainer

  • unshiftContainer(listKey: string, nodes: Node | Node[]): void
  • Insert child nodes at the start of the current node.

    Parameters

    • listKey: string

      The key at which the child nodes are stored (usually body).

    • nodes: Node | Node[]

      the nodes to insert.

    Returns void

updateSiblingKeys

  • updateSiblingKeys(fromIndex: number, incrementBy: number): void
  • Update all sibling node paths after fromIndex by incrementBy.

    Parameters

    • fromIndex: number
    • incrementBy: number

    Returns void

visit

  • visit(): boolean
  • Returns boolean

willIMaybeExecuteBefore

  • willIMaybeExecuteBefore(path: NodePath): boolean
  • Check if the current path will maybe execute before another path

    Parameters

    Returns boolean