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

Function getUnionOrIntersectionProperty

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

Source from the content-addressed store, hash-verified

59318 // these partial properties when identifying discriminant properties, but otherwise they are filtered out
59319 // and do not appear to be present in the union type.
59320 function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
59321 var _a, _b;
59322 var property = ((_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) === null || _a === void 0 ? void 0 : _a.get(name)) ||
59323 !skipObjectFunctionPropertyAugment ? (_b = type.propertyCache) === null || _b === void 0 ? void 0 : _b.get(name) : undefined;
59324 if (!property) {
59325 property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
59326 if (property) {
59327 var properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = ts.createSymbolTable()) : type.propertyCache || (type.propertyCache = ts.createSymbolTable());
59328 properties.set(name, property);
59329 }
59330 }
59331 return property;
59332 }
59333 function getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment) {
59334 var property = getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
59335 // We need to filter out partial properties in union types

Calls 3

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected