Skip to content

Commit 65e8da1

Browse files
committed
Add jsdoc to getNullableType now that it's public
1 parent 73cfa64 commit 65e8da1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9955,6 +9955,11 @@ namespace ts {
99559955
neverType;
99569956
}
99579957

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+
*/
99589963
function getNullableType(type: Type, flags: TypeFlags): Type {
99599964
const missing = (flags & ~type.flags) & (TypeFlags.Undefined | TypeFlags.Null);
99609965
return missing === 0 ? type :

0 commit comments

Comments
 (0)