Package: effect
Module: Array
Converts a record into an array of [key, value] tuples.
When to use
Use to convert a record into an array of key-value tuples for iteration or transformation.
Details
Key order follows Object.entries semantics. Empty records produce an empty
array.
Example (Converting a record to entries)
import { Array } from "effect"
const result = Array.fromRecord({ a: 1, b: 2, c: 3 })
console.log(result) // [["a", 1], ["b", 2], ["c", 3]]
See
Record.toEntries the equivalent function from the Record moduleRecord.fromEntries to build a record from an array of tuplesSignature
declare const fromRecord: <K extends string, A>(self: Readonly<Record<K, A>>) => Array<[K, A]>
Since v2.0.0