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

Function getOptionalType

test/fixtures/snapshot/typescript.js:67634–67638  ·  view source on GitHub ↗
(type, isProperty)

Source from the content-addressed store, hash-verified

67632 getUnionType([type, undefinedType, nullType]);
67633 }
67634 function getOptionalType(type, isProperty) {
67635 if (isProperty === void 0) { isProperty = false; }
67636 ts.Debug.assert(strictNullChecks);
67637 return type.flags & 32768 /* TypeFlags.Undefined */ ? type : getUnionType([type, isProperty ? missingType : undefinedType]);
67638 }
67639 function getGlobalNonNullableTypeInstantiation(type) {
67640 // First reduce away any constituents that are assignable to 'undefined' or 'null'. This not only eliminates
67641 // 'undefined' and 'null', but also higher-order types such as a type parameter 'U extends undefined | null'

Callers 14

addOptionalityFunction · 0.85
getTypeOfMappedSymbolFunction · 0.85
getReturnTypeOfSignatureFunction · 0.85
narrowTypeByDiscriminantFunction · 0.85
checkIdentifierFunction · 0.85
getTypeOfParameterFunction · 0.85

Calls 2

getUnionTypeFunction · 0.85
assertMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…