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

Function isMixinConstructorType

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

Source from the content-addressed store, hash-verified

57055 // A type is a mixin constructor if it has a single construct signature taking no type parameters and a single
57056 // rest parameter of type any[].
57057 function isMixinConstructorType(type) {
57058 var signatures = getSignaturesOfType(type, 1 /* SignatureKind.Construct */);
57059 if (signatures.length === 1) {
57060 var s = signatures[0];
57061 if (!s.typeParameters && s.parameters.length === 1 && signatureHasRestParameter(s)) {
57062 var paramType = getTypeOfParameter(s.parameters[0]);
57063 return isTypeAny(paramType) || getElementTypeOfArrayType(paramType) === anyType;
57064 }
57065 }
57066 return false;
57067 }
57068 function isConstructorType(type) {
57069 if (getSignaturesOfType(type, 1 /* SignatureKind.Construct */).length > 0) {
57070 return true;

Callers 2

isConstructorTypeFunction · 0.85

Calls 5

getSignaturesOfTypeFunction · 0.85
getTypeOfParameterFunction · 0.85
isTypeAnyFunction · 0.85

Tested by

no test coverage detected