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

Function hasBaseType

test/fixtures/snapshot/typescript.js:56935–56947  ·  view source on GitHub ↗
(type, checkBase)

Source from the content-addressed store, hash-verified

56933 }
56934 // TODO: GH#18217 If `checkBase` is undefined, we should not call this because this will always return false.
56935 function hasBaseType(type, checkBase) {
56936 return check(type);
56937 function check(type) {
56938 if (ts.getObjectFlags(type) & (3 /* ObjectFlags.ClassOrInterface */ | 4 /* ObjectFlags.Reference */)) {
56939 var target = getTargetType(type);
56940 return target === checkBase || ts.some(getBaseTypes(target), check);
56941 }
56942 else if (type.flags & 2097152 /* TypeFlags.Intersection */) {
56943 return ts.some(type.types, check);
56944 }
56945 return false;
56946 }
56947 }
56948 // Appends the type parameters given by a list of declarations to a set of type parameters and returns the resulting set.
56949 // The function allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set
56950 // in-place and returns the same array.

Calls 1

checkFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…