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

Function getSingleSignature

test/fixtures/snapshot/typescript.js:75421–75434  ·  view source on GitHub ↗
(type, kind, allowMembers)

Source from the content-addressed store, hash-verified

75419 getSingleSignature(type, 1 /* SignatureKind.Construct */, /*allowMembers*/ false);
75420 }
75421 function getSingleSignature(type, kind, allowMembers) {
75422 if (type.flags & 524288 /* TypeFlags.Object */) {
75423 var resolved = resolveStructuredTypeMembers(type);
75424 if (allowMembers || resolved.properties.length === 0 && resolved.indexInfos.length === 0) {
75425 if (kind === 0 /* SignatureKind.Call */ && resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0) {
75426 return resolved.callSignatures[0];
75427 }
75428 if (kind === 1 /* SignatureKind.Construct */ && resolved.constructSignatures.length === 1 && resolved.callSignatures.length === 0) {
75429 return resolved.constructSignatures[0];
75430 }
75431 }
75432 }
75433 return undefined;
75434 }
75435 // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec)
75436 function instantiateSignatureInContextOf(signature, contextualSignature, inferenceContext, compareTypes) {
75437 var context = createInferenceContext(signature.typeParameters, signature, 0 /* InferenceFlags.None */, compareTypes);

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…