Effect CommunityEC
Effect Community2w ago
24 replies
adrtivv

Equivalent Schema.Config Usage for Default Value

import { Config } from "effect";

const SOMETHING = Config.nonEmptyString().pipe(Config.withDefault("something"));

What is equivalent of the above
const SOMETHING = Schema.Config("SOMETHING", Schema.NonEmptyTrimmedString);

when using Schema.Config?

I want for SOMETHING to have a default value if it doesn't exists or exists with
undefined
as value in the execution context.
Was this page helpful?