C'est la nouvelle erreur qui apparaît dans le code typographique.
Je ne suis pas en mesure de réaliser la logique derrière cela.
Documentation
/*When using the delete operator in strictNullChecks,
the operand must now be any, unknown, never, or be optional
(in that it contains undefined in the type). Otherwise, use of the delete operator is an error.*/
interface Thing {
prop: string;
}
function f(x: Thing) {
delete x.prop; // throws error = The operand of a 'delete' operator must be optional.
}
3 votes
Votre question inclut la réponse...
When using the delete operator in strictNullChecks, the operand must now be any, unknown, never, or be optional