Hyperlinkv0.8.0-beta.28

Config

Config.Booleanconsteffect/Config.ts:686
Schema.decodeTo<
  Schema.Boolean,
  Schema.Literals<
    readonly ["true", "yes", "on", "1", "y", "false", "no", "off", "0", "n"]
  >,
  never,
  never
>

Schema for boolean values encoded as strings.

When to use

Use when you need the reusable boolean schema value for Config.schema with custom paths.

Details

Accepted string values: true, false, yes, no, on, off, 1, 0, y, n (case-sensitive).

schemasboolean
Source effect/Config.ts:6869 lines
export const Boolean = Schema.Literals([...TrueValues.literals, ...FalseValues.literals]).pipe(
  Schema.decodeTo(
    Schema.Boolean,
    SchemaTransformation.transform({
      decode: (value) => value === "true" || value === "yes" || value === "on" || value === "1" || value === "y",
      encode: (value) => value ? "true" : "false"
    })
  )
)
Referenced by 1 symbols