Problem Statement
exactOptionalPropertyTypes: true means…
Explanation
With this flag, `{ a?: number }` is not the same as `{ a: number | undefined }`. Missing is different from present-with-undefined.
Code Solution
SolutionRead Only
// tsconfig.json
{
"compilerOptions": { "exactOptionalPropertyTypes": true }
}
// Now, `{}` may be assignable where `{ a?: number }` is allowed,
// but `{ a: undefined }` follows stricter rules.