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

Function getGenericObjectFlags

test/fixtures/snapshot/typescript.js:62263–62280  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

62261 return !!(getGenericObjectFlags(type) & 8388608 /* ObjectFlags.IsGenericIndexType */);
62262 }
62263 function getGenericObjectFlags(type) {
62264 if (type.flags & 3145728 /* TypeFlags.UnionOrIntersection */) {
62265 if (!(type.objectFlags & 2097152 /* ObjectFlags.IsGenericTypeComputed */)) {
62266 type.objectFlags |= 2097152 /* ObjectFlags.IsGenericTypeComputed */ |
62267 ts.reduceLeft(type.types, function (flags, t) { return flags | getGenericObjectFlags(t); }, 0);
62268 }
62269 return type.objectFlags & 12582912 /* ObjectFlags.IsGenericType */;
62270 }
62271 if (type.flags & 33554432 /* TypeFlags.Substitution */) {
62272 if (!(type.objectFlags & 2097152 /* ObjectFlags.IsGenericTypeComputed */)) {
62273 type.objectFlags |= 2097152 /* ObjectFlags.IsGenericTypeComputed */ |
62274 getGenericObjectFlags(type.substitute) | getGenericObjectFlags(type.baseType);
62275 }
62276 return type.objectFlags & 12582912 /* ObjectFlags.IsGenericType */;
62277 }
62278 return (type.flags & 58982400 /* TypeFlags.InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* ObjectFlags.IsGenericObjectType */ : 0) |
62279 (type.flags & (58982400 /* TypeFlags.InstantiableNonPrimitive */ | 4194304 /* TypeFlags.Index */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* ObjectFlags.IsGenericIndexType */ : 0);
62280 }
62281 function getSimplifiedType(type, writing) {
62282 return type.flags & 8388608 /* TypeFlags.IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) :
62283 type.flags & 16777216 /* TypeFlags.Conditional */ ? getSimplifiedConditionalType(type, writing) :

Callers 3

isGenericTypeFunction · 0.85
isGenericObjectTypeFunction · 0.85
isGenericIndexTypeFunction · 0.85

Calls 3

isGenericMappedTypeFunction · 0.85
isGenericTupleTypeFunction · 0.85
isPatternLiteralTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…