Open vilola opened 1 month ago
When OmitDeep multiple optional fields, final type is not correct. See example.
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnA3geRMGARFFMAXzgDMoIQ4ByJVAWjJQGcYaBuAWAChf60mMDGAQAdgEMANgDlWMFABM4AXgy84muBIBc6nlsNwARgH496DUesC9bKMDEBzbgetxir93ADG5-d6GtnD2ji5W1p4RRor+lm6BCMgodjAOzl7uUQkergCQTv4ARKHORQA0vHkAFsWlThW82fzJcHJsSqoBWrrd1sYW0d7B9ZmRY0Y+gznDyanp4TNa2d6K04maI2lhE4Yry-lOeiXbZZU8Ncf1jTzNPAD093AACpTGUiggEiI+cGASsBaqDgBCIQhE4mkABV5F1sLhQWAADzg0SSWTyJTlOBFCQAOmMRTgAB8cfifEUAHwTR5wAB6pl4vFpAHVcNU4GIIPAIMI0dJyMAUFJFCw4LgxQB3aAAazCQLQiJhbDhOHwhGR7QUimxuIJRNJeop1KZDyeUN5cA+ADdhXB4fBpVA5c44JL2XBeRD0Qr7XzIVJlfA1A6Uf70VqsTiGiScdUqdFaQzeEA
You mean the result has extra undefined?
Try set exactOptionalPropertyTypes: true in tsconfig.
exactOptionalPropertyTypes: true
Bug description
When OmitDeep multiple optional fields, final type is not correct. See example.
Repro
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnA3geRMGARFFMAXzgDMoIQ4ByJVAWjJQGcYaBuAWAChf60mMDGAQAdgEMANgDlWMFABM4AXgy84muBIBc6nlsNwARgH496DUesC9bKMDEBzbgetxir93ADG5-d6GtnD2ji5W1p4RRor+lm6BCMgodjAOzl7uUQkergCQTv4ARKHORQA0vHkAFsWlThW82fzJcHJsSqoBWrrd1sYW0d7B9ZmRY0Y+gznDyanp4TNa2d6K04maI2lhE4Yry-lOeiXbZZU8Ncf1jTzNPAD093AACpTGUiggEiI+cGASsBaqDgBCIQhE4mkABV5F1sLhQWAADzg0SSWTyJTlOBFCQAOmMRTgAB8cfifEUAHwTR5wAB6pl4vFpAHVcNU4GIIPAIMI0dJyMAUFJFCw4LgxQB3aAAazCQLQiJhbDhOHwhGR7QUimxuIJRNJeop1KZDyeUN5cA+ADdhXB4fBpVA5c44JL2XBeRD0Qr7XzIVJlfA1A6Uf70VqsTiGiScdUqdFaQzeEA
Upvote & Fund