MCPcopy Create free account
hub / github.com/effect-app/libs / schema

Function schema

repos/effect/packages/effect/src/Config.ts:642–660  ·  view source on GitHub ↗
(codec: Schema.Codec<T, E>, path?: string | ConfigProvider.Path)

Source from the content-addressed store, hash-verified

640 *
641 * const makeConfig = (config: Config.Wrap<Options>): Config.Config<Options> =>
642 * Config.unwrap(config)
643 *
644 * const config = makeConfig({ key: Config.string("key") })
645 * const provider = ConfigProvider.fromUnknown({ key: "value" })
646 * Effect.runSync(config.parse(provider)) // => { key: "value" }
647 * ```
648 *
649 * @see {@link Wrap} – the utility type accepted by this function
650 *
651 * @category converting
652 * @since 2.0.0
653 */
654export const unwrap = <T>(wrapped: Wrap<T>): Config<T> => {
655 if (isConfig(wrapped)) return wrapped
656 return all(Rec.map(wrapped as Record<string, Wrap<any>>, (config) => unwrap(config))) as Config<T>
657}
658
659// -----------------------------------------------------------------------------
660// schema
661// -----------------------------------------------------------------------------
662
663interface ConfigCursor {

Callers 15

stringFunction · 0.70
nonEmptyStringFunction · 0.70
numberFunction · 0.70
finiteFunction · 0.70
intFunction · 0.70
literalFunction · 0.70
literalsFunction · 0.70
booleanFunction · 0.70
durationFunction · 0.70
portFunction · 0.70
logLevelFunction · 0.70
redactedFunction · 0.70

Calls 5

makeFunction · 0.70
recurFunction · 0.70
decodeUnknownEffectFunction · 0.70
pipeMethod · 0.65
toCodecStringTreeMethod · 0.45

Tested by 1

assertMemoizedFunction · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…