(type, node)
| 73262 | // If the given type is an object or union type with a single signature, and if that signature has at |
| 73263 | // least as many parameters as the given function, return the signature. Otherwise return undefined. |
| 73264 | function getContextualCallSignature(type, node) { |
| 73265 | var signatures = getSignaturesOfType(type, 0 /* SignatureKind.Call */); |
| 73266 | var applicableByArity = ts.filter(signatures, function (s) { return !isAritySmaller(s, node); }); |
| 73267 | return applicableByArity.length === 1 ? applicableByArity[0] : getIntersectedSignatures(applicableByArity); |
| 73268 | } |
| 73269 | /** If the contextual signature has fewer parameters than the function expression, do not use it */ |
| 73270 | function isAritySmaller(signature, target) { |
| 73271 | var targetParameterCount = 0; |
no test coverage detected