( self: ReadonlyRecord<K, Either<R, L>> )
| 764 | * @since 2.0.0 |
| 765 | */ |
| 766 | export const getRights = <K extends string, R, L>( |
| 767 | self: ReadonlyRecord<K, Either<R, L>> |
| 768 | ): Record<string, R> => { |
| 769 | const out: Record<string, R> = empty() |
| 770 | for (const key of keys(self)) { |
| 771 | const value = self[key] |
| 772 | if (E.isRight(value)) { |
| 773 | out[key] = value.right |
| 774 | } |
| 775 | } |
| 776 | |
| 777 | return out |
| 778 | } |
| 779 | |
| 780 | /** |
| 781 | * Partitions the elements of a record into two groups: those that match a predicate, and those that don't. |