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

Function getContextualTypeForConditionalOperand

test/fixtures/snapshot/typescript.js:72833–72836  ·  view source on GitHub ↗
(node, contextFlags)

Source from the content-addressed store, hash-verified

72831 }
72832 // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type.
72833 function getContextualTypeForConditionalOperand(node, contextFlags) {
72834 var conditional = node.parent;
72835 return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional, contextFlags) : undefined;
72836 }
72837 function getContextualTypeForChildJsxExpression(node, child) {
72838 var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName);
72839 // JSX expression is in children of JSX Element, we will look for an "children" attribute (we get the name from JSX.ElementAttributesProperty)

Callers 1

getContextualTypeFunction · 0.85

Calls 1

getContextualTypeFunction · 0.85

Tested by

no test coverage detected