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

Function getTypeOfDestructuredProperty

test/fixtures/snapshot/typescript.js:69689–69696  ·  view source on GitHub ↗
(type, name)

Source from the content-addressed store, hash-verified

69687 type;
69688 }
69689 function getTypeOfDestructuredProperty(type, name) {
69690 var _a;
69691 var nameType = getLiteralTypeFromPropertyName(name);
69692 if (!isTypeUsableAsPropertyName(nameType))
69693 return errorType;
69694 var text = getPropertyNameFromType(nameType);
69695 return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((_a = getApplicableIndexInfoForName(type, text)) === null || _a === void 0 ? void 0 : _a.type) || errorType;
69696 }
69697 function getTypeOfDestructuredArrayElement(type, index) {
69698 return everyType(type, isTupleLikeType) && getTupleElementType(type, index) ||
69699 includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65 /* IterationUse.Destructuring */, type, undefinedType, /*errorNode*/ undefined)) ||

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…