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

Function checkDeclarationInitializer

test/fixtures/snapshot/typescript.js:79536–79545  ·  view source on GitHub ↗
(declaration, checkMode, contextualType)

Source from the content-addressed store, hash-verified

79534 ts.isJSDocTypeAssertion(node);
79535 }
79536 function checkDeclarationInitializer(declaration, checkMode, contextualType) {
79537 var initializer = ts.getEffectiveInitializer(declaration);
79538 var type = getQuickTypeOfExpression(initializer) ||
79539 (contextualType ?
79540 checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, checkMode || 0 /* CheckMode.Normal */)
79541 : checkExpressionCached(initializer, checkMode));
79542 return ts.isParameter(declaration) && declaration.name.kind === 202 /* SyntaxKind.ArrayBindingPattern */ &&
79543 isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ?
79544 padTupleType(type, declaration.name) : type;
79545 }
79546 function padTupleType(type, pattern) {
79547 var patternElements = pattern.elements;
79548 var elementTypes = getTypeArguments(type).slice();

Calls 6

getQuickTypeOfExpressionFunction · 0.85
checkExpressionCachedFunction · 0.85
isTupleTypeFunction · 0.85
getTypeReferenceArityFunction · 0.85
padTupleTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…