Private constructorPrivate Readonly activePrivate Optional Readonly leftPrivate Optional Readonly rightAlias for 'mapRight'. Maps the 'Right' value of the Either to a new value. If the Either is a 'Left', it will return a new 'Left' Either with the same value. If the Either is a 'Right', it will return a new 'Right' Either with the new value.
A new Either with the mapped 'Right' value if it was present, or the same 'Left' value if it was present.
Maps the 'Left' value of the Either to a new value. If the Either is a 'Right', it will return a new 'Right' Either with the same value. If the Either is a 'Left', it will return a new 'Left' Either with the new value.
A new Either with the mapped 'Left' value if it was present, or the same 'Right' value if it was present.
Maps the 'Right' value of the Either to a new value. If the Either is a 'Left', it will return a new 'Left' Either with the same value. If the Either is a 'Right', it will return a new 'Right' Either with the new value.
A new Either with the mapped 'Right' value if it was present, or the same 'Left' value if it was present.
Static leftStatic rightGenerated using TypeDoc
An Either is a datastructure that represents a value that can be of type 'Left' or 'Right'. It is used to represent the result of a computation that can fail. By convention, the 'Left' type is used to represent the failure and the 'Right' type is used to represent the success. An Either supports values that are null or undefined. It's up the consumer to decide if these values are valid or not. When an Either is created, an ActiveSide is set. This ActiveSide is used to determine if the Either is a 'Left' or a 'Right', not the value itself.
Example