(u: unknown): u is Config<unknown>Returns true if u is a Config instance.
When to use
Use when you need to distinguish a Config from an unknown value before
calling .parse or unwrap.
Example (Checking Config values)
import { Config } from "effect"
console.log(Config.isConfig(Config.string("HOST"))) // true
console.log(Config.isConfig("not a config")) // falseguardsunwrap
Source effect/Config.ts:481 lines
export const const isConfig: (
u: unknown
) => u is Config<unknown>
Returns true if u is a Config instance.
When to use
Use when you need to distinguish a Config from an unknown value before
calling .parse or
unwrap
.
Example (Checking Config values)
import { Config } from "effect"
console.log(Config.isConfig(Config.string("HOST"))) // true
console.log(Config.isConfig("not a config")) // false
isConfig = (u: unknownu: unknown): u: unknownu is interface Config<out T>A recipe for extracting a typed value T from a ConfigProvider.
When to use
Use to describe typed configuration that can be parsed from a provider or
yielded inside Effect.gen.
Details
Key members:
parse(provider, pathPrefix?) – runs the config against a specific provider.
The optional path prefix is the logical scope accumulated from outer
Config.nested calls.
- Yieldable – can be yielded inside
Effect.gen, which automatically
resolves the current ConfigProvider from the context.
- Pipeable – supports
.pipe(Config.map(...)) etc.
Config<unknown> => import PredicatePredicate.const hasProperty: <"~effect/Config">(self: unknown, property: "~effect/Config") => self is { [K in "~effect/Config"]: unknown; } (+1 overload)hasProperty(u: unknownu, const TypeId: "~effect/Config"TypeId)Referenced by 1 symbols