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

Function getEffectiveTypeParameterDeclarations

test/fixtures/snapshot/typescript.js:13214–13236  ·  view source on GitHub ↗

* Gets the effective type parameters. If the node was parsed in a * JavaScript file, gets the type parameters from the `@template` tag from JSDoc.

(node)

Source from the content-addressed store, hash-verified

13212 * JavaScript file, gets the type parameters from the `@template` tag from JSDoc.
13213 */
13214 function getEffectiveTypeParameterDeclarations(node) {
13215 if (ts.isJSDocSignature(node)) {
13216 return ts.emptyArray;
13217 }
13218 if (ts.isJSDocTypeAlias(node)) {
13219 ts.Debug.assert(node.parent.kind === 320 /* SyntaxKind.JSDoc */);
13220 return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });
13221 }
13222 if (node.typeParameters) {
13223 return node.typeParameters;
13224 }
13225 if (ts.isInJSFile(node)) {
13226 var decls = ts.getJSDocTypeParameterDeclarations(node);
13227 if (decls.length) {
13228 return decls;
13229 }
13230 var typeTag = getJSDocType(node);
13231 if (typeTag && ts.isFunctionTypeNode(typeTag) && typeTag.typeParameters) {
13232 return typeTag.typeParameters;
13233 }
13234 }
13235 return ts.emptyArray;
13236 }
13237 ts.getEffectiveTypeParameterDeclarations = getEffectiveTypeParameterDeclarations;
13238 function getEffectiveConstraintOfTypeParameter(node) {
13239 return node.constraint ? node.constraint :

Callers

nothing calls this directly

Calls 3

getJSDocTypeFunction · 0.85
assertMethod · 0.80
flatMapMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…