expect
Helper orienté typage qui renvoie le même Either en conservant strictement les types Left/Right.
Exemple interactif
Syntaxe
typescript
function expect<
GenericEither extends Right | Left
>(
input: GenericEither
): GenericEither;Paramètres
input: Valeur Either à préserver.
Valeur de retour
Renvoie exactement la même valeur runtime que l'entrée. La fonction sert surtout à préserver un typage Either strict dans des flux composés.
Voir aussi
matchInformation- Matching exhaustif par information.matchInformationOtherwise- Matching non exhaustif avec fallback.
