Skip to content
1 min read · 107 words

Function: unwrapExpression() ​

ts
function unwrapExpression(node: Node): Node;

Defined in: src/eslint/rules/common.ts:63

Strips every transparent expression wrapper (as X, satisfies X, <X>, !, ?., parens) from node and returns the node that actually carries the value.

Parameters ​

ParameterType
nodeNode

Returns ​

Node

Remarks ​

Every rule in this plugin (and the identical copies carried by the sandbox and skills battery lint modules — a battery may not import this untagged module, see CONTRIBUTING's barrel rule) unwraps an argument or property value with this before testing its node type, so a wrapped literal is inspected exactly like a bare one.