(keys: ReadonlySet<string>, value?: string): NodeCreates a Record node representing an object-like container with known
child keys.
When to use
Use when you need to describe a directory or JSON object inside a custom provider.
Details
The optional value allows a node to be both a container and a leaf at the
same time (for example, an env var A=x that also has children A_FOO and
A_BAR).
Example (Creating a record node)
import { ConfigProvider } from "effect"
const node = ConfigProvider.makeRecord(new Set(["host", "port"]))
// { _tag: "Record", keys: Set(["host", "port"]), value: undefined }export function function makeRecord(
keys: ReadonlySet<string>,
value?: string
): Node
Creates a Record node representing an object-like container with known
child keys.
When to use
Use when you need to describe a directory or JSON object inside a custom
provider.
Details
The optional value allows a node to be both a container and a leaf at the
same time (for example, an env var A=x that also has children A_FOO and
A_BAR).
Example (Creating a record node)
import { ConfigProvider } from "effect"
const node = ConfigProvider.makeRecord(new Set(["host", "port"]))
// { _tag: "Record", keys: Set(["host", "port"]), value: undefined }
makeRecord(keys: ReadonlySet<string>keys: interface ReadonlySet<T>ReadonlySet<string>, value: string | undefinedvalue?: string): type Node =
| {
readonly _tag: "Value"
readonly value: string
}
| {
readonly _tag: "Record"
readonly keys: ReadonlySet<string>
readonly value: string | undefined
}
| {
readonly _tag: "Array"
readonly length: number
readonly value: string | undefined
}
A discriminated union describing the shape of a configuration value at a
given path.
When to use
Use when implementing a custom ConfigProvider by returning raw
nodes from the get callback passed to
make
, or when inspecting raw
provider output before schema parsing.
Details
Value is a terminal string leaf. Record is an object-like container
whose immediate child keys are known and may carry an optional co-located
value. Array is an indexed container with a known length and may also
carry an optional co-located value.
Node {
return { _tag: "Record"_tag: "Record", keys: ReadonlySet<string>keys, value: string | undefinedvalue }
}