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

Function combineUnionThisParam

test/fixtures/snapshot/typescript.js:58182–58191  ·  view source on GitHub ↗
(left, right, mapper)

Source from the content-addressed store, hash-verified

58180 return true;
58181 }
58182 function combineUnionThisParam(left, right, mapper) {
58183 if (!left || !right) {
58184 return left || right;
58185 }
58186 // A signature `this` type might be a read or a write position... It's very possible that it should be invariant
58187 // and we should refuse to merge signatures if there are `this` types and they do not match. However, so as to be
58188 // permissive when calling, for now, we'll intersect the `this` types just like we do for param types in union signatures.
58189 var thisType = getIntersectionType([getTypeOfSymbol(left), instantiateType(getTypeOfSymbol(right), mapper)]);
58190 return createSymbolWithType(left, thisType);
58191 }
58192 function combineUnionParameters(left, right, mapper) {
58193 var leftCount = getParameterCount(left);
58194 var rightCount = getParameterCount(right);

Callers 1

Calls 4

getIntersectionTypeFunction · 0.85
getTypeOfSymbolFunction · 0.85
instantiateTypeFunction · 0.85
createSymbolWithTypeFunction · 0.85

Tested by

no test coverage detected