effect-io-ai

Package: effect
Module: Iterable

Iterable.fromRecord

Takes a record and returns an Iterable of tuples containing its keys and values.

Example

import * as assert from "node:assert"
import { fromRecord } from "effect/Iterable"

const x = { a: 1, b: 2, c: 3 }
assert.deepStrictEqual(Array.from(fromRecord(x)), [["a", 1], ["b", 2], ["c", 3]])

Signature

declare const fromRecord: <K extends string, A>(self: Readonly<Record<K, A>>) => Iterable<[K, A]>

Source

Since v2.0.0