MCPcopy Index your code
hub / github.com/nodejs/node / isLogicalExpression

Function isLogicalExpression

test/fixtures/snapshot/typescript.js:45501–45515  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

45499 return false;
45500 }
45501 function isLogicalExpression(node) {
45502 while (true) {
45503 if (node.kind === 212 /* SyntaxKind.ParenthesizedExpression */) {
45504 node = node.expression;
45505 }
45506 else if (node.kind === 219 /* SyntaxKind.PrefixUnaryExpression */ && node.operator === 53 /* SyntaxKind.ExclamationToken */) {
45507 node = node.operand;
45508 }
45509 else {
45510 return node.kind === 221 /* SyntaxKind.BinaryExpression */ && (node.operatorToken.kind === 55 /* SyntaxKind.AmpersandAmpersandToken */ ||
45511 node.operatorToken.kind === 56 /* SyntaxKind.BarBarToken */ ||
45512 node.operatorToken.kind === 60 /* SyntaxKind.QuestionQuestionToken */);
45513 }
45514 }
45515 }
45516 function isLogicalAssignmentExpression(node) {
45517 node = ts.skipParentheses(node);
45518 return ts.isBinaryExpression(node) && ts.isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind);

Callers 2

bindConditionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected