unwrapRight
Unwrap le payload d'un Right et renvoie l'entrée inchangée lorsque l'entrée n'est pas Right.
Exemple interactif
Syntaxe
typescript
function unwrapRight<
GenericInput extends unknown
>(
input: GenericInput
): GenericInput extends Right
? Unwrap<GenericInput>
: GenericInputParamètres
input: Valeur à unwrap lorsqu'elle est unRight.
Valeur de retour
Retourne le payload unwrap pour Right, sinon renvoie input inchangé.
Voir aussi
unwrapRightOrThrow– Variante bloquante si l'entrée n'est pasRight.isRight– Type guard pour vérifier le côté right.unwrapByInformation– Unwrap non bloquant basé sur l'information.
