Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NodePath<T>

Type parameters

  • T = Node

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 null | undefined ? undefined : T extends Node ? T["type"] : string | undefined

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(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertArrayExpression

  • assertArrayExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertArrayPattern

  • assertArrayPattern(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertArrayTypeAnnotation

  • assertArrayTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertArrowFunctionExpression

  • assertArrowFunctionExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertAssignmentExpression

  • assertAssignmentExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertAssignmentPattern

  • assertAssignmentPattern(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertAwaitExpression

  • assertAwaitExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBigIntLiteral

  • assertBigIntLiteral(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBinary

  • assertBinary(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBinaryExpression

  • assertBinaryExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBindExpression

  • assertBindExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBindingIdentifier

  • assertBindingIdentifier(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBlock

  • assertBlock(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBlockParent

  • assertBlockParent(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBlockScoped

  • assertBlockScoped(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBlockStatement

  • assertBlockStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBooleanLiteral

  • assertBooleanLiteral(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBooleanLiteralTypeAnnotation

  • assertBooleanLiteralTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBooleanTypeAnnotation

  • assertBooleanTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertBreakStatement

  • assertBreakStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertCallExpression

  • assertCallExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertCatchClause

  • assertCatchClause(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertClass

  • assertClass(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertClassBody

  • assertClassBody(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertClassDeclaration

  • assertClassDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertClassExpression

  • assertClassExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertClassImplements

  • assertClassImplements(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertClassMethod

  • assertClassMethod(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertClassPrivateMethod

  • assertClassPrivateMethod(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertClassPrivateProperty

  • assertClassPrivateProperty(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertClassProperty

  • assertClassProperty(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertCompletionStatement

  • assertCompletionStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertConditional

  • assertConditional(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertConditionalExpression

  • assertConditionalExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertContinueStatement

  • assertContinueStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDebuggerStatement

  • assertDebuggerStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDeclaration

  • assertDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDeclareClass

  • assertDeclareClass(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDeclareExportAllDeclaration

  • assertDeclareExportAllDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDeclareExportDeclaration

  • assertDeclareExportDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDeclareFunction

  • assertDeclareFunction(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDeclareInterface

  • assertDeclareInterface(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDeclareModule

  • assertDeclareModule(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDeclareModuleExports

  • assertDeclareModuleExports(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDeclareOpaqueType

  • assertDeclareOpaqueType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDeclareTypeAlias

  • assertDeclareTypeAlias(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDeclareVariable

  • assertDeclareVariable(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDeclaredPredicate

  • assertDeclaredPredicate(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDecorator

  • assertDecorator(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDirective

  • assertDirective(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDirectiveLiteral

  • assertDirectiveLiteral(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDoExpression

  • assertDoExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertDoWhileStatement

  • assertDoWhileStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertEmptyStatement

  • assertEmptyStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertEmptyTypeAnnotation

  • assertEmptyTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertExistsTypeAnnotation

  • assertExistsTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertExportAllDeclaration

  • assertExportAllDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertExportDeclaration

  • assertExportDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertExportDefaultDeclaration

  • assertExportDefaultDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertExportDefaultSpecifier

  • assertExportDefaultSpecifier(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertExportNamedDeclaration

  • assertExportNamedDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertExportNamespaceSpecifier

  • assertExportNamespaceSpecifier(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertExportSpecifier

  • assertExportSpecifier(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertExpression

  • assertExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertExpressionStatement

  • assertExpressionStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertExpressionWrapper

  • assertExpressionWrapper(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFile

  • assertFile(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFlow

  • assertFlow(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFlowBaseAnnotation

  • assertFlowBaseAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFlowDeclaration

  • assertFlowDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFlowPredicate

  • assertFlowPredicate(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFlowType

  • assertFlowType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFor

  • assertFor(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertForInStatement

  • assertForInStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertForOfStatement

  • assertForOfStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertForStatement

  • assertForStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertForXStatement

  • assertForXStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFunction

  • assertFunction(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFunctionDeclaration

  • assertFunctionDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFunctionExpression

  • assertFunctionExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFunctionParent

  • assertFunctionParent(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFunctionTypeAnnotation

  • assertFunctionTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertFunctionTypeParam

  • assertFunctionTypeParam(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertGenerated

  • assertGenerated(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertGenericTypeAnnotation

  • assertGenericTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertIdentifier

  • assertIdentifier(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertIfStatement

  • assertIfStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertImmutable

  • assertImmutable(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertImport

  • assertImport(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertImportDeclaration

  • assertImportDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertImportDefaultSpecifier

  • assertImportDefaultSpecifier(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertImportNamespaceSpecifier

  • assertImportNamespaceSpecifier(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertImportSpecifier

  • assertImportSpecifier(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertInferredPredicate

  • assertInferredPredicate(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertInterfaceDeclaration

  • assertInterfaceDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertInterfaceExtends

  • assertInterfaceExtends(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertInterfaceTypeAnnotation

  • assertInterfaceTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertInterpreterDirective

  • assertInterpreterDirective(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertIntersectionTypeAnnotation

  • assertIntersectionTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSX

  • assertJSX(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXAttribute

  • assertJSXAttribute(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXClosingElement

  • assertJSXClosingElement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXClosingFragment

  • assertJSXClosingFragment(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXElement

  • assertJSXElement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXEmptyExpression

  • assertJSXEmptyExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXExpressionContainer

  • assertJSXExpressionContainer(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXFragment

  • assertJSXFragment(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXIdentifier

  • assertJSXIdentifier(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXMemberExpression

  • assertJSXMemberExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXNamespacedName

  • assertJSXNamespacedName(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXOpeningElement

  • assertJSXOpeningElement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXOpeningFragment

  • assertJSXOpeningFragment(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXSpreadAttribute

  • assertJSXSpreadAttribute(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXSpreadChild

  • assertJSXSpreadChild(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertJSXText

  • assertJSXText(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertLVal

  • assertLVal(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertLabeledStatement

  • assertLabeledStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertLiteral

  • assertLiteral(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertLogicalExpression

  • assertLogicalExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertLoop

  • assertLoop(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertMemberExpression

  • assertMemberExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertMetaProperty

  • assertMetaProperty(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertMethod

  • assertMethod(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertMixedTypeAnnotation

  • assertMixedTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertModuleDeclaration

  • assertModuleDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertModuleSpecifier

  • assertModuleSpecifier(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertNewExpression

  • assertNewExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertNoop

  • assertNoop(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertNullLiteral

  • assertNullLiteral(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertNullLiteralTypeAnnotation

  • assertNullLiteralTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertNullableTypeAnnotation

  • assertNullableTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertNumberLiteral

  • assertNumberLiteral(props?: object | null): void
  • deprecated

    Use assertNumericLiteral

    Parameters

    • Optional props: object | null

    Returns void

assertNumberLiteralTypeAnnotation

  • assertNumberLiteralTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertNumberTypeAnnotation

  • assertNumberTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertNumericLiteral

  • assertNumericLiteral(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertObjectExpression

  • assertObjectExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertObjectMember

  • assertObjectMember(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertObjectMethod

  • assertObjectMethod(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertObjectPattern

  • assertObjectPattern(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertObjectProperty

  • assertObjectProperty(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertObjectTypeAnnotation

  • assertObjectTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertObjectTypeCallProperty

  • assertObjectTypeCallProperty(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertObjectTypeIndexer

  • assertObjectTypeIndexer(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertObjectTypeInternalSlot

  • assertObjectTypeInternalSlot(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertObjectTypeProperty

  • assertObjectTypeProperty(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertObjectTypeSpreadProperty

  • assertObjectTypeSpreadProperty(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertOpaqueType

  • assertOpaqueType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertOptionalCallExpression

  • assertOptionalCallExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertOptionalMemberExpression

  • assertOptionalMemberExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertParenthesizedExpression

  • assertParenthesizedExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertPattern

  • assertPattern(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertPatternLike

  • assertPatternLike(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertPipelineBareFunction

  • assertPipelineBareFunction(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertPipelinePrimaryTopicReference

  • assertPipelinePrimaryTopicReference(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertPipelineTopicExpression

  • assertPipelineTopicExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertPrivate

  • assertPrivate(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertPrivateName

  • assertPrivateName(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertProgram

  • assertProgram(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertProperty

  • assertProperty(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertPure

  • assertPure(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertPureish

  • assertPureish(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertQualifiedTypeIdentifier

  • assertQualifiedTypeIdentifier(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertReferenced

  • assertReferenced(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertReferencedIdentifier

  • assertReferencedIdentifier(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertReferencedMemberExpression

  • assertReferencedMemberExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertRegExpLiteral

  • assertRegExpLiteral(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertRegexLiteral

  • assertRegexLiteral(props?: object | null): void
  • deprecated

    Use assertRegExpLiteral

    Parameters

    • Optional props: object | null

    Returns void

assertRestElement

  • assertRestElement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertRestProperty

  • assertRestProperty(props?: object | null): void
  • deprecated

    Use assertRestElement

    Parameters

    • Optional props: object | null

    Returns void

assertReturnStatement

  • assertReturnStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertScopable

  • assertScopable(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertScope

  • assertScope(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertSequenceExpression

  • assertSequenceExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertSpreadElement

  • assertSpreadElement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertSpreadProperty

  • assertSpreadProperty(props?: object | null): void
  • deprecated

    Use assertSpreadElement

    Parameters

    • Optional props: object | null

    Returns void

assertStatement

  • assertStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertStringLiteral

  • assertStringLiteral(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertStringLiteralTypeAnnotation

  • assertStringLiteralTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertStringTypeAnnotation

  • assertStringTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertSuper

  • assertSuper(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertSwitchCase

  • assertSwitchCase(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertSwitchStatement

  • assertSwitchStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSAnyKeyword

  • assertTSAnyKeyword(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSArrayType

  • assertTSArrayType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSAsExpression

  • assertTSAsExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSBooleanKeyword

  • assertTSBooleanKeyword(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSCallSignatureDeclaration

  • assertTSCallSignatureDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSConditionalType

  • assertTSConditionalType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSConstructSignatureDeclaration

  • assertTSConstructSignatureDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSConstructorType

  • assertTSConstructorType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSDeclareFunction

  • assertTSDeclareFunction(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSDeclareMethod

  • assertTSDeclareMethod(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSEntityName

  • assertTSEntityName(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSEnumDeclaration

  • assertTSEnumDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSEnumMember

  • assertTSEnumMember(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSExportAssignment

  • assertTSExportAssignment(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSExpressionWithTypeArguments

  • assertTSExpressionWithTypeArguments(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSExternalModuleReference

  • assertTSExternalModuleReference(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSFunctionType

  • assertTSFunctionType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSImportEqualsDeclaration

  • assertTSImportEqualsDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSImportType

  • assertTSImportType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSIndexSignature

  • assertTSIndexSignature(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSIndexedAccessType

  • assertTSIndexedAccessType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSInferType

  • assertTSInferType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSInterfaceBody

  • assertTSInterfaceBody(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSInterfaceDeclaration

  • assertTSInterfaceDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSIntersectionType

  • assertTSIntersectionType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSLiteralType

  • assertTSLiteralType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSMappedType

  • assertTSMappedType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSMethodSignature

  • assertTSMethodSignature(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSModuleBlock

  • assertTSModuleBlock(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSModuleDeclaration

  • assertTSModuleDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSNamespaceExportDeclaration

  • assertTSNamespaceExportDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSNeverKeyword

  • assertTSNeverKeyword(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSNonNullExpression

  • assertTSNonNullExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSNullKeyword

  • assertTSNullKeyword(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSNumberKeyword

  • assertTSNumberKeyword(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSObjectKeyword

  • assertTSObjectKeyword(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSOptionalType

  • assertTSOptionalType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSParameterProperty

  • assertTSParameterProperty(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSParenthesizedType

  • assertTSParenthesizedType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSPropertySignature

  • assertTSPropertySignature(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSQualifiedName

  • assertTSQualifiedName(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSRestType

  • assertTSRestType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSStringKeyword

  • assertTSStringKeyword(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSSymbolKeyword

  • assertTSSymbolKeyword(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSThisType

  • assertTSThisType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTupleType

  • assertTSTupleType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSType

  • assertTSType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTypeAliasDeclaration

  • assertTSTypeAliasDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTypeAnnotation

  • assertTSTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTypeAssertion

  • assertTSTypeAssertion(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTypeElement

  • assertTSTypeElement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTypeLiteral

  • assertTSTypeLiteral(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTypeOperator

  • assertTSTypeOperator(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTypeParameter

  • assertTSTypeParameter(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTypeParameterDeclaration

  • assertTSTypeParameterDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTypeParameterInstantiation

  • assertTSTypeParameterInstantiation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTypePredicate

  • assertTSTypePredicate(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTypeQuery

  • assertTSTypeQuery(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSTypeReference

  • assertTSTypeReference(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSUndefinedKeyword

  • assertTSUndefinedKeyword(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSUnionType

  • assertTSUnionType(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSUnknownKeyword

  • assertTSUnknownKeyword(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTSVoidKeyword

  • assertTSVoidKeyword(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTaggedTemplateExpression

  • assertTaggedTemplateExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTemplateElement

  • assertTemplateElement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTemplateLiteral

  • assertTemplateLiteral(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTerminatorless

  • assertTerminatorless(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertThisExpression

  • assertThisExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertThisTypeAnnotation

  • assertThisTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertThrowStatement

  • assertThrowStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTryStatement

  • assertTryStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTupleTypeAnnotation

  • assertTupleTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTypeAlias

  • assertTypeAlias(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTypeAnnotation

  • assertTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTypeCastExpression

  • assertTypeCastExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTypeParameter

  • assertTypeParameter(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTypeParameterDeclaration

  • assertTypeParameterDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTypeParameterInstantiation

  • assertTypeParameterInstantiation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertTypeofTypeAnnotation

  • assertTypeofTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertUnaryExpression

  • assertUnaryExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertUnaryLike

  • assertUnaryLike(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertUnionTypeAnnotation

  • assertUnionTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertUpdateExpression

  • assertUpdateExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertUser

  • assertUser(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertUserWhitespacable

  • assertUserWhitespacable(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertVar

  • assertVar(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertVariableDeclaration

  • assertVariableDeclaration(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertVariableDeclarator

  • assertVariableDeclarator(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertVariance

  • assertVariance(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertVoidTypeAnnotation

  • assertVoidTypeAnnotation(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertWhile

  • assertWhile(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertWhileStatement

  • assertWhileStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertWithStatement

  • assertWithStatement(props?: object | null): void
  • Parameters

    • Optional props: object | null

    Returns void

assertYieldExpression

  • assertYieldExpression(props?: object | null): void
  • Parameters

    • Optional props: object | null

    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

  • Starting at current NodePath and going up the tree, return the first NodePath that causes the provided callback to return a truthy value, or null if the callback never returns a truthy value.

    Parameters

    Returns NodePath | null

findParent

  • Starting at the parent path of the current NodePath and going up the tree, return the first NodePath that causes the provided callback to return a truthy value, or null if the callback never returns a truthy value.

    Parameters

    Returns NodePath | null

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 [this, 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> | null
  • Get the parent function of the current path.

    Returns NodePath<t.Function> | null

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> | null
  • Walk up the tree until we hit a parent node path in a list.

    Returns NodePath<t.Statement> | null

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>(nodes: Nodes): NodePaths<Nodes>
  • 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.

    Type parameters

    Parameters

    • nodes: Nodes

    Returns NodePaths<Nodes>

insertBefore

  • insertBefore<Nodes>(nodes: Nodes): NodePaths<Nodes>
  • Insert the provided nodes before the current one.

    Type parameters

    Parameters

    • nodes: Nodes

    Returns NodePaths<Nodes>

is

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

    Parameters

    • key: string

    Returns boolean

isAncestor

  • isAncestor(maybeDescendant: NodePath): boolean
  • A helper to find if this path is an ancestor of maybeDescendant

    Parameters

    Returns boolean

isAnyTypeAnnotation

  • isAnyTypeAnnotation(props?: object | null): this is NodePath<AnyTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<AnyTypeAnnotation>

isArrayExpression

  • isArrayExpression(props?: object | null): this is NodePath<ArrayExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ArrayExpression>

isArrayPattern

  • isArrayPattern(props?: object | null): this is NodePath<ArrayPattern>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ArrayPattern>

isArrayTypeAnnotation

  • isArrayTypeAnnotation(props?: object | null): this is NodePath<ArrayTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ArrayTypeAnnotation>

isArrowFunctionExpression

  • isArrowFunctionExpression(props?: object | null): this is NodePath<ArrowFunctionExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ArrowFunctionExpression>

isAssignmentExpression

  • isAssignmentExpression(props?: object | null): this is NodePath<AssignmentExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<AssignmentExpression>

isAssignmentPattern

  • isAssignmentPattern(props?: object | null): this is NodePath<AssignmentPattern>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<AssignmentPattern>

isAwaitExpression

  • isAwaitExpression(props?: object | null): this is NodePath<AwaitExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<AwaitExpression>

isBaseType

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

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

    Returns boolean

isBigIntLiteral

  • isBigIntLiteral(props?: object | null): this is NodePath<BigIntLiteral>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<BigIntLiteral>

isBinary

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

    • Optional props: object | null

    Returns this is NodePath<t.Binary>

isBinaryExpression

  • isBinaryExpression(props?: object | null): this is NodePath<BinaryExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<BinaryExpression>

isBindExpression

  • isBindExpression(props?: object | null): this is NodePath<BindExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<BindExpression>

isBindingIdentifier

  • isBindingIdentifier(props?: object | null): this is NodePath<Identifier>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<Identifier>

isBlacklisted

  • isBlacklisted(): boolean
  • Returns boolean

isBlock

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

    • Optional props: object | null

    Returns this is NodePath<t.Block>

isBlockParent

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

    • Optional props: object | null

    Returns this is NodePath<t.BlockParent>

isBlockScoped

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

    • Optional props: object | null

    Returns this is NodePath<FunctionDeclaration | ClassDeclaration | VariableDeclaration>

isBlockStatement

  • isBlockStatement(props?: object | null): this is NodePath<BlockStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<BlockStatement>

isBooleanLiteral

  • isBooleanLiteral(props?: object | null): this is NodePath<BooleanLiteral>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<BooleanLiteral>

isBooleanLiteralTypeAnnotation

  • isBooleanLiteralTypeAnnotation(props?: object | null): this is NodePath<BooleanLiteralTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<BooleanLiteralTypeAnnotation>

isBooleanTypeAnnotation

  • isBooleanTypeAnnotation(props?: object | null): this is NodePath<BooleanTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<BooleanTypeAnnotation>

isBreakStatement

  • isBreakStatement(props?: object | null): this is NodePath<BreakStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<BreakStatement>

isCallExpression

  • isCallExpression(props?: object | null): this is NodePath<CallExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<CallExpression>

isCatchClause

  • isCatchClause(props?: object | null): this is NodePath<CatchClause>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<CatchClause>

isClass

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

    • Optional props: object | null

    Returns this is NodePath<t.Class>

isClassBody

  • isClassBody(props?: object | null): this is NodePath<ClassBody>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ClassBody>

isClassDeclaration

  • isClassDeclaration(props?: object | null): this is NodePath<ClassDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ClassDeclaration>

isClassExpression

  • isClassExpression(props?: object | null): this is NodePath<ClassExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ClassExpression>

isClassImplements

  • isClassImplements(props?: object | null): this is NodePath<ClassImplements>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ClassImplements>

isClassMethod

  • isClassMethod(props?: object | null): this is NodePath<ClassMethod>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ClassMethod>

isClassPrivateMethod

  • isClassPrivateMethod(props?: object | null): this is NodePath<ClassPrivateMethod>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ClassPrivateMethod>

isClassPrivateProperty

  • isClassPrivateProperty(props?: object | null): this is NodePath<ClassPrivateProperty>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ClassPrivateProperty>

isClassProperty

  • isClassProperty(props?: object | null): this is NodePath<ClassProperty>
  • Parameters

    • Optional props: object | null

    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(props?: object | null): this is NodePath<t.CompletionStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<t.CompletionStatement>

isConditional

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

    • Optional props: object | null

    Returns this is NodePath<t.Conditional>

isConditionalExpression

  • isConditionalExpression(props?: object | null): this is NodePath<ConditionalExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ConditionalExpression>

isContinueStatement

  • isContinueStatement(props?: object | null): this is NodePath<ContinueStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ContinueStatement>

isDebuggerStatement

  • isDebuggerStatement(props?: object | null): this is NodePath<DebuggerStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DebuggerStatement>

isDeclaration

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

    • Optional props: object | null

    Returns this is NodePath<t.Declaration>

isDeclareClass

  • isDeclareClass(props?: object | null): this is NodePath<DeclareClass>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DeclareClass>

isDeclareExportAllDeclaration

  • isDeclareExportAllDeclaration(props?: object | null): this is NodePath<DeclareExportAllDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DeclareExportAllDeclaration>

isDeclareExportDeclaration

  • isDeclareExportDeclaration(props?: object | null): this is NodePath<DeclareExportDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DeclareExportDeclaration>

isDeclareFunction

  • isDeclareFunction(props?: object | null): this is NodePath<DeclareFunction>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DeclareFunction>

isDeclareInterface

  • isDeclareInterface(props?: object | null): this is NodePath<DeclareInterface>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DeclareInterface>

isDeclareModule

  • isDeclareModule(props?: object | null): this is NodePath<DeclareModule>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DeclareModule>

isDeclareModuleExports

  • isDeclareModuleExports(props?: object | null): this is NodePath<DeclareModuleExports>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DeclareModuleExports>

isDeclareOpaqueType

  • isDeclareOpaqueType(props?: object | null): this is NodePath<DeclareOpaqueType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DeclareOpaqueType>

isDeclareTypeAlias

  • isDeclareTypeAlias(props?: object | null): this is NodePath<DeclareTypeAlias>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DeclareTypeAlias>

isDeclareVariable

  • isDeclareVariable(props?: object | null): this is NodePath<DeclareVariable>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DeclareVariable>

isDeclaredPredicate

  • isDeclaredPredicate(props?: object | null): this is NodePath<DeclaredPredicate>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DeclaredPredicate>

isDecorator

  • isDecorator(props?: object | null): this is NodePath<Decorator>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<Decorator>

isDescendant

  • isDescendant(maybeAncestor: NodePath): boolean
  • A helper to find if this path is a descendant of maybeAncestor

    Parameters

    Returns boolean

isDirective

  • isDirective(props?: object | null): this is NodePath<Directive>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<Directive>

isDirectiveLiteral

  • isDirectiveLiteral(props?: object | null): this is NodePath<DirectiveLiteral>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DirectiveLiteral>

isDoExpression

  • isDoExpression(props?: object | null): this is NodePath<DoExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DoExpression>

isDoWhileStatement

  • isDoWhileStatement(props?: object | null): this is NodePath<DoWhileStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<DoWhileStatement>

isEmptyStatement

  • isEmptyStatement(props?: object | null): this is NodePath<EmptyStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<EmptyStatement>

isEmptyTypeAnnotation

  • isEmptyTypeAnnotation(props?: object | null): this is NodePath<EmptyTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<EmptyTypeAnnotation>

isExistsTypeAnnotation

  • isExistsTypeAnnotation(props?: object | null): this is NodePath<ExistsTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ExistsTypeAnnotation>

isExportAllDeclaration

  • isExportAllDeclaration(props?: object | null): this is NodePath<ExportAllDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ExportAllDeclaration>

isExportDeclaration

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

    • Optional props: object | null

    Returns this is NodePath<t.ExportDeclaration>

isExportDefaultDeclaration

  • isExportDefaultDeclaration(props?: object | null): this is NodePath<ExportDefaultDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ExportDefaultDeclaration>

isExportDefaultSpecifier

  • isExportDefaultSpecifier(props?: object | null): this is NodePath<ExportDefaultSpecifier>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ExportDefaultSpecifier>

isExportNamedDeclaration

  • isExportNamedDeclaration(props?: object | null): this is NodePath<ExportNamedDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ExportNamedDeclaration>

isExportNamespaceSpecifier

  • isExportNamespaceSpecifier(props?: object | null): this is NodePath<ExportNamespaceSpecifier>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ExportNamespaceSpecifier>

isExportSpecifier

  • isExportSpecifier(props?: object | null): this is NodePath<ExportSpecifier>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ExportSpecifier>

isExpression

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

    • Optional props: object | null

    Returns this is NodePath<t.Expression>

isExpressionStatement

  • isExpressionStatement(props?: object | null): this is NodePath<ExpressionStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ExpressionStatement>

isExpressionWrapper

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

    • Optional props: object | null

    Returns this is NodePath<t.ExpressionWrapper>

isFile

  • isFile(props?: object | null): this is NodePath<File>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<File>

isFlow

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

    • Optional props: object | null

    Returns this is NodePath<t.Flow>

isFlowBaseAnnotation

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

    • Optional props: object | null

    Returns this is NodePath<t.FlowBaseAnnotation>

isFlowDeclaration

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

    • Optional props: object | null

    Returns this is NodePath<t.FlowDeclaration>

isFlowPredicate

  • isFlowPredicate(props?: object | null): this is NodePath<t.FlowPredicate>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<t.FlowPredicate>

isFlowType

  • isFlowType(props?: object | null): this is NodePath<t.FlowType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<t.FlowType>

isFor

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

    • Optional props: object | null

    Returns this is NodePath<t.For>

isForInStatement

  • isForInStatement(props?: object | null): this is NodePath<ForInStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ForInStatement>

isForOfStatement

  • isForOfStatement(props?: object | null): this is NodePath<ForOfStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ForOfStatement>

isForStatement

  • isForStatement(props?: object | null): this is NodePath<ForStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ForStatement>

isForXStatement

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

    • Optional props: object | null

    Returns this is NodePath<t.ForXStatement>

isFunction

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

    • Optional props: object | null

    Returns this is NodePath<t.Function>

isFunctionDeclaration

  • isFunctionDeclaration(props?: object | null): this is NodePath<FunctionDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<FunctionDeclaration>

isFunctionExpression

  • isFunctionExpression(props?: object | null): this is NodePath<FunctionExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<FunctionExpression>

isFunctionParent

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

    • Optional props: object | null

    Returns this is NodePath<t.FunctionParent>

isFunctionTypeAnnotation

  • isFunctionTypeAnnotation(props?: object | null): this is NodePath<FunctionTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<FunctionTypeAnnotation>

isFunctionTypeParam

  • isFunctionTypeParam(props?: object | null): this is NodePath<FunctionTypeParam>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<FunctionTypeParam>

isGenerated

  • isGenerated(props?: object | null): boolean
  • Parameters

    • Optional props: object | null

    Returns boolean

isGenericType

  • isGenericType(genericName: string): boolean
  • Parameters

    • genericName: string

    Returns boolean

isGenericTypeAnnotation

  • isGenericTypeAnnotation(props?: object | null): this is NodePath<GenericTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<GenericTypeAnnotation>

isIdentifier

  • isIdentifier(props?: object | null): this is NodePath<Identifier>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<Identifier>

isIfStatement

  • isIfStatement(props?: object | null): this is NodePath<IfStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<IfStatement>

isImmutable

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

    • Optional props: object | null

    Returns this is NodePath<t.Immutable>

isImport

  • isImport(props?: object | null): this is NodePath<Import>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<Import>

isImportDeclaration

  • isImportDeclaration(props?: object | null): this is NodePath<ImportDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ImportDeclaration>

isImportDefaultSpecifier

  • isImportDefaultSpecifier(props?: object | null): this is NodePath<ImportDefaultSpecifier>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ImportDefaultSpecifier>

isImportNamespaceSpecifier

  • isImportNamespaceSpecifier(props?: object | null): this is NodePath<ImportNamespaceSpecifier>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ImportNamespaceSpecifier>

isImportSpecifier

  • isImportSpecifier(props?: object | null): this is NodePath<ImportSpecifier>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ImportSpecifier>

isInferredPredicate

  • isInferredPredicate(props?: object | null): this is NodePath<InferredPredicate>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<InferredPredicate>

isInterfaceDeclaration

  • isInterfaceDeclaration(props?: object | null): this is NodePath<InterfaceDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<InterfaceDeclaration>

isInterfaceExtends

  • isInterfaceExtends(props?: object | null): this is NodePath<InterfaceExtends>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<InterfaceExtends>

isInterfaceTypeAnnotation

  • isInterfaceTypeAnnotation(props?: object | null): this is NodePath<InterfaceTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<InterfaceTypeAnnotation>

isInterpreterDirective

  • isInterpreterDirective(props?: object | null): this is NodePath<InterpreterDirective>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<InterpreterDirective>

isIntersectionTypeAnnotation

  • isIntersectionTypeAnnotation(props?: object | null): this is NodePath<IntersectionTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<IntersectionTypeAnnotation>

isJSX

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

    • Optional props: object | null

    Returns this is NodePath<t.JSX>

isJSXAttribute

  • isJSXAttribute(props?: object | null): this is NodePath<JSXAttribute>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXAttribute>

isJSXClosingElement

  • isJSXClosingElement(props?: object | null): this is NodePath<JSXClosingElement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXClosingElement>

isJSXClosingFragment

  • isJSXClosingFragment(props?: object | null): this is NodePath<JSXClosingFragment>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXClosingFragment>

isJSXElement

  • isJSXElement(props?: object | null): this is NodePath<JSXElement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXElement>

isJSXEmptyExpression

  • isJSXEmptyExpression(props?: object | null): this is NodePath<JSXEmptyExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXEmptyExpression>

isJSXExpressionContainer

  • isJSXExpressionContainer(props?: object | null): this is NodePath<JSXExpressionContainer>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXExpressionContainer>

isJSXFragment

  • isJSXFragment(props?: object | null): this is NodePath<JSXFragment>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXFragment>

isJSXIdentifier

  • isJSXIdentifier(props?: object | null): this is NodePath<JSXIdentifier>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXIdentifier>

isJSXMemberExpression

  • isJSXMemberExpression(props?: object | null): this is NodePath<JSXMemberExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXMemberExpression>

isJSXNamespacedName

  • isJSXNamespacedName(props?: object | null): this is NodePath<JSXNamespacedName>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXNamespacedName>

isJSXOpeningElement

  • isJSXOpeningElement(props?: object | null): this is NodePath<JSXOpeningElement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXOpeningElement>

isJSXOpeningFragment

  • isJSXOpeningFragment(props?: object | null): this is NodePath<JSXOpeningFragment>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXOpeningFragment>

isJSXSpreadAttribute

  • isJSXSpreadAttribute(props?: object | null): this is NodePath<JSXSpreadAttribute>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXSpreadAttribute>

isJSXSpreadChild

  • isJSXSpreadChild(props?: object | null): this is NodePath<JSXSpreadChild>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXSpreadChild>

isJSXText

  • isJSXText(props?: object | null): this is NodePath<JSXText>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<JSXText>

isLVal

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

    • Optional props: object | null

    Returns this is NodePath<t.LVal>

isLabeledStatement

  • isLabeledStatement(props?: object | null): this is NodePath<LabeledStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<LabeledStatement>

isLiteral

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

    • Optional props: object | null

    Returns this is NodePath<t.Literal>

isLogicalExpression

  • isLogicalExpression(props?: object | null): this is NodePath<LogicalExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<LogicalExpression>

isLoop

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

    • Optional props: object | null

    Returns this is NodePath<t.Loop>

isMemberExpression

  • isMemberExpression(props?: object | null): this is NodePath<MemberExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<MemberExpression>

isMetaProperty

  • isMetaProperty(props?: object | null): this is NodePath<MetaProperty>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<MetaProperty>

isMethod

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

    • Optional props: object | null

    Returns this is NodePath<t.Method>

isMixedTypeAnnotation

  • isMixedTypeAnnotation(props?: object | null): this is NodePath<MixedTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<MixedTypeAnnotation>

isModuleDeclaration

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

    • Optional props: object | null

    Returns this is NodePath<t.ModuleDeclaration>

isModuleSpecifier

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

    • Optional props: object | null

    Returns this is NodePath<t.ModuleSpecifier>

isNewExpression

  • isNewExpression(props?: object | null): this is NodePath<NewExpression>
  • Parameters

    • Optional props: object | null

    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(props?: object | null): this is NodePath<Noop>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<Noop>

isNullLiteral

  • isNullLiteral(props?: object | null): this is NodePath<NullLiteral>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<NullLiteral>

isNullLiteralTypeAnnotation

  • isNullLiteralTypeAnnotation(props?: object | null): this is NodePath<NullLiteralTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<NullLiteralTypeAnnotation>

isNullableTypeAnnotation

  • isNullableTypeAnnotation(props?: object | null): this is NodePath<NullableTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<NullableTypeAnnotation>

isNumberLiteral

  • isNumberLiteral(props?: object | null): this is NodePath<NumericLiteral>
  • deprecated

    Use isNumericLiteral

    Parameters

    • Optional props: object | null

    Returns this is NodePath<NumericLiteral>

isNumberLiteralTypeAnnotation

  • isNumberLiteralTypeAnnotation(props?: object | null): this is NodePath<NumberLiteralTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<NumberLiteralTypeAnnotation>

isNumberTypeAnnotation

  • isNumberTypeAnnotation(props?: object | null): this is NodePath<NumberTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<NumberTypeAnnotation>

isNumericLiteral

  • isNumericLiteral(props?: object | null): this is NodePath<NumericLiteral>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<NumericLiteral>

isObjectExpression

  • isObjectExpression(props?: object | null): this is NodePath<ObjectExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ObjectExpression>

isObjectMember

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

    • Optional props: object | null

    Returns this is NodePath<t.ObjectMember>

isObjectMethod

  • isObjectMethod(props?: object | null): this is NodePath<ObjectMethod>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ObjectMethod>

isObjectPattern

  • isObjectPattern(props?: object | null): this is NodePath<ObjectPattern>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ObjectPattern>

isObjectProperty

  • isObjectProperty(props?: object | null): this is NodePath<ObjectProperty>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ObjectProperty>

isObjectTypeAnnotation

  • isObjectTypeAnnotation(props?: object | null): this is NodePath<ObjectTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ObjectTypeAnnotation>

isObjectTypeCallProperty

  • isObjectTypeCallProperty(props?: object | null): this is NodePath<ObjectTypeCallProperty>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ObjectTypeCallProperty>

isObjectTypeIndexer

  • isObjectTypeIndexer(props?: object | null): this is NodePath<ObjectTypeIndexer>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ObjectTypeIndexer>

isObjectTypeInternalSlot

  • isObjectTypeInternalSlot(props?: object | null): this is NodePath<ObjectTypeInternalSlot>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ObjectTypeInternalSlot>

isObjectTypeProperty

  • isObjectTypeProperty(props?: object | null): this is NodePath<ObjectTypeProperty>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ObjectTypeProperty>

isObjectTypeSpreadProperty

  • isObjectTypeSpreadProperty(props?: object | null): this is NodePath<ObjectTypeSpreadProperty>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ObjectTypeSpreadProperty>

isOpaqueType

  • isOpaqueType(props?: object | null): this is NodePath<OpaqueType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<OpaqueType>

isOptionalCallExpression

  • isOptionalCallExpression(props?: object | null): this is NodePath<OptionalCallExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<OptionalCallExpression>

isOptionalMemberExpression

  • isOptionalMemberExpression(props?: object | null): this is NodePath<OptionalMemberExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<OptionalMemberExpression>

isParenthesizedExpression

  • isParenthesizedExpression(props?: object | null): this is NodePath<ParenthesizedExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ParenthesizedExpression>

isPattern

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

    • Optional props: object | null

    Returns this is NodePath<t.Pattern>

isPatternLike

  • isPatternLike(props?: object | null): this is NodePath<t.PatternLike>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<t.PatternLike>

isPipelineBareFunction

  • isPipelineBareFunction(props?: object | null): this is NodePath<PipelineBareFunction>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<PipelineBareFunction>

isPipelinePrimaryTopicReference

  • isPipelinePrimaryTopicReference(props?: object | null): this is NodePath<PipelinePrimaryTopicReference>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<PipelinePrimaryTopicReference>

isPipelineTopicExpression

  • isPipelineTopicExpression(props?: object | null): this is NodePath<PipelineTopicExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<PipelineTopicExpression>

isPrivate

  • isPrivate(props?: object | null): this is NodePath<t.Private>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<t.Private>

isPrivateName

  • isPrivateName(props?: object | null): this is NodePath<PrivateName>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<PrivateName>

isProgram

  • isProgram(props?: object | null): this is NodePath<Program>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<Program>

isProperty

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

    • Optional props: object | null

    Returns this is NodePath<t.Property>

isPure

  • isPure(props?: object | null): boolean
  • Parameters

    • Optional props: object | null

    Returns boolean

isPureish

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

    • Optional props: object | null

    Returns this is NodePath<t.Pureish>

isQualifiedTypeIdentifier

  • isQualifiedTypeIdentifier(props?: object | null): this is NodePath<QualifiedTypeIdentifier>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<QualifiedTypeIdentifier>

isReferenced

  • isReferenced(props?: object | null): boolean
  • Parameters

    • Optional props: object | null

    Returns boolean

isReferencedIdentifier

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

    • Optional props: object | null

    Returns this is NodePath<Identifier | JSXIdentifier>

isReferencedMemberExpression

  • isReferencedMemberExpression(props?: object | null): this is NodePath<MemberExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<MemberExpression>

isRegExpLiteral

  • isRegExpLiteral(props?: object | null): this is NodePath<RegExpLiteral>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<RegExpLiteral>

isRegexLiteral

  • isRegexLiteral(props?: object | null): this is NodePath<RegExpLiteral>
  • deprecated

    Use isRegExpLiteral

    Parameters

    • Optional props: object | null

    Returns this is NodePath<RegExpLiteral>

isRestElement

  • isRestElement(props?: object | null): this is NodePath<RestElement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<RestElement>

isRestProperty

  • isRestProperty(props?: object | null): this is NodePath<RestElement>
  • deprecated

    Use isRestElement

    Parameters

    • Optional props: object | null

    Returns this is NodePath<RestElement>

isReturnStatement

  • isReturnStatement(props?: object | null): this is NodePath<ReturnStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ReturnStatement>

isScopable

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

    • Optional props: object | null

    Returns this is NodePath<t.Scopable>

isScope

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

    • Optional props: object | null

    Returns this is NodePath<t.Scopable>

isSequenceExpression

  • isSequenceExpression(props?: object | null): this is NodePath<SequenceExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<SequenceExpression>

isSpreadElement

  • isSpreadElement(props?: object | null): this is NodePath<SpreadElement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<SpreadElement>

isSpreadProperty

  • isSpreadProperty(props?: object | null): this is NodePath<SpreadElement>
  • deprecated

    Use isSpreadElement

    Parameters

    • Optional props: object | null

    Returns this is NodePath<SpreadElement>

isStatement

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

    • Optional props: object | null

    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(props?: object | null): this is NodePath<StringLiteral>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<StringLiteral>

isStringLiteralTypeAnnotation

  • isStringLiteralTypeAnnotation(props?: object | null): this is NodePath<StringLiteralTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<StringLiteralTypeAnnotation>

isStringTypeAnnotation

  • isStringTypeAnnotation(props?: object | null): this is NodePath<StringTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<StringTypeAnnotation>

isSuper

  • isSuper(props?: object | null): this is NodePath<Super>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<Super>

isSwitchCase

  • isSwitchCase(props?: object | null): this is NodePath<SwitchCase>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<SwitchCase>

isSwitchStatement

  • isSwitchStatement(props?: object | null): this is NodePath<SwitchStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<SwitchStatement>

isTSAnyKeyword

  • isTSAnyKeyword(props?: object | null): this is NodePath<TSAnyKeyword>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSAnyKeyword>

isTSArrayType

  • isTSArrayType(props?: object | null): this is NodePath<TSArrayType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSArrayType>

isTSAsExpression

  • isTSAsExpression(props?: object | null): this is NodePath<TSAsExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSAsExpression>

isTSBooleanKeyword

  • isTSBooleanKeyword(props?: object | null): this is NodePath<TSBooleanKeyword>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSBooleanKeyword>

isTSCallSignatureDeclaration

  • isTSCallSignatureDeclaration(props?: object | null): this is NodePath<TSCallSignatureDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSCallSignatureDeclaration>

isTSConditionalType

  • isTSConditionalType(props?: object | null): this is NodePath<TSConditionalType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSConditionalType>

isTSConstructSignatureDeclaration

  • isTSConstructSignatureDeclaration(props?: object | null): this is NodePath<TSConstructSignatureDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSConstructSignatureDeclaration>

isTSConstructorType

  • isTSConstructorType(props?: object | null): this is NodePath<TSConstructorType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSConstructorType>

isTSDeclareFunction

  • isTSDeclareFunction(props?: object | null): this is NodePath<TSDeclareFunction>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSDeclareFunction>

isTSDeclareMethod

  • isTSDeclareMethod(props?: object | null): this is NodePath<TSDeclareMethod>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSDeclareMethod>

isTSEntityName

  • isTSEntityName(props?: object | null): this is NodePath<t.TSEntityName>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<t.TSEntityName>

isTSEnumDeclaration

  • isTSEnumDeclaration(props?: object | null): this is NodePath<TSEnumDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSEnumDeclaration>

isTSEnumMember

  • isTSEnumMember(props?: object | null): this is NodePath<TSEnumMember>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSEnumMember>

isTSExportAssignment

  • isTSExportAssignment(props?: object | null): this is NodePath<TSExportAssignment>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSExportAssignment>

isTSExpressionWithTypeArguments

  • isTSExpressionWithTypeArguments(props?: object | null): this is NodePath<TSExpressionWithTypeArguments>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSExpressionWithTypeArguments>

isTSExternalModuleReference

  • isTSExternalModuleReference(props?: object | null): this is NodePath<TSExternalModuleReference>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSExternalModuleReference>

isTSFunctionType

  • isTSFunctionType(props?: object | null): this is NodePath<TSFunctionType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSFunctionType>

isTSImportEqualsDeclaration

  • isTSImportEqualsDeclaration(props?: object | null): this is NodePath<TSImportEqualsDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSImportEqualsDeclaration>

isTSImportType

  • isTSImportType(props?: object | null): this is NodePath<TSImportType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSImportType>

isTSIndexSignature

  • isTSIndexSignature(props?: object | null): this is NodePath<TSIndexSignature>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSIndexSignature>

isTSIndexedAccessType

  • isTSIndexedAccessType(props?: object | null): this is NodePath<TSIndexedAccessType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSIndexedAccessType>

isTSInferType

  • isTSInferType(props?: object | null): this is NodePath<TSInferType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSInferType>

isTSInterfaceBody

  • isTSInterfaceBody(props?: object | null): this is NodePath<TSInterfaceBody>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSInterfaceBody>

isTSInterfaceDeclaration

  • isTSInterfaceDeclaration(props?: object | null): this is NodePath<TSInterfaceDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSInterfaceDeclaration>

isTSIntersectionType

  • isTSIntersectionType(props?: object | null): this is NodePath<TSIntersectionType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSIntersectionType>

isTSLiteralType

  • isTSLiteralType(props?: object | null): this is NodePath<TSLiteralType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSLiteralType>

isTSMappedType

  • isTSMappedType(props?: object | null): this is NodePath<TSMappedType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSMappedType>

isTSMethodSignature

  • isTSMethodSignature(props?: object | null): this is NodePath<TSMethodSignature>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSMethodSignature>

isTSModuleBlock

  • isTSModuleBlock(props?: object | null): this is NodePath<TSModuleBlock>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSModuleBlock>

isTSModuleDeclaration

  • isTSModuleDeclaration(props?: object | null): this is NodePath<TSModuleDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSModuleDeclaration>

isTSNamespaceExportDeclaration

  • isTSNamespaceExportDeclaration(props?: object | null): this is NodePath<TSNamespaceExportDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSNamespaceExportDeclaration>

isTSNeverKeyword

  • isTSNeverKeyword(props?: object | null): this is NodePath<TSNeverKeyword>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSNeverKeyword>

isTSNonNullExpression

  • isTSNonNullExpression(props?: object | null): this is NodePath<TSNonNullExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSNonNullExpression>

isTSNullKeyword

  • isTSNullKeyword(props?: object | null): this is NodePath<TSNullKeyword>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSNullKeyword>

isTSNumberKeyword

  • isTSNumberKeyword(props?: object | null): this is NodePath<TSNumberKeyword>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSNumberKeyword>

isTSObjectKeyword

  • isTSObjectKeyword(props?: object | null): this is NodePath<TSObjectKeyword>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSObjectKeyword>

isTSOptionalType

  • isTSOptionalType(props?: object | null): this is NodePath<TSOptionalType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSOptionalType>

isTSParameterProperty

  • isTSParameterProperty(props?: object | null): this is NodePath<TSParameterProperty>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSParameterProperty>

isTSParenthesizedType

  • isTSParenthesizedType(props?: object | null): this is NodePath<TSParenthesizedType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSParenthesizedType>

isTSPropertySignature

  • isTSPropertySignature(props?: object | null): this is NodePath<TSPropertySignature>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSPropertySignature>

isTSQualifiedName

  • isTSQualifiedName(props?: object | null): this is NodePath<TSQualifiedName>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSQualifiedName>

isTSRestType

  • isTSRestType(props?: object | null): this is NodePath<TSRestType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSRestType>

isTSStringKeyword

  • isTSStringKeyword(props?: object | null): this is NodePath<TSStringKeyword>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSStringKeyword>

isTSSymbolKeyword

  • isTSSymbolKeyword(props?: object | null): this is NodePath<TSSymbolKeyword>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSSymbolKeyword>

isTSThisType

  • isTSThisType(props?: object | null): this is NodePath<TSThisType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSThisType>

isTSTupleType

  • isTSTupleType(props?: object | null): this is NodePath<TSTupleType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSTupleType>

isTSType

  • isTSType(props?: object | null): this is NodePath<t.TSType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<t.TSType>

isTSTypeAliasDeclaration

  • isTSTypeAliasDeclaration(props?: object | null): this is NodePath<TSTypeAliasDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSTypeAliasDeclaration>

isTSTypeAnnotation

  • isTSTypeAnnotation(props?: object | null): this is NodePath<TSTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSTypeAnnotation>

isTSTypeAssertion

  • isTSTypeAssertion(props?: object | null): this is NodePath<TSTypeAssertion>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSTypeAssertion>

isTSTypeElement

  • isTSTypeElement(props?: object | null): this is NodePath<t.TSTypeElement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<t.TSTypeElement>

isTSTypeLiteral

  • isTSTypeLiteral(props?: object | null): this is NodePath<TSTypeLiteral>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSTypeLiteral>

isTSTypeOperator

  • isTSTypeOperator(props?: object | null): this is NodePath<TSTypeOperator>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSTypeOperator>

isTSTypeParameter

  • isTSTypeParameter(props?: object | null): this is NodePath<TSTypeParameter>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSTypeParameter>

isTSTypeParameterDeclaration

  • isTSTypeParameterDeclaration(props?: object | null): this is NodePath<TSTypeParameterDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSTypeParameterDeclaration>

isTSTypeParameterInstantiation

  • isTSTypeParameterInstantiation(props?: object | null): this is NodePath<TSTypeParameterInstantiation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSTypeParameterInstantiation>

isTSTypePredicate

  • isTSTypePredicate(props?: object | null): this is NodePath<TSTypePredicate>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSTypePredicate>

isTSTypeQuery

  • isTSTypeQuery(props?: object | null): this is NodePath<TSTypeQuery>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSTypeQuery>

isTSTypeReference

  • isTSTypeReference(props?: object | null): this is NodePath<TSTypeReference>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSTypeReference>

isTSUndefinedKeyword

  • isTSUndefinedKeyword(props?: object | null): this is NodePath<TSUndefinedKeyword>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSUndefinedKeyword>

isTSUnionType

  • isTSUnionType(props?: object | null): this is NodePath<TSUnionType>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSUnionType>

isTSUnknownKeyword

  • isTSUnknownKeyword(props?: object | null): this is NodePath<TSUnknownKeyword>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSUnknownKeyword>

isTSVoidKeyword

  • isTSVoidKeyword(props?: object | null): this is NodePath<TSVoidKeyword>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TSVoidKeyword>

isTaggedTemplateExpression

  • isTaggedTemplateExpression(props?: object | null): this is NodePath<TaggedTemplateExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TaggedTemplateExpression>

isTemplateElement

  • isTemplateElement(props?: object | null): this is NodePath<TemplateElement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TemplateElement>

isTemplateLiteral

  • isTemplateLiteral(props?: object | null): this is NodePath<TemplateLiteral>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TemplateLiteral>

isTerminatorless

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

    • Optional props: object | null

    Returns this is NodePath<t.Terminatorless>

isThisExpression

  • isThisExpression(props?: object | null): this is NodePath<ThisExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ThisExpression>

isThisTypeAnnotation

  • isThisTypeAnnotation(props?: object | null): this is NodePath<ThisTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ThisTypeAnnotation>

isThrowStatement

  • isThrowStatement(props?: object | null): this is NodePath<ThrowStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<ThrowStatement>

isTryStatement

  • isTryStatement(props?: object | null): this is NodePath<TryStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TryStatement>

isTupleTypeAnnotation

  • isTupleTypeAnnotation(props?: object | null): this is NodePath<TupleTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TupleTypeAnnotation>

isTypeAlias

  • isTypeAlias(props?: object | null): this is NodePath<TypeAlias>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TypeAlias>

isTypeAnnotation

  • isTypeAnnotation(props?: object | null): this is NodePath<TypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TypeAnnotation>

isTypeCastExpression

  • isTypeCastExpression(props?: object | null): this is NodePath<TypeCastExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TypeCastExpression>

isTypeParameter

  • isTypeParameter(props?: object | null): this is NodePath<TypeParameter>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TypeParameter>

isTypeParameterDeclaration

  • isTypeParameterDeclaration(props?: object | null): this is NodePath<TypeParameterDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TypeParameterDeclaration>

isTypeParameterInstantiation

  • isTypeParameterInstantiation(props?: object | null): this is NodePath<TypeParameterInstantiation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TypeParameterInstantiation>

isTypeofTypeAnnotation

  • isTypeofTypeAnnotation(props?: object | null): this is NodePath<TypeofTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<TypeofTypeAnnotation>

isUnaryExpression

  • isUnaryExpression(props?: object | null): this is NodePath<UnaryExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<UnaryExpression>

isUnaryLike

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

    • Optional props: object | null

    Returns this is NodePath<t.UnaryLike>

isUnionTypeAnnotation

  • isUnionTypeAnnotation(props?: object | null): this is NodePath<UnionTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<UnionTypeAnnotation>

isUpdateExpression

  • isUpdateExpression(props?: object | null): this is NodePath<UpdateExpression>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<UpdateExpression>

isUser

  • isUser(props?: object | null): boolean
  • Parameters

    • Optional props: object | null

    Returns boolean

isUserWhitespacable

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

    • Optional props: object | null

    Returns this is NodePath<t.UserWhitespacable>

isVar

  • isVar(props?: object | null): this is NodePath<VariableDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<VariableDeclaration>

isVariableDeclaration

  • isVariableDeclaration(props?: object | null): this is NodePath<VariableDeclaration>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<VariableDeclaration>

isVariableDeclarator

  • isVariableDeclarator(props?: object | null): this is NodePath<VariableDeclarator>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<VariableDeclarator>

isVariance

  • isVariance(props?: object | null): this is NodePath<Variance>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<Variance>

isVoidTypeAnnotation

  • isVoidTypeAnnotation(props?: object | null): this is NodePath<VoidTypeAnnotation>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<VoidTypeAnnotation>

isWhile

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

    • Optional props: object | null

    Returns this is NodePath<t.While>

isWhileStatement

  • isWhileStatement(props?: object | null): this is NodePath<WhileStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<WhileStatement>

isWithStatement

  • isWithStatement(props?: object | null): this is NodePath<WithStatement>
  • Parameters

    • Optional props: object | null

    Returns this is NodePath<WithStatement>

isYieldExpression

  • isYieldExpression(props?: object | null): this is NodePath<YieldExpression>
  • Parameters

    • Optional props: object | null

    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

  • Insert child nodes at the end of the current node.

    Type parameters

    Parameters

    • listKey: ArrayKeys<T>

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

    • nodes: Nodes

      the nodes to insert.

    Returns NodePaths<Nodes>

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>(nodes: Nodes): NodePaths<Nodes>
  • 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.

    Type parameters

    • Nodes: readonly Node[]

    Parameters

    • nodes: Nodes

    Returns NodePaths<Nodes>

replaceInline

  • replaceInline<Nodes>(nodes: Nodes): NodePaths<Nodes>
  • Type parameters

    Parameters

    • nodes: Nodes

    Returns NodePaths<Nodes>

replaceWith

  • Replace the current node with another.

    Type parameters

    Parameters

    Returns [NodePath<T>]

replaceWithMultiple

  • replaceWithMultiple<Nodes>(nodes: Nodes): NodePaths<Nodes>
  • 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.

    Type parameters

    • Nodes: readonly Node[]

    Parameters

    • nodes: Nodes

    Returns NodePaths<Nodes>

replaceWithSourceString

  • replaceWithSourceString(replacement: any): [NodePath]
  • 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 [NodePath]

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

  • Insert child nodes at the start of the current node.

    Type parameters

    Parameters

    • listKey: ArrayKeys<T>

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

    • nodes: Nodes

      the nodes to insert.

    Returns NodePaths<Nodes>

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

Static get

  • Type parameters

    • C: Node

    • K: keyof C

    Parameters

    • opts: { container: C; hub: HubInterface; key: K; listKey?: undefined | string; parent: Node; parentPath: NodePath | null }

    Returns NodePath<C[K]>