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

Function getContextualTypeForArgument

test/fixtures/snapshot/typescript.js:72579–72583  ·  view source on GitHub ↗
(callTarget, arg)

Source from the content-addressed store, hash-verified

72577 }
72578 // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter.
72579 function getContextualTypeForArgument(callTarget, arg) {
72580 var args = getEffectiveCallArguments(callTarget);
72581 var argIndex = args.indexOf(arg); // -1 for e.g. the expression of a CallExpression, or the tag of a TaggedTemplateExpression
72582 return argIndex === -1 ? undefined : getContextualTypeForArgumentAtIndex(callTarget, argIndex);
72583 }
72584 function getContextualTypeForArgumentAtIndex(callTarget, argIndex) {
72585 if (ts.isImportCall(callTarget)) {
72586 return argIndex === 0 ? stringType :

Callers 2

getContextualTypeFunction · 0.85

Calls 3

indexOfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…