Package: effect
Module: Config
Transforms the parsed value of a config with a pure function.
When to use
Use when you need to transform a parsed config value with a function that cannot fail.
Example (Uppercasing a string config)
import { Config, ConfigProvider, Effect } from "effect"
const upper = Config.string("name").pipe(
Config.map((s) => s.toUpperCase())
)
const provider = ConfigProvider.fromUnknown({ name: "alice" })
// Effect.runSync(upper.parse(provider)) // "ALICE"
See
mapOrFail – when the transformation can failSignature
declare const map: { <A, B>(f: (a: A) => B): (self: Config<A>) => Config<B>; <A, B>(self: Config<A>, f: (a: A) => B): Config<B>; }
Since v2.0.0