effect-io-ai

Package: effect
Module: Struct

Struct.Record

Creates a record with the given keys and value.

When to use

Use to build an object where each provided key receives the same value.

Example (Creating a record)

import { Struct } from "effect"

const record = Struct.Record(["a", "b"], "value")
console.log(record) // { a: "value", b: "value" }

Signature

declare const Record: <const Keys extends ReadonlyArray<string | symbol>, Value>(keys: Keys, value: Value) => Record<Keys[number], Value>

Source

Since v4.0.0