effect-io-ai

Package: effect
Module: Iterable

Iterable.fromRecord

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

Example (Converting a record to entries)

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

const x = { a: 1, b: 2, c: 3 }
assert.deepStrictEqual(Array.from(Iterable.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