mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Remove 'T?' notation from type-to-string conversion
This commit is contained in:
@@ -1885,10 +1885,6 @@ namespace ts {
|
||||
else if (type.flags & TypeFlags.Tuple) {
|
||||
writeTupleType(<TupleType>type);
|
||||
}
|
||||
else if (isNullableType(type) && (<UnionType>type).types.length > 2) {
|
||||
writeType(getNonNullableType(type), TypeFormatFlags.InElementType);
|
||||
writePunctuation(writer, SyntaxKind.QuestionToken);
|
||||
}
|
||||
else if (type.flags & TypeFlags.UnionOrIntersection) {
|
||||
writeUnionOrIntersectionType(<UnionOrIntersectionType>type, flags);
|
||||
}
|
||||
@@ -6531,10 +6527,6 @@ namespace ts {
|
||||
getUnionType([nullType, undefinedType]) : nullType : undefinedType;
|
||||
}
|
||||
|
||||
function isNullableType(type: Type) {
|
||||
return getNullableKind(type) === TypeFlags.Nullable;
|
||||
}
|
||||
|
||||
function addNullableKind(type: Type, kind: TypeFlags): Type {
|
||||
if ((getNullableKind(type) & kind) !== kind) {
|
||||
const types = [type];
|
||||
|
||||
Reference in New Issue
Block a user