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

Function checkNonNullTypeWithReporter

test/fixtures/snapshot/typescript.js:74489–74501  ·  view source on GitHub ↗
(type, node, reportError)

Source from the content-addressed store, hash-verified

74487 ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);
74488 }
74489 function checkNonNullTypeWithReporter(type, node, reportError) {
74490 if (strictNullChecks && type.flags & 2 /* TypeFlags.Unknown */) {
74491 error(node, ts.Diagnostics.Object_is_of_type_unknown);
74492 return errorType;
74493 }
74494 var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304 /* TypeFlags.Nullable */;
74495 if (kind) {
74496 reportError(node, kind);
74497 var t = getNonNullableType(type);
74498 return t.flags & (98304 /* TypeFlags.Nullable */ | 131072 /* TypeFlags.Never */) ? errorType : t;
74499 }
74500 return type;
74501 }
74502 function checkNonNullType(type, node) {
74503 return checkNonNullTypeWithReporter(type, node, reportObjectPossiblyNullOrUndefinedError);
74504 }

Callers 2

checkNonNullTypeFunction · 0.85
resolveCallExpressionFunction · 0.85

Calls 4

getFalsyFlagsFunction · 0.85
reportErrorFunction · 0.85
getNonNullableTypeFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…