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

Function hasNarrowableArgument

test/fixtures/snapshot/typescript.js:45371–45385  ·  view source on GitHub ↗
(expr)

Source from the content-addressed store, hash-verified

45369 return isNarrowableReference(expr) || ts.isOptionalChain(expr) && containsNarrowableReference(expr.expression);
45370 }
45371 function hasNarrowableArgument(expr) {
45372 if (expr.arguments) {
45373 for (var _i = 0, _a = expr.arguments; _i < _a.length; _i++) {
45374 var argument = _a[_i];
45375 if (containsNarrowableReference(argument)) {
45376 return true;
45377 }
45378 }
45379 }
45380 if (expr.expression.kind === 206 /* SyntaxKind.PropertyAccessExpression */ &&
45381 containsNarrowableReference(expr.expression.expression)) {
45382 return true;
45383 }
45384 return false;
45385 }
45386 function isNarrowingTypeofOperands(expr1, expr2) {
45387 return ts.isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && ts.isStringLiteralLike(expr2);
45388 }

Callers 1

isNarrowingExpressionFunction · 0.85

Calls 1

Tested by

no test coverage detected