We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73cfa64 commit 65e8da1Copy full SHA for 65e8da1
src/compiler/checker.ts
@@ -9955,6 +9955,11 @@ namespace ts {
9955
neverType;
9956
}
9957
9958
+ /**
9959
+ * Add undefined or null or both to a type if they are missing.
9960
+ * @param type - type to add undefined and/or null to if not present
9961
+ * @param flags - Either TypeFlags.Undefined or TypeFlags.Null, or both
9962
+ */
9963
function getNullableType(type: Type, flags: TypeFlags): Type {
9964
const missing = (flags & ~type.flags) & (TypeFlags.Undefined | TypeFlags.Null);
9965
return missing === 0 ? type :
0 commit comments