* 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
(type, flags)
| 67625 | * @param flags - Either TypeFlags.Undefined or TypeFlags.Null, or both |
| 67626 | */ |
| 67627 | function getNullableType(type, flags) { |
| 67628 | var missing = (flags & ~type.flags) & (32768 /* TypeFlags.Undefined */ | 65536 /* TypeFlags.Null */); |
| 67629 | return missing === 0 ? type : |
| 67630 | missing === 32768 /* TypeFlags.Undefined */ ? getUnionType([type, undefinedType]) : |
| 67631 | missing === 65536 /* TypeFlags.Null */ ? getUnionType([type, nullType]) : |
| 67632 | getUnionType([type, undefinedType, nullType]); |
| 67633 | } |
| 67634 | function getOptionalType(type, isProperty) { |
| 67635 | if (isProperty === void 0) { isProperty = false; } |
| 67636 | ts.Debug.assert(strictNullChecks); |
no test coverage detected
searching dependent graphs…