On this page

new BasicEvaluatedExpression(): BasicEvaluatedExpression
Attributes
array:any[]
bigint:bigint
bool:boolean
expression:Program | AssignmentProperty | Property | CatchClause | ClassDeclaration | ClassExpression | ClassBody | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | FunctionDeclaration | MethodDefinition | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | PrivateIdentifier | PropertyDefinition | SpreadElement | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | VariableDeclaration | Super | SwitchCase | TemplateElement | VariableDeclarator
falsy:boolean
getMemberRanges:() => [number, number][]
getMembers:() => string[]
getMembersOptionals:() => boolean[]
identifier:string | VariableInfo
nullish:boolean
number:number
range:[number, number]
regExp:RegExp
rootInfo:string | VariableInfo
sideEffects:boolean
string:string
templateStringKind:"cooked" | "raw"
truthy:boolean
type:number
wrappedInnerExpressions:BasicEvaluatedExpression[]
addOptions(options): BasicEvaluatedExpression
Attributes

Adds the provided basic evaluated expression to the basic evaluated expression.


asBool(): boolean | undefined
Returns:boolean | undefined

Creates a boolean representation of this evaluated expression.


asCompileTimeValue(): string | number | bigint | boolean | RegExp | any[] | null | undefined
Returns:string | number | bigint | boolean | RegExp | any[] | null | undefined

As compile time value.


asNullish(): boolean | undefined
Returns:boolean | undefined

Creates a nullish coalescing representation of this evaluated expression.


asString(): string | undefined
Returns:string | undefined

Creates a string representation of this evaluated expression.


couldHaveSideEffects(): boolean
Returns:boolean

Can this expression have side effects?


isArray(): boolean
Returns:boolean

isBigInt(): boolean
Returns:boolean

isBoolean(): boolean
Returns:boolean

isCompileTimeValue(): boolean
Returns:boolean

Is expression a runtime or compile-time value?


isConditional(): boolean
Returns:boolean

isConstArray(): boolean
Returns:boolean

isFalsy(): boolean
Returns:boolean

isIdentifier(): boolean
Returns:boolean

isNull(): boolean
Returns:boolean

isNullish(): boolean | undefined
Returns:boolean | undefined

isNumber(): boolean
Returns:boolean

isPrimitiveType(): boolean | undefined
Returns:boolean | undefined

Is expression a primitive or an object type value?


isRegExp(): boolean
Returns:boolean

isString(): boolean
Returns:boolean

isTemplateString(): boolean
Returns:boolean

isTruthy(): boolean
Returns:boolean

isUndefined(): boolean
Returns:boolean

isUnknown(): boolean
Returns:boolean

isWrapped(): boolean
Returns:boolean

setArray(array): BasicEvaluatedExpression
Attributes

Set's the value of this expression to an array of strings.


setBigInt(bigint): BasicEvaluatedExpression
Attributes

Set's the value of this expression to a BigInt


setBoolean(bool): BasicEvaluatedExpression
Attributes

Set's the value of this expression to a boolean


setExpression(expression?): BasicEvaluatedExpression
Attributes
expression:Program | AssignmentProperty | Property | CatchClause | ClassDeclaration | ClassExpression | ClassBody | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | FunctionDeclaration | MethodDefinition | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | PrivateIdentifier | PropertyDefinition | SpreadElement | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | VariableDeclaration | Super | SwitchCase | TemplateElement | VariableDeclarator

Set the expression node for the expression.


setFalsy(): BasicEvaluatedExpression

setIdentifier(identifier, rootInfo, getMembers, getMembersOptionals?, getMemberRanges?): BasicEvaluatedExpression
Attributes
identifier:string | VariableInfo
rootInfo:string | VariableInfo
getMembers:() => string[]
getMembersOptionals:() => boolean[]
getMemberRanges:() => [number, number][]

Set's the value of this expression to a particular identifier and its members.


setItems(items): BasicEvaluatedExpression
Attributes

Set's the value of this expression to an array of expressions.


setNull(): BasicEvaluatedExpression

setNullish(value): BasicEvaluatedExpression
Attributes

Set's the value of the expression to nullish.


setNumber(number): BasicEvaluatedExpression
Attributes

Set's the value of this expression to a number


setOptions(options): BasicEvaluatedExpression
Attributes

Stores the options of a conditional expression.


setRange(range): BasicEvaluatedExpression
Attributes

Set's the range for the expression.


setRegExp(regExp): BasicEvaluatedExpression
Attributes

Set's the value of this expression to a regular expression


setSideEffects(sideEffects?): BasicEvaluatedExpression
Attributes

Set whether or not the expression has side effects.


setString(string): BasicEvaluatedExpression
Attributes

Updates string using the provided string.


setTemplateString(quasis, parts, kind): BasicEvaluatedExpression
Attributes

Set's the value of this expression to a processed/unprocessed template string. Used for evaluating TemplateLiteral expressions in the JavaScript Parser.


setTruthy(): BasicEvaluatedExpression

setUndefined(): BasicEvaluatedExpression

setWrapped(prefix?, postfix?, innerExpressions?): BasicEvaluatedExpression
Attributes

Wraps an array of expressions with a prefix and postfix expression.