effect-io-ai

Package: effect
Module: SchemaGetter

SchemaGetter.joinKeyValue

Joins a record of key-value pairs into a delimited string.

When to use

Use when you need a schema getter to serialize a present decoded record as a delimited key-value string.

Details

The getter is pure and never fails. It joins entries with separator (default ,) and joins each key and value with keyValueSeparator (default =).

Example (Joining key-value records)

import { SchemaGetter } from "effect"

const join = SchemaGetter.joinKeyValue()
// { a: "1", b: "2" } -> "a=1,b=2"

See

Signature

declare const joinKeyValue: <E extends Record<PropertyKey, string>>(options?: { readonly separator?: string | undefined; readonly keyValueSeparator?: string | undefined; }) => Getter<string, E>

Source

Since v4.0.0