MCPcopy Create free account
hub / github.com/nodejs/node / expressionCouldBeVariableDeclaration

Function expressionCouldBeVariableDeclaration

test/fixtures/snapshot/typescript.js:150721–150731  ·  view source on GitHub ↗
(expression, checker)

Source from the content-addressed store, hash-verified

150719 }
150720 }
150721 function expressionCouldBeVariableDeclaration(expression, checker) {
150722 if (!ts.isBinaryExpression(expression)) {
150723 return false;
150724 }
150725 if (expression.operatorToken.kind === 27 /* SyntaxKind.CommaToken */) {
150726 return ts.every([expression.left, expression.right], function (expression) { return expressionCouldBeVariableDeclaration(expression, checker); });
150727 }
150728 return expression.operatorToken.kind === 63 /* SyntaxKind.EqualsToken */
150729 && ts.isIdentifier(expression.left)
150730 && !checker.getSymbolAtLocation(expression.left);
150731 }
150732 })(codefix = ts.codefix || (ts.codefix = {}));
150733})(ts || (ts = {}));
150734/* @internal */

Callers 1

makeChangeFunction · 0.85

Calls 1

everyMethod · 0.80

Tested by

no test coverage detected