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

Function getUnionIndexInfos

test/fixtures/snapshot/typescript.js:58254–58271  ·  view source on GitHub ↗
(types)

Source from the content-addressed store, hash-verified

58252 return result;
58253 }
58254 function getUnionIndexInfos(types) {
58255 var sourceInfos = getIndexInfosOfType(types[0]);
58256 if (sourceInfos) {
58257 var result = [];
58258 var _loop_11 = function (info) {
58259 var indexType = info.keyType;
58260 if (ts.every(types, function (t) { return !!getIndexInfoOfType(t, indexType); })) {
58261 result.push(createIndexInfo(indexType, getUnionType(ts.map(types, function (t) { return getIndexTypeOfType(t, indexType); })), ts.some(types, function (t) { return getIndexInfoOfType(t, indexType).isReadonly; })));
58262 }
58263 };
58264 for (var _i = 0, sourceInfos_1 = sourceInfos; _i < sourceInfos_1.length; _i++) {
58265 var info = sourceInfos_1[_i];
58266 _loop_11(info);
58267 }
58268 return result;
58269 }
58270 return ts.emptyArray;
58271 }
58272 function resolveUnionTypeMembers(type) {
58273 // The members and properties collections are empty for union types. To get all properties of a union
58274 // type use getPropertiesOfType (only the language service uses this).

Callers 2

resolveUnionTypeMembersFunction · 0.85
getSpreadTypeFunction · 0.85

Calls 2

getIndexInfosOfTypeFunction · 0.85
_loop_11Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…