effect-io-ai

Package: effect
Module: Config

Config.literal

Creates a config that only accepts a specific literal value.

When to use

Use to restrict a config to a single, specific literal value.

Details

Shortcut for Config.schema(Schema.Literal(literal), name).

Example (Restricting to a literal)

import { Config } from "effect"

const env = Config.literal("production", "ENV")

See

Signature

declare const literal: <L extends SchemaAST.LiteralValue>(literal: L, name?: string) => Config<L>

Source

Since v2.0.0