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

Function getThisTypeFromContextualType

test/fixtures/snapshot/typescript.js:72334–72338  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

72332 return ts.getObjectFlags(type) & 4 /* ObjectFlags.Reference */ && type.target === globalThisType ? getTypeArguments(type)[0] : undefined;
72333 }
72334 function getThisTypeFromContextualType(type) {
72335 return mapType(type, function (t) {
72336 return t.flags & 2097152 /* TypeFlags.Intersection */ ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t);
72337 });
72338 }
72339 function getContextualThisParameterType(func) {
72340 if (func.kind === 214 /* SyntaxKind.ArrowFunction */) {
72341 return undefined;

Callers 1

Calls 3

mapTypeFunction · 0.85
getThisTypeArgumentFunction · 0.85
forEachMethod · 0.65

Tested by

no test coverage detected