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

Function getSuggestedLibForNonExistentProperty

test/fixtures/snapshot/typescript.js:74953–74968  ·  view source on GitHub ↗
(missingProperty, containingType)

Source from the content-addressed store, hash-verified

74951 }
74952 }
74953 function getSuggestedLibForNonExistentProperty(missingProperty, containingType) {
74954 var container = getApparentType(containingType).symbol;
74955 if (!container) {
74956 return undefined;
74957 }
74958 var allFeatures = ts.getScriptTargetFeatures();
74959 var libTargets = ts.getOwnKeys(allFeatures);
74960 for (var _i = 0, libTargets_2 = libTargets; _i < libTargets_2.length; _i++) {
74961 var libTarget = libTargets_2[_i];
74962 var featuresOfLib = allFeatures[libTarget];
74963 var featuresOfContainingType = featuresOfLib[ts.symbolName(container)];
74964 if (featuresOfContainingType !== undefined && ts.contains(featuresOfContainingType, missingProperty)) {
74965 return libTarget;
74966 }
74967 }
74968 }
74969 function getSuggestedSymbolForNonexistentClassMember(name, baseType) {
74970 return getSpellingSuggestionForName(name, getPropertiesOfType(baseType), 106500 /* SymbolFlags.ClassMember */);
74971 }

Callers 1

Calls 2

getApparentTypeFunction · 0.85
containsMethod · 0.45

Tested by

no test coverage detected