MCPcopy Index your code
hub / github.com/Effect-TS/effect / getRights

Function getRights

packages/effect/src/Record.ts:766–778  ·  view source on GitHub ↗
(
  self: ReadonlyRecord<K, Either<R, L>>
)

Source from the content-addressed store, hash-verified

764 * @since 2.0.0
765 */
766export 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.

Callers

nothing calls this directly

Calls 2

emptyFunction · 0.70
keysFunction · 0.70

Tested by

no test coverage detected