From 65e8da134cb3c14e60297e271bfd5411f3cab71c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 18 Jul 2017 08:48:12 -0700 Subject: [PATCH] Add jsdoc to getNullableType now that it's public --- src/compiler/checker.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 35d7307d4bd..35d63b7e2e7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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 :