Package: effect
Module: Record
Partitions a record of Either values into two separate records,
one with the Left values and one with the Right values.
Example
import * as assert from "node:assert"
import { Record, Either } from "effect"
assert.deepStrictEqual(
Record.separate({ a: Either.left("e"), b: Either.right(1) }),
[{ a: "e" }, { b: 1 }]
)
Signature
declare const separate: <K extends string, A, B>(self: ReadonlyRecord<K, Either<B, A>>) => [Record<ReadonlyRecord.NonLiteralKey<K>, A>, Record<ReadonlyRecord.NonLiteralKey<K>, B>]
Since v2.0.0