Add jsdoc to getNullableType now that it's public

This commit is contained in:
Nathan Shively-Sanders 2017-07-18 08:48:12 -07:00
parent 73cfa64f44
commit 65e8da134c

View File

@ -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 :