mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 06:41:59 -06:00
Add jsdoc to getNullableType now that it's public
This commit is contained in:
parent
73cfa64f44
commit
65e8da134c
@ -9955,6 +9955,11 @@ namespace ts {
|
||||
neverType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add undefined or null or both to a type if they are missing.
|
||||
* @param type - type to add undefined and/or null to if not present
|
||||
* @param flags - Either TypeFlags.Undefined or TypeFlags.Null, or both
|
||||
*/
|
||||
function getNullableType(type: Type, flags: TypeFlags): Type {
|
||||
const missing = (flags & ~type.flags) & (TypeFlags.Undefined | TypeFlags.Null);
|
||||
return missing === 0 ? type :
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user